Skip to content

Commit 05ec84f

Browse files
committed
feat: add support for image building with a custom GOPROXY
Signed-off-by: Ivan Kolodyazhny <[email protected]>
1 parent 8a0f603 commit 05ec84f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ FROM golang:1.24 AS builder
1919
ARG TARGETOS
2020
ARG TARGETARCH
2121
ARG GCFLAGS
22+
ARG GOPROXY
23+
ENV GOPROXY=$GOPROXY
2224

2325
WORKDIR /workspace
2426
# Copy the Go Modules manifests

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ TARGETARCH ?= $(shell go env GOARCH)
8484
GO_BUILD_OPTS ?= CGO_ENABLED=0 GOOS=$(TARGETOS) GOARCH=$(TARGETARCH)
8585
GO_LDFLAGS ?= $(VERSION_LDFLAGS)
8686
GO_GCFLAGS ?=
87+
GOPROXY ?=
8788

8889
# PKGs to test
8990
PKGS = $$(go list ./... | grep -v /e2e | grep -v ".*/mocks")
@@ -172,7 +173,7 @@ build: $(BUILDDIR) ## Build manager binary.
172173
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
173174
.PHONY: docker-build
174175
docker-build: ## Build docker image with the manager.
175-
$(CONTAINER_TOOL) build -t ${IMG} .
176+
$(CONTAINER_TOOL) build -t ${IMG} --build-arg GOPROXY="$(GOPROXY)" .
176177

177178
.PHONY: docker-push
178179
docker-push: ## Push docker image with the manager.

0 commit comments

Comments
 (0)