From b9e7d6fb74e5c6737867a72b83a9f8adea71a17a Mon Sep 17 00:00:00 2001 From: xhe Date: Wed, 27 Sep 2023 14:09:17 +0800 Subject: [PATCH] *: fix docker file for new arg (#372) Signed-off-by: xhe --- Makefile | 4 ++-- docker/Dockerfile | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 45966f17..eee9cb04 100644 --- a/Makefile +++ b/Makefile @@ -89,7 +89,7 @@ clean: rm -rf bin dist grafonnet-lib docker: - docker build -t "$(DOCKERPREFIX)tiproxy:$(IMAGE_TAG)" --build-arg "GOPROXY=$(shell go env GOPROXY)" --build-arg "VERSION=$(VERSION)" --build-arg "COMMIT=$(COMMIT)" -f docker/Dockerfile . + docker build -t "$(DOCKERPREFIX)tiproxy:$(IMAGE_TAG)" --build-arg "GOPROXY=$(shell go env GOPROXY)" --build-arg "VERSION=$(VERSION)" --build-arg "COMMIT=$(COMMIT)" --build-arg "BRANCH=$(BRANCH)" -f docker/Dockerfile . docker-release: - docker buildx build --platform linux/amd64,linux/arm64 --push -t "$(DOCKERPREFIX)tiproxy:$(IMAGE_TAG)" --build-arg "GOPROXY=$(shell go env GOPROXY)" --build-arg "VERSION=$(VERSION)" --build-arg "COMMIT=$(COMMIT)" -f docker/Dockerfile . + docker buildx build --platform linux/amd64,linux/arm64 --push -t "$(DOCKERPREFIX)tiproxy:$(IMAGE_TAG)" --build-arg "GOPROXY=$(shell go env GOPROXY)" --build-arg "VERSION=$(VERSION)" --build-arg "COMMIT=$(COMMIT)" --build-arg "BRANCH=$(BRANCH)" -f docker/Dockerfile . diff --git a/docker/Dockerfile b/docker/Dockerfile index 9030aa15..395c052f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -2,11 +2,12 @@ FROM alpine:edge as builder RUN apk add --no-cache --progress git make go ARG VERSION +ARG BRANCH ARG COMMIT ARG GOPROXY ADD . /proxy RUN export GOPROXY=${GOPROXY} && cd /proxy && go mod download -x -RUN export VERSION=${VERSION} && export COMMIT=${COMMIT} && export GOPROXY=${GOPROXY} && cd /proxy && make cmd +RUN export VERSION=${VERSION} && export BRANCH=${BRANCH} && export COMMIT=${COMMIT} && export GOPROXY=${GOPROXY} && cd /proxy && make cmd FROM alpine:latest