diff --git a/Dockerfile b/Dockerfile index 47f84d00..587971e6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,9 @@ COPY go.mod go.sum ./ # uncomment if using vendor # COPY ./vendor ./vendor +ARG GOPROXY +ENV GOPROXY=${GOPROXY} + RUN go mod download COPY . ./ diff --git a/Makefile b/Makefile index 2c0e743b..3d3c35a2 100644 --- a/Makefile +++ b/Makefile @@ -88,7 +88,7 @@ generate: controller-gen # Requires buildx to be installed: https://docs.docker.com/buildx/working-with-buildx/ # By default the TARGETPLATFORM is set to linux/amd64, change the value if you are building for linux/arm64 docker-build: check-env test - docker buildx build --platform linux/amd64 -t $(IMAGE) . --load + docker buildx build --platform linux/amd64 --build-arg GOPROXY=$(GOPROXY) -t $(IMAGE) . --load docker-push: check-env docker push $(IMAGE)