-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
44 lines (33 loc) · 923 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
31
32
33
34
35
36
37
38
39
40
41
42
# golang alpine
FROM golang:1.23.1-alpine AS builder
ARG TARGETARCH
ARG TARGETOS
ARG GIT_COMMIT=0
ARG GIT_BRANCH=master
ARG GIT_VERSION=undefined
LABEL maintainer="[email protected]"
RUN apk update \
&& apk add --no-cache \
gcc \
musl-dev \
&& update-ca-certificates
ENV GO111MODULE=on
ENV GOPATH=/
RUN mkdir /opt/uzi-servercertificaat-issuer && cd /opt/uzi-servercertificaat-issuer
COPY go.mod .
COPY go.sum .
RUN go mod download && go mod verify
COPY . .
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags="-w -s " -o /opt/uzi-servercertificaat-issuer/issuer
# alpine
FROM alpine:3.20.3
RUN apk update \
&& apk add --no-cache \
tzdata \
curl \
&& update-ca-certificates
COPY --from=builder /opt/uzi-servercertificaat-issuer/issuer /usr/bin/issuer
RUN adduser -D -H -u 18081 issuer-usr
USER 18081:18081
ENTRYPOINT ["/usr/bin/issuer"]
CMD ["--help"]