From d82d485e752feea1ed44fce05480e5bdaa853d19 Mon Sep 17 00:00:00 2001 From: Anton Evangelatov Date: Fri, 21 Dec 2018 15:13:49 +0100 Subject: [PATCH] swarm: use external build arg --- swarm/docker/Dockerfile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/swarm/docker/Dockerfile b/swarm/docker/Dockerfile index 003bbc0a1d..1ee4e97342 100644 --- a/swarm/docker/Dockerfile +++ b/swarm/docker/Dockerfile @@ -1,13 +1,16 @@ FROM golang:1.11-alpine as builder +ARG VERSION + RUN apk add --update git gcc g++ linux-headers RUN mkdir -p $GOPATH/src/github.com/ethereum && \ cd $GOPATH/src/github.com/ethereum && \ - git clone --depth 1 https://github.com/ethersphere/go-ethereum && \ + git clone https://github.com/ethersphere/go-ethereum && \ cd $GOPATH/src/github.com/ethereum/go-ethereum && \ - VERSION=$(git rev-parse --short HEAD) go install -ldflags "-X main.gitCommit=${VERSION}" ./cmd/swarm && \ - VERSION=$(git rev-parse --short HEAD) go install -ldflags "-X main.gitCommit=${VERSION}" ./cmd/swarm/swarm-smoke && \ - VERSION=$(git rev-parse --short HEAD) go install -ldflags "-X main.gitCommit=${VERSION}" ./cmd/geth && \ + git checkout ${VERSION} && \ + go install -ldflags "-X main.gitCommit=${VERSION}" ./cmd/swarm && \ + go install -ldflags "-X main.gitCommit=${VERSION}" ./cmd/swarm/swarm-smoke && \ + go install -ldflags "-X main.gitCommit=${VERSION}" ./cmd/geth && \ cp $GOPATH/bin/swarm /swarm && cp $GOPATH/bin/geth /geth && cp $GOPATH/bin/swarm-smoke /swarm-smoke