-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
26 lines (19 loc) · 635 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
FROM golang:1.23.1-alpine AS builder
LABEL builder=true
RUN adduser --no-create-home --gecos "" --disabled-password user
RUN apk add --update -t build-deps go git mercurial libc-dev gcc libgcc
ENV GO111MODULE=on
ENV CGO_ENABLED=0
WORKDIR /project
COPY . /project
RUN go build \
-a \
-ldflags '-extldflags "-static"' \
-o /bin/couchdb-cluster-config
FROM scratch
LABEL maintainer="Tobias Gesellchen <[email protected]> (@gesellix)"
ENTRYPOINT [ "/couchdb-cluster-config" ]
CMD [ "--help" ]
COPY --from=builder /etc/passwd /etc/passwd
USER user
COPY --from=builder /bin/couchdb-cluster-config /couchdb-cluster-config