chore: use scratch image for Dockerfile instead of distroless (#226)

* Use Google Distroless for compact images, and some refactoring of Dockerfile

* Use "scratch" image instead of Distroless, and some additional optimizations in Dockerfile
This commit is contained in:
Egor Gavrilov 2024-09-03 10:15:49 +03:00 committed by GitHub
parent 79d255719e
commit 46acc0834c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,7 +1,8 @@
FROM golang:alpine as builder
FROM golang:alpine AS builder
WORKDIR /go
RUN go install github.com/xvzc/SpoofDPI/cmd/spoofdpi@latest
RUN go install -ldflags '-w -s -extldflags "-static"' -tags timetzdata github.com/xvzc/SpoofDPI/cmd/spoofdpi@latest
FROM gcr.io/distroless/static-debian12
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /go/bin/spoofdpi /
ENTRYPOINT ["/spoofdpi"]