File tree 2 files changed +8
-1
lines changed
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ RUN apk add --update libxml2-dev git make bash gcc g++ curl oniguruma-dev
8
8
RUN go get github.com/golang/dep/...
9
9
RUN dep ensure
10
10
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 make static-build
12
12
13
13
FROM alpine:3.8
14
14
Original file line number Diff line number Diff line change @@ -34,3 +34,10 @@ static-package:
34
34
cd build && \
35
35
tar czvf $$ {PACKAGE_NAME}.tar.gz $$ {PACKAGE_NAME} && \
36
36
docker rm gitbase-temp
37
+
38
+ # target used in the Dockerfile to build the static binary
39
+ static-build : VERSION = $(shell git describe --exact-match --tags 2>/dev/null || dev-$(git rev-parse --short HEAD )$(test -n "`git status --porcelain`" && echo "-dirty" || true ) )
40
+ static-build : LD_FLAGS += -linkmode external -extldflags '-static -lz'
41
+ static-build : GO_BUILD_ARGS += -tags oniguruma
42
+ static-build :
43
+ go install -v $(GO_BUILD_ARGS ) github.com/src-d/gitbase/...
You can’t perform that action at this time.
0 commit comments