Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Google Distroless for compact images #208

Merged
merged 1 commit into from
Aug 28, 2024
Merged

Use Google Distroless for compact images #208

merged 1 commit into from
Aug 28, 2024

Conversation

oldzoomer-gh
Copy link
Contributor

I'm using Google Distroless in gavrilovegor519/spoofdpi-docker project - Docker version of SpoofDPI for using in Russia. This base image very compact (~2 Mb versus ~5-6 Mb of Alpine image), not contains shell and package manager (increases security), and contains virtually no binaries in Static images.

Copy link
Contributor

@Viktor45 Viktor45 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected

@xvzc xvzc merged commit af950c1 into xvzc:main Aug 28, 2024
@hempalex
Copy link

You could use go static linking and then FROM scratch
The only thing you will need is copy ceritificates from go-apline
I do
RUN go install -ldflags '-w -s -extldflags "-static"' -tags timetzdata github.com/xvzc/SpoofDPI/cmd/spoofdpi@${VERSION}

then
ROM scratch
COPY --from=build-stage /go/bin/spoofdpi /spoofdpi
COPY --from=build-stage /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/

and it produces 7mb image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants