Skip to content

Commit 76b8f11

Browse files
authored
Merge pull request #52 from e0ne/goproxy
feat: add support for image building with a custom GOPROXY
2 parents f21eb10 + 5603324 commit 76b8f11

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
@@ -17,6 +17,9 @@
1717
# Build the image
1818
FROM golang:1.24 as builder
1919

20+
ARG GOPROXY
21+
ENV GOPROXY=$GOPROXY
22+
2023
WORKDIR /workspace
2124
# Copy the Go Modules manifests
2225
COPY go.mod go.mod

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ TARGET_ARCH ?= $(shell go env GOARCH)
3838
GO_BUILD_OPTS ?= CGO_ENABLED=0 GOOS=$(TARGET_OS) GOARCH=$(TARGET_ARCH)
3939
# Linker flags for go build command
4040
GO_LDFLAGS = $(VERSION_LDFLAGS)
41+
GOPROXY ?=
4142

4243

4344
PKGS = $(or $(PKG),$(shell cd $(PROJECT_DIR) && go list ./...))
@@ -91,7 +92,7 @@ build: ## Build binary
9192

9293
.PHONY: docker-build
9394
docker-build: ## Build docker image with ipam binaries
94-
$(DOCKER_CMD) build -t $(IMG) -f $(DOCKERFILE) .
95+
$(DOCKER_CMD) build -t $(IMG) -f $(DOCKERFILE) --build-arg GOPROXY="$(GOPROXY)" .
9596

9697
.PHONY: docker-push
9798
docker-push: ## Push docker image with ipam binaries

0 commit comments

Comments
 (0)