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
Build the docker image from scratch, for a lighter docker image? #151
Comments
Adfditional comment on what the ldflags do:
|
I'm perfectly fine with this. Just make a PR and I'll be happy to merge it. If you have strong space requirements you can even UPX the executables to trade cold start time for some (usually 50%) additional space savings (but I don't recommend doing this for everyone).
Disabling CGO is usually fine for most web applications in the wild, but this is a DNS server, and disabling CGO slightly changes how the DNS client in netgo behaves (from directly calling into the libc to mimicking the behavior in pure Go). This change has been causing unexpected problems all the time and I really don't recommend doing this. And there will not be any libc version incompatibilities because we invented Docker to solve exactly this problem.
This is another popular thing that I don't recommend. 3 reasons:
Starting from
While running as non-root comes with some security defaults that makes the system slightly more secure, there are multiple problems:
There are modern ways to achieve the same security enhancements. Recommended:
|
I'll make a pr now for the ldflags 👍🏻 Also other question since we at it, is the latest tag based on commit or latest stable version ? |
Currently based on master, since the automated build is set up like 2 days ago and we don't have a tag newer than that yet. (Plus we don't have the correct GitHub workflow for a Git tag...) |
Alright so when a new version will be up the will be a tag for it then? ^^ |
It just a proposal for now, but it being working perfectly, and i run it everyday with my own docker image.
Currently the docker image is build like this:
My proposition. To build the final image from 'scratch':
Advantage:
Disadvantage:
The image could be also made smaller by adding '-s -w' to the 'ldflags' like this:
I can make a pull request if your okay with those changes, but i just wanted to discuss it with you first ^^
I've been running my image for 9month straight with no issues on my side
You can check my current docker image and GitHub for it.
The text was updated successfully, but these errors were encountered: