Skip to content

Commit 24e68da

Browse files
BennettJamesBennett Sala
andauthored
Allow for configuration of GORPOXY in docker build (#655)
Co-authored-by: Bennett Sala <[email protected]>
1 parent 983ade6 commit 24e68da

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ COPY go.mod go.sum ./
1010
# uncomment if using vendor
1111
# COPY ./vendor ./vendor
1212

13+
ARG GOPROXY
14+
ENV GOPROXY=${GOPROXY}
15+
1316
RUN go mod download
1417

1518
COPY . ./

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ generate: controller-gen
8888
# Requires buildx to be installed: https://docs.docker.com/buildx/working-with-buildx/
8989
# By default the TARGETPLATFORM is set to linux/amd64, change the value if you are building for linux/arm64
9090
docker-build: check-env test
91-
docker buildx build --platform linux/amd64 -t $(IMAGE) . --load
91+
docker buildx build --platform linux/amd64 --build-arg GOPROXY=$(GOPROXY) -t $(IMAGE) . --load
9292

9393
docker-push: check-env
9494
docker push $(IMAGE)

0 commit comments

Comments
 (0)