From bff99ecc75417c3e428cb1883da34a60de3204e0 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 18 Oct 2020 21:02:08 -0700 Subject: [PATCH] build add git version --- docker/Dockerfile.go_build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docker/Dockerfile.go_build b/docker/Dockerfile.go_build index 306ce3aa1..3628d0c0d 100644 --- a/docker/Dockerfile.go_build +++ b/docker/Dockerfile.go_build @@ -2,7 +2,9 @@ FROM frolvlad/alpine-glibc as builder RUN apk add git go g++ RUN mkdir -p /go/src/github.com/chrislusf/ RUN git clone https://github.com/chrislusf/seaweedfs /go/src/github.com/chrislusf/seaweedfs -RUN cd /go/src/github.com/chrislusf/seaweedfs/weed && go install +RUN cd /go/src/github.com/chrislusf/seaweedfs/weed \ + && LDFLAGS="-X github.com/chrislusf/seaweedfs/weed/util.COMMIT=$(git rev-parse --short HEAD)" \ + && go install -ldflags ${LDFLAGS} FROM alpine AS final LABEL author="Chris Lu"