mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Dockerfile: use GO_VERSION build-arg for overriding Go version
This allows overriding the version of Go without making modifications in the source code, which can be useful to test against multiple versions. For example: make GO_VERSION=1.13beta1 build Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
d07c890b48
commit
5fa03a4a8e
2 changed files with 4 additions and 2 deletions
|
@ -1,4 +1,6 @@
|
|||
FROM golang:1.12.6 as dev
|
||||
ARG GO_VERSION=1.12.6
|
||||
|
||||
FROM golang:${GO_VERSION} as dev
|
||||
RUN apt-get update && apt-get -y install iptables \
|
||||
protobuf-compiler
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ all-local: build-local check-local clean
|
|||
# builder builds the libnetworkbuild container. All wrapper targets
|
||||
# must depend on this to ensure that the container exists.
|
||||
builder:
|
||||
docker build -t ${build_image} ${dockerbuildargs}
|
||||
docker build -t ${build_image} --build-arg=GO_VERSION ${dockerbuildargs}
|
||||
|
||||
build: builder
|
||||
@echo "🐳 $@"
|
||||
|
|
Loading…
Reference in a new issue