forked from leboncoin/zoekt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
30 lines (20 loc) · 814 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM golang:1.18.1-alpine3.15 AS builder
RUN apk add --no-cache ca-certificates
ENV CGO_ENABLED=0 GO111MODULE=on
WORKDIR /go/src/github.com/google/zoekt
# Cache dependencies
COPY go.mod go.sum ./
RUN go mod download
COPY . ./
ARG VERSION
RUN go install -ldflags "-X github.com/google/zoekt.Version=$VERSION" ./cmd/...
FROM alpine:3.15.0 AS zoekt
RUN apk update --no-cache && apk upgrade --no-cache && \
apk add --no-cache git ca-certificates bind-tools tini jansson
COPY install-ctags-alpine.sh .
RUN ./install-ctags-alpine.sh && rm install-ctags-alpine.sh
COPY --from=builder /go/bin/* /usr/local/bin/
# zoekt-webserver has a large stable heap size (10s of gigs), and as such the
# default GOGC=100 could be better tuned. https://dave.cheney.net/tag/gogc
ENV GOGC=50
ENTRYPOINT ["/sbin/tini", "--"]