From 5fa03a4a8e4e0510bff21918ec919b0003bb7497 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 18 Jul 2019 11:01:07 +0200 Subject: [PATCH] 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 --- libnetwork/Dockerfile | 4 +++- libnetwork/Makefile | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libnetwork/Dockerfile b/libnetwork/Dockerfile index dd4787abb7..20a04a437f 100644 --- a/libnetwork/Dockerfile +++ b/libnetwork/Dockerfile @@ -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 diff --git a/libnetwork/Makefile b/libnetwork/Makefile index 90f2a36625..9edc922e77 100644 --- a/libnetwork/Makefile +++ b/libnetwork/Makefile @@ -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 "🐳 $@"