File tree Expand file tree Collapse file tree 4 files changed +18
-12
lines changed Expand file tree Collapse file tree 4 files changed +18
-12
lines changed Original file line number Diff line number Diff line change 38
38
39
39
before_deploy :
40
40
- make packages
41
-
42
- after_deploy :
43
41
- DOCKER_PUSH_LATEST=1 make docker-push
42
+ - make static-package
44
43
45
44
deploy :
46
45
provider : releases
Original file line number Diff line number Diff line change 1
- FROM golang:1.10 as builder
1
+ FROM golang:1.11-alpine as builder
2
2
3
3
RUN mkdir -p /go/src/github.com/src-d/gitbase
4
4
WORKDIR /go/src/github.com/src-d/gitbase
5
5
COPY . .
6
6
7
- RUN apt-get update && apt-get install libxml2-dev -y
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 github.com/src-d/gitbase/...
11
+ RUN go install -v -tags oniguruma -ldflags "-linkmode external -extldflags '-static -lz'" github.com/src-d/gitbase/...
12
12
13
- FROM ubuntu:16.04
13
+ FROM alpine:3.8
14
14
15
15
COPY --from=builder /go/bin/gitbase /bin
16
16
RUN mkdir -p /opt/repos
@@ -21,14 +21,9 @@ ENV GITBASE_REPOS=/opt/repos
21
21
EXPOSE 3306
22
22
23
23
ENV TINI_VERSION v0.17.0
24
- ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
24
+ ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static /tini
25
25
RUN chmod +x /tini
26
26
27
- RUN apt-get update \
28
- && apt-get install libxml2-dev git -y \
29
- && apt-get clean \
30
- && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
31
-
32
27
ENTRYPOINT ["/tini" , "--" ]
33
28
34
29
CMD gitbase server -v \
Original file line number Diff line number Diff line change @@ -24,3 +24,13 @@ dependencies: bblfsh-client
24
24
25
25
upgrade :
26
26
go run tools/rev-upgrade/main.go -p $(UPGRADE_PRJ ) -r $(UPGRADE_REV )
27
+
28
+ static-package :
29
+ PACKAGE_NAME=gitbase_$(VERSION ) _static_linux_amd64 ; \
30
+ docker rm gitbase-temp ; \
31
+ docker create --rm --name gitbase-temp $(DOCKER_ORG ) /gitbase:$(VERSION ) && \
32
+ mkdir -p build/$$ {PACKAGE_NAME} && \
33
+ docker cp gitbase-temp:/bin/gitbase build/$$ {PACKAGE_NAME} && \
34
+ cd build && \
35
+ tar czvf $$ {PACKAGE_NAME}.tar.gz $$ {PACKAGE_NAME} && \
36
+ docker rm gitbase-temp
Original file line number Diff line number Diff line change @@ -43,6 +43,8 @@ go get -u github.com/src-d/gitbase/...
43
43
44
44
#### Oniguruma support
45
45
46
+ ** Note:** Oniguruma is enabled in the docker container and "static" linux binary.
47
+
46
48
On linux and macOS you can choose to build gitbase with oniguruma support, resulting in faster results for queries using the ` language ` UDF.
47
49
48
50
macOS:
You can’t perform that action at this time.
0 commit comments