From 05438234ed596735029df15255e53ce313f3acc3 Mon Sep 17 00:00:00 2001 From: Chris Mills Date: Mon, 13 Apr 2020 23:29:29 +0100 Subject: [PATCH] Fix issue with build arg in drone deployment (#1602) The ARG before the FROM call in multistage builds is dropped with the previous container. We need to define it globally Signed-off-by: Chris M --- cmd/proxy/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/proxy/Dockerfile b/cmd/proxy/Dockerfile index 1ed423bf..1fdceb3a 100644 --- a/cmd/proxy/Dockerfile +++ b/cmd/proxy/Dockerfile @@ -6,6 +6,8 @@ # See project Makefile if using make. # See docker --build-arg if building directly. ARG GOLANG_VERSION=1.14 +ARG ALPINE_VERSION=3.11.5 + FROM golang:${GOLANG_VERSION}-alpine AS builder WORKDIR $GOPATH/src/github.com/gomods/athens @@ -16,7 +18,6 @@ ARG VERSION="unset" RUN DATE="$(date -u +%Y-%m-%d-%H:%M:%S-%Z)" && GO111MODULE=on CGO_ENABLED=0 GOPROXY="https://proxy.golang.org" go build -ldflags "-X github.com/gomods/athens/pkg/build.version=$VERSION -X github.com/gomods/athens/pkg/build.buildDate=$DATE" -o /bin/athens-proxy ./cmd/proxy -ARG ALPINE_VERSION=3.11.5 FROM alpine:${ALPINE_VERSION} ENV GO111MODULE=on