@@ -17,6 +17,9 @@ ARCH_LIST ?= amd64 arm arm64 ppc64le s390x
17
17
RELEASE_ARCH_LIST = amd64 arm64
18
18
# The output type could either be docker (local), or registry.
19
19
OUTPUT_TYPE ?= docker
20
+ GO_TOOLCHAIN ?= golang
21
+ GO_VERSION ?= 1.21.6
22
+ BASEIMAGE ?= gcr.io/distroless/static-debian11:nonroot
20
23
21
24
ifeq ($(GOPATH ) ,)
22
25
export GOPATH := $(shell go env GOPATH)
@@ -199,7 +202,7 @@ docker-push: docker-push/proxy-agent docker-push/proxy-server
199
202
docker-build/proxy-agent : cmd/agent/main.go proto/agent/agent.pb.go buildx-setup
200
203
@[ " ${TAG} " ] || ( echo " TAG is not set" ; exit 1 )
201
204
echo " Building proxy-agent for ${ARCH} "
202
- ${DOCKER_CMD} buildx build . --pull --output=type=$(OUTPUT_TYPE ) --platform linux/$(ARCH ) --build-arg ARCH=$(ARCH ) -f artifacts/images/agent-build.Dockerfile -t ${AGENT_FULL_IMAGE} -$(ARCH ) :${TAG}
205
+ ${DOCKER_CMD} buildx build . --pull --output=type=$(OUTPUT_TYPE ) --platform linux/$(ARCH ) --build-arg GO_TOOLCHAIN= $( GO_TOOLCHAIN ) --build-arg GO_VERSION= $( GO_VERSION ) --build-arg ARCH=$(ARCH ) --build-arg BASEIMAGE= $( BASEIMAGE ) -f artifacts/images/agent-build.Dockerfile -t ${AGENT_FULL_IMAGE} -$(ARCH ) :${TAG}
203
206
204
207
.PHONY : docker-push/proxy-agent
205
208
docker-push/proxy-agent : docker-build/proxy-agent
@@ -210,7 +213,7 @@ docker-push/proxy-agent: docker-build/proxy-agent
210
213
docker-build/proxy-server : cmd/server/main.go proto/agent/agent.pb.go buildx-setup
211
214
@[ " ${TAG} " ] || ( echo " TAG is not set" ; exit 1 )
212
215
echo " Building proxy-server for ${ARCH} "
213
- ${DOCKER_CMD} buildx build . --pull --output=type=$(OUTPUT_TYPE ) --platform linux/$(ARCH ) --build-arg ARCH=$(ARCH ) -f artifacts/images/server-build.Dockerfile -t ${SERVER_FULL_IMAGE} -$(ARCH ) :${TAG}
216
+ ${DOCKER_CMD} buildx build . --pull --output=type=$(OUTPUT_TYPE ) --platform linux/$(ARCH ) --build-arg GO_TOOLCHAIN= $( GO_TOOLCHAIN ) --build-arg GO_VERSION= $( GO_VERSION ) --build-arg ARCH=$(ARCH ) --build-arg BASEIMAGE= $( BASEIMAGE ) -f artifacts/images/server-build.Dockerfile -t ${SERVER_FULL_IMAGE} -$(ARCH ) :${TAG}
214
217
215
218
.PHONY : docker-push/proxy-server
216
219
docker-push/proxy-server : docker-build/proxy-server
@@ -221,7 +224,7 @@ docker-push/proxy-server: docker-build/proxy-server
221
224
docker-build/proxy-test-client : cmd/test-client/main.go proto/agent/agent.pb.go buildx-setup
222
225
@[ " ${TAG} " ] || ( echo " TAG is not set" ; exit 1 )
223
226
echo " Building proxy-test-client for ${ARCH} "
224
- ${DOCKER_CMD} buildx build . --pull --output=type=$(OUTPUT_TYPE ) --platform linux/$(ARCH ) --build-arg ARCH=$(ARCH ) -f artifacts/images/test-client-build.Dockerfile -t ${TEST_CLIENT_FULL_IMAGE} -$(ARCH ) :${TAG}
227
+ ${DOCKER_CMD} buildx build . --pull --output=type=$(OUTPUT_TYPE ) --platform linux/$(ARCH ) --build-arg GO_TOOLCHAIN= $( GO_TOOLCHAIN ) --build-arg GO_VERSION= $( GO_VERSION ) --build-arg ARCH=$(ARCH ) --build-arg BASEIMAGE= $( BASEIMAGE ) -f artifacts/images/test-client-build.Dockerfile -t ${TEST_CLIENT_FULL_IMAGE} -$(ARCH ) :${TAG}
225
228
226
229
.PHONY : docker-push/proxy-test-client
227
230
docker-push/proxy-test-client : docker-build/proxy-test-client
@@ -232,7 +235,7 @@ docker-push/proxy-test-client: docker-build/proxy-test-client
232
235
docker-build/http-test-server : cmd/test-server/main.go buildx-setup
233
236
@[ " ${TAG} " ] || ( echo " TAG is not set" ; exit 1 )
234
237
echo " Building http-test-server for ${ARCH} "
235
- ${DOCKER_CMD} buildx build . --pull --output=type=$(OUTPUT_TYPE ) --platform linux/$(ARCH ) --build-arg ARCH=$(ARCH ) -f artifacts/images/test-server-build.Dockerfile -t ${TEST_SERVER_FULL_IMAGE} -$(ARCH ) :${TAG}
238
+ ${DOCKER_CMD} buildx build . --pull --output=type=$(OUTPUT_TYPE ) --platform linux/$(ARCH ) --build-arg GO_TOOLCHAIN= $( GO_TOOLCHAIN ) --build-arg GO_VERSION= $( GO_VERSION ) --build-arg ARCH=$(ARCH ) --build-arg BASEIMAGE= $( BASEIMAGE ) -f artifacts/images/test-server-build.Dockerfile -t ${TEST_SERVER_FULL_IMAGE} -$(ARCH ) :${TAG}
236
239
237
240
.PHONY : docker-push/http-test-server
238
241
docker-push/http-test-server : docker-build/http-test-server
0 commit comments