-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (24 loc) · 838 Bytes
/
Copy pathDockerfile
File metadata and controls
37 lines (24 loc) · 838 Bytes
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
31
32
33
34
35
36
37
FROM golang:1.26-alpine AS golang
WORKDIR /app
RUN apk add -U tzdata upx && \
apk --update add ca-certificates
COPY . .
RUN go mod download
RUN go mod verify
ARG VERSION=dev
ENV GO111MODULE=on
ENV CGO_ENABLED=0
ENV GOOS=linux
ENV GOFLAGS="-a -trimpath -ldflags=-w -ldflags=-s -ldflags=-X=github.com/lovelaze/nebula-sync/version.Version=${VERSION} -o=nebula-sync"
RUN go build . && \
upx -q nebula-sync
FROM scratch
COPY --link --from=golang /usr/share/zoneinfo/ /usr/share/zoneinfo/
COPY --link --from=golang /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --link --from=golang /app/nebula-sync /usr/local/bin/
USER 1001
ENV API_ENABLED=true
HEALTHCHECK --interval=30s --timeout=3s --start-period=3s --retries=3 \
CMD ["nebula-sync", "healthcheck"]
ENTRYPOINT ["nebula-sync"]
CMD ["run"]