From db78048a838c314c685dfc7e24eb8b65672f16b7 Mon Sep 17 00:00:00 2001 From: TuanAnh Nguyen <33578509+piggy2303@users.noreply.github.com> Date: Tue, 8 Oct 2024 11:01:37 +0700 Subject: [PATCH] Update Dockerfile to using cache layer Signed-off-by: jimmy Signed-off-by: piggy2303 --- docker/Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 0d5fb6f66..9e37aec46 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -4,16 +4,19 @@ ARG NVIDIA_IMAGE=nvidia/cuda:12.2.0-devel-ubuntu20.04 FROM $GOLANG_IMAGE AS build FROM $GOLANG_IMAGE AS gobuild ARG GOPROXY +ADD go.mod /k8s-vgpu +ADD go.sum /k8s-vgpu +RUN go mod download ADD . /k8s-vgpu #RUN --mount=type=cache,target=/go/pkg/mod \ # cd /k8s-vgpu && make all RUN cd /k8s-vgpu && make all FROM $NVIDIA_IMAGE AS nvbuild -COPY ./libvgpu /libvgpu -WORKDIR /libvgpu ENV DEBIAN_FRONTEND=noninteractive RUN apt-get -y update; apt-get -y install cmake +COPY ./libvgpu /libvgpu +WORKDIR /libvgpu RUN bash ./build.sh FROM nvidia/cuda:12.4.1-base-ubuntu22.04