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