Skip to content

Commit a124ad4

Browse files
committed
Dockerfile: add gitbase version to the binary
Signed-off-by: Manuel Carmona <[email protected]>
1 parent 7c35fd3 commit a124ad4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ RUN apk add --update libxml2-dev git make bash gcc g++ curl oniguruma-dev
88
RUN go get github.com/golang/dep/...
99
RUN dep ensure
1010
RUN cd vendor/gopkg.in/bblfsh/client-go.v2 && make dependencies
11-
RUN go install -v -tags oniguruma -ldflags "-linkmode external -extldflags '-static -lz'" github.com/src-d/gitbase/...
11+
RUN VERSION=$(git describe --exact-match --tags 2>/dev/null || \
12+
echo dev-$(git rev-parse --short HEAD)$(test -n "`git status --porcelain`" && echo "-dirty" || true)); \
13+
go install -v -tags oniguruma -ldflags "-linkmode external -extldflags '-static -lz' -X main.version=$VERSION" \
14+
github.com/src-d/gitbase/...
1215

1316
FROM alpine:3.8
1417

0 commit comments

Comments
 (0)