-
-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathDockerfile
More file actions
24 lines (23 loc) · 653 Bytes
/
Dockerfile
File metadata and controls
24 lines (23 loc) · 653 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
# syntax=docker/dockerfile:1
# Compile
FROM golang:1.26-alpine3.23 AS compiler
WORKDIR /app
COPY server-docker/genCert/go.work.template go.work
COPY common common
COPY server-genCert server-genCert
RUN mkdir -p build/resources/certificates
RUN mkdir build/bin
RUN go build -ldflags="-s -w" -o build/bin/genCert ./server-genCert
# Compress
FROM alpine:3.23 AS compressor
RUN apk add --no-cache upx
WORKDIR /app
COPY --from=compiler /app/build .
RUN upx --lzma bin/genCert
# Execute
FROM scratch
VOLUME /app/resources/certificates
WORKDIR /app
COPY --from=compiler /app/build/resources resources
COPY --from=compressor /app .
ENTRYPOINT ["./bin/genCert"]