Skip to content

Commit c77eaae

Browse files
thaJeztahArko Dasgupta
authored andcommitted
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>
1 parent b7055e8 commit c77eaae

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
FROM golang:1.12.6 as dev
1+
ARG GO_VERSION=1.12.6
2+
3+
FROM golang:${GO_VERSION} as dev
24
RUN apt-get update && apt-get -y install iptables \
35
protobuf-compiler
46

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ all-local: build-local check-local clean
3636
# builder builds the libnetworkbuild container. All wrapper targets
3737
# must depend on this to ensure that the container exists.
3838
builder:
39-
docker build -t ${build_image} ${dockerbuildargs}
39+
docker build -t ${build_image} --build-arg=GO_VERSION ${dockerbuildargs}
4040

4141
build: builder
4242
@echo "🐳 $@"

0 commit comments

Comments
 (0)