Skip to content

Commit 1b7e05b

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

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616

1717
FROM golang:1.24 AS builder
1818

19+
ARG GOPROXY
20+
ENV GOPROXY=$GOPROXY
21+
1922
WORKDIR /workspace
2023
ADD ./go.mod ./
2124
ADD ./go.sum ./

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ GO_PLUGIN_LDFLAGS ?= $(PLUGIN_VERSION_LDFLAGS)
5050
GO_TAGS ?= -tags no_openssl
5151
GO_GCFLAGS ?=
5252
export GOPATH?=$(shell go env GOPATH)
53+
GOPROXY ?=
5354

5455
# Go tools
5556
GO = go
@@ -152,7 +153,7 @@ test-coverage: | plugins-coverage envtest gocovmerge gcov2lcov ## Run coverage t
152153
# Container image
153154
.PHONY: image
154155
image: ; $(info Building Docker image...) ## Build conatiner image
155-
$(IMAGE_BUILDER) build -t $(TAG) -f $(DOCKERFILE) $(CURDIR) $(IMAGE_BUILD_OPTS)
156+
$(IMAGE_BUILDER) build -t $(TAG) -f $(DOCKERFILE) $(CURDIR) -build-arg GOPROXY="$(GOPROXY)" $(IMAGE_BUILD_OPTS)
156157

157158
# Misc
158159

0 commit comments

Comments
 (0)