From c817f506bb68b053860ecf9bd2cbbf184c974a0a Mon Sep 17 00:00:00 2001 From: Jeff Nelson Date: Fri, 12 May 2023 13:56:23 -0500 Subject: [PATCH] remove go mod download from dockerfiles --- scripts/dockerfiles/Dockerfile.init | 8 +------- scripts/dockerfiles/Dockerfile.metrics | 4 ---- scripts/dockerfiles/Dockerfile.release | 5 ----- 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/scripts/dockerfiles/Dockerfile.init b/scripts/dockerfiles/Dockerfile.init index e9bd30c9a6..07820997af 100644 --- a/scripts/dockerfiles/Dockerfile.init +++ b/scripts/dockerfiles/Dockerfile.init @@ -8,14 +8,8 @@ ARG TARGETARCH ENV GO111MODULE=on ENV GOPROXY=direct -# Copy modules in before the rest of the source to only expire cache on module changes: -COPY go.mod go.sum ./ -RUN go mod download - -COPY Makefile ./ -RUN make plugins && make debug-script - COPY . ./ +RUN make plugins && make debug-script RUN make build-aws-vpc-cni-init # Build from EKS minimal base + glibc by default diff --git a/scripts/dockerfiles/Dockerfile.metrics b/scripts/dockerfiles/Dockerfile.metrics index a7a3c14b8e..5644c3c0b5 100644 --- a/scripts/dockerfiles/Dockerfile.metrics +++ b/scripts/dockerfiles/Dockerfile.metrics @@ -7,10 +7,6 @@ WORKDIR /go/src/github.com/aws/amazon-vpc-cni-k8s ENV GO111MODULE=on ENV GOPROXY=direct -# Copy modules in before the rest of the source to only expire cache on module changes: -COPY go.mod go.sum ./ -RUN go mod download - COPY . ./ RUN make build-metrics diff --git a/scripts/dockerfiles/Dockerfile.release b/scripts/dockerfiles/Dockerfile.release index e2205402f4..e974297883 100644 --- a/scripts/dockerfiles/Dockerfile.release +++ b/scripts/dockerfiles/Dockerfile.release @@ -8,11 +8,6 @@ ARG TARGETARCH ENV GO111MODULE=on ENV GOPROXY=direct -# Copy modules in before the rest of the source to only expire cache on module changes: -COPY go.mod go.sum ./ -RUN go mod download - -COPY Makefile ./ COPY . ./ RUN make build-aws-vpc-cni && make build-linux