-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
30 lines (28 loc) · 758 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.20-alpine as builder
RUN apk add --no-cache git ca-certificates && update-ca-certificates
ENV UID=10001
ENV CGO_ENABLED=0 GOOS=linux GOARCH=amd64
RUN adduser \
--disabled-password \
--gecos "" \
--home "/nonexistent" \
--no-create-home \
--shell "/sbin/nologin" \
--uid 10001 \
kove
WORKDIR /kove
COPY kove.go config.go go.mod go.sum /kove/
RUN go mod download
RUN go mod verify
RUN go test -v
RUN go build -a -installsuffix cgo -o kove
RUN chown -R kove:kove /kove
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /etc/group /etc/group
COPY --from=builder /kove /kove
WORKDIR /kove
USER kove:kove
EXPOSE 3000
ENTRYPOINT ["/kove/kove"]