contrib: Dockerfile: use build-arg for go-version

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2019-04-05 11:41:51 +02:00
parent eea500d122
commit ba9e1ea23c
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C

View File

@ -6,20 +6,22 @@
# 3.) $ make binaries install test # 3.) $ make binaries install test
# #
ARG GOLANG_VERSION=1.11
# Install proto3 # Install proto3
FROM golang:1.11 AS proto3 FROM golang:${GOLANG_VERSION} AS proto3
RUN apt-get update && apt-get install -y autoconf automake g++ libtool unzip RUN apt-get update && apt-get install -y autoconf automake g++ libtool unzip
COPY script/setup/install-protobuf install-protobuf COPY script/setup/install-protobuf install-protobuf
RUN ./install-protobuf RUN ./install-protobuf
# Install runc # Install runc
FROM golang:1.11 AS runc FROM golang:${GOLANG_VERSION} AS runc
RUN apt-get update && apt-get install -y curl libseccomp-dev RUN apt-get update && apt-get install -y curl libseccomp-dev
COPY vendor.conf /go/src/github.com/containerd/containerd/vendor.conf COPY vendor.conf /go/src/github.com/containerd/containerd/vendor.conf
COPY script/setup/install-runc install-runc COPY script/setup/install-runc install-runc
RUN ./install-runc RUN ./install-runc
FROM golang:1.11 FROM golang:${GOLANG_VERSION} AS dev
RUN apt-get update && apt-get install -y btrfs-tools gcc git libseccomp-dev make xfsprogs RUN apt-get update && apt-get install -y btrfs-tools gcc git libseccomp-dev make xfsprogs
COPY --from=proto3 /usr/local/bin/protoc /usr/local/bin/protoc COPY --from=proto3 /usr/local/bin/protoc /usr/local/bin/protoc