Skip to content

Commit cf3fbfb

Browse files
committed
Dockerfile: add gitbase version to the binary
Signed-off-by: Manuel Carmona <manu.carmona90@gmail.com>
1 parent 4b3b044 commit cf3fbfb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ 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=dev-$(git rev-parse --short HEAD)-$(test -n "`git status --porcelain`" && echo "-dirty" || true); \
12+
go install -v -tags oniguruma -ldflags "-linkmode external -extldflags '-static -lz' -X main.version=$VERSION" \
13+
github.com/src-d/gitbase/...
1214

1315
FROM alpine:3.8
1416

0 commit comments

Comments
 (0)