File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 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
88RUN go get github.com/golang/dep/...
99RUN dep ensure
1010RUN 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
1212
1313FROM alpine:3.8
1414
Original file line number Diff line number Diff line change @@ -34,3 +34,10 @@ static-package:
3434 cd build && \
3535 tar czvf $$ {PACKAGE_NAME}.tar.gz $$ {PACKAGE_NAME} && \
3636 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