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 <millscj01@gmail.com>
This commit is contained in:
Chris Mills
2020-04-13 23:29:29 +01:00
committed by GitHub
parent a8467661c2
commit 05438234ed
+2 -1
View File
@@ -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