- Dockerfile: linux-headers-amd64 meta-package instead of pinned ABI; remove DEBIAN_KERNEL_ABI build-arg (no longer needed at image build time) - build-in-container.sh: drop --build-arg DEBIAN_KERNEL_ABI - build.sh: apt-get update + detect ABI from apt-cache at build time; auto-install linux-headers-<ABI> if kernel changed since image build Image rebuild is now needed only when changing Go version or lb tools, not on every Debian kernel point release. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
44 lines
934 B
Docker
44 lines
934 B
Docker
FROM debian:12
|
|
|
|
ARG GO_VERSION=1.24.0
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
RUN apt-get update -qq && apt-get install -y \
|
|
ca-certificates \
|
|
live-build \
|
|
debootstrap \
|
|
squashfs-tools \
|
|
xorriso \
|
|
grub-pc-bin \
|
|
grub-efi-amd64-bin \
|
|
mtools \
|
|
git \
|
|
wget \
|
|
curl \
|
|
tar \
|
|
xz-utils \
|
|
rsync \
|
|
build-essential \
|
|
gcc \
|
|
make \
|
|
perl \
|
|
linux-headers-amd64 \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN arch="$(dpkg --print-architecture)" \
|
|
&& case "$arch" in \
|
|
amd64) goarch=amd64 ;; \
|
|
arm64) goarch=arm64 ;; \
|
|
*) echo "unsupported architecture: $arch" >&2; exit 1 ;; \
|
|
esac \
|
|
&& wget -q -O /tmp/go.tar.gz "https://go.dev/dl/go${GO_VERSION}.linux-${goarch}.tar.gz" \
|
|
&& rm -rf /usr/local/go \
|
|
&& tar -C /usr/local -xzf /tmp/go.tar.gz \
|
|
&& rm -f /tmp/go.tar.gz
|
|
|
|
ENV PATH=/usr/local/go/bin:${PATH}
|
|
WORKDIR /work
|
|
|
|
CMD ["/bin/bash"]
|