Skip to content

Commit 0bc4181

Browse files
committed
playground: correct ARG scoping in Dockerfile
ARG is scoped to the build context. In order for it to be global in a Dockerfile, it needs to happen before any FROM statement. Updates golang/go#25224 Change-Id: Iea38d04e36f54a416e21c2e42ac88c03f2db057d Reviewed-on: https://go-review.googlesource.com/c/playground/+/227589 Reviewed-by: Andrew Bonventre <[email protected]> Reviewed-by: Carlos Amedee <[email protected]>
1 parent 9d1e738 commit 0bc4181

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# Use of this source code is governed by a BSD-style
33
# license that can be found in the LICENSE file.
44

5+
ARG GO_VERSION=go1.14.1
6+
57
############################################################################
68
FROM debian:buster AS nacl
79

@@ -20,7 +22,6 @@ ENV GOPATH /go
2022
ENV PATH /usr/local/go/bin:$GOPATH/bin:$PATH
2123
ENV GOROOT_BOOTSTRAP /usr/local/gobootstrap
2224
ENV GO_BOOTSTRAP_VERSION go1.13.9
23-
ARG GO_VERSION=go1.14.1
2425
ENV GO_VERSION ${GO_VERSION}
2526

2627
# Fake time
@@ -74,6 +75,8 @@ FROM golang:1.13 AS temp_pre_go14
7475
ENV BUILD_DEPS 'curl git gcc patch libc6-dev ca-certificates'
7576
RUN apt-get update && apt-get install -y --no-install-recommends ${BUILD_DEPS}
7677

78+
ARG GO_VERSION
79+
ENV GO_VERSION ${GO_VERSION}
7780
RUN cd /usr/local && git clone https://go.googlesource.com/go go1.14 && cd go1.14 && git reset --hard $GO_VERSION
7881
WORKDIR /usr/local/go1.14/src
7982
RUN ./make.bash

0 commit comments

Comments
 (0)