blob: 16d11567880e85ed56d957c420d53978c3ad22b3 [file] [log] [blame]
FROM golang:1.16 as cos-gpu-installer-go-builder
COPY . /work/
WORKDIR /work/src/cmd/cos_gpu_installer
ARG TARGETOS
ARG TARGETARCH
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o cos-gpu-installer main.go
# Dockerfile for the COS GPU Installer container.
FROM debian:9
LABEL maintainer="cos-containers@google.com"
COPY --from=cos-gpu-installer-go-builder /work/src/cmd/cos_gpu_installer/cos-gpu-installer /cos-gpu-installer
# Install minimal tools needed to build kernel modules.
RUN apt-get update -qq && \
apt-get install -y xz-utils kmod git make bc curl ccache \
libc6-dev pciutils gcc libelf-dev libssl-dev bison flex keyutils python2.7-minimal && \
rm -rf /var/lib/apt/lists/* && \
# x86_64-cros-linux-gnu-clang depends on /usr/bin/python2
ln -s /usr/bin/python2.7 /usr/bin/python2
ENTRYPOINT ["/cos-gpu-installer"]
CMD ["install"]