diff --git a/Dockerfile b/Dockerfile index cbff476..dc1cce8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,6 +19,8 @@ FROM golang:1.24 AS builder ARG TARGETOS ARG TARGETARCH ARG GCFLAGS +ARG GOPROXY +ENV GOPROXY=$GOPROXY WORKDIR /workspace # Copy the Go Modules manifests diff --git a/Makefile b/Makefile index ce772a1..5eb6f73 100644 --- a/Makefile +++ b/Makefile @@ -84,6 +84,7 @@ TARGETARCH ?= $(shell go env GOARCH) GO_BUILD_OPTS ?= CGO_ENABLED=0 GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) GO_LDFLAGS ?= $(VERSION_LDFLAGS) GO_GCFLAGS ?= +GOPROXY ?= # PKGs to test PKGS = $$(go list ./... | grep -v /e2e | grep -v ".*/mocks") @@ -172,7 +173,7 @@ build: $(BUILDDIR) ## Build manager binary. # More info: https://docs.docker.com/develop/develop-images/build_enhancements/ .PHONY: docker-build docker-build: ## Build docker image with the manager. - $(CONTAINER_TOOL) build -t ${IMG} . + $(CONTAINER_TOOL) build -t ${IMG} --build-arg GOPROXY="$(GOPROXY)" . .PHONY: docker-push docker-push: ## Push docker image with the manager.