-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (25 loc) · 750 Bytes
/
Dockerfile
File metadata and controls
31 lines (25 loc) · 750 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
FROM golang:1.26-alpine AS builder
WORKDIR /build
COPY . .
ARG GOOS
ARG GOARCH
RUN CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} go build -o server .
FROM alpine:latest AS certs
RUN apk add --update --no-cache ca-certificates
FROM busybox:latest
ARG UID=10001
RUN adduser \
--disabled-password \
--gecos "" \
--home "/nonexistent" \
--shell "/sbin/nologin" \
--no-create-home \
--uid "${UID}" \
appuser
USER appuser
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /build/server /server
EXPOSE 9002
ENTRYPOINT ["/server"]
LABEL org.opencontainers.image.authors="Uğur vigo Özyılmazel <ugurozyilmazel@gmail.com>"
LABEL org.opencontainers.image.licenses="MIT"