-
Notifications
You must be signed in to change notification settings - Fork 88
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
Large image size #107
Comments
As you can see we stick with the official tarballs and they are meant to offer an environment from which you can build and install your Gentoo Linux, I guess that's why. |
AFAIK other distros slim down their Docker images by removing cruft such as unnecessary packages, man pages, etc. We could definitely apply something similar here, but it would probably require guidance from a Gentoo Developer, i.e., someone with a good understanding of the |
You can delete unnecessary packages, like cmake, that the software doesn't need to run. Force unmerge with: emerge -W --rage-clean <foo> Deleting directories like /var/db is okay as users aren't expected to enter there. rm -rf /var/db # also /var/cache/distfiles /var/tmp/portage /usr/share/{doc,man} /var/cache/binpkgs For more details, check https://wiki.gentoo.org/wiki/Knowledge_Base:Freeing_disk_space. |
We shouldn't remove build dependencies, because it's just going to make it harder to install things downstream.
No, it isn't, because that breaks your Gentoo installation by wiping out the Portage state stored in
|
In a regular Gentoo system, we shouldn't. In containers, it doesn't make much sense to keep build dependencies (excluding run dependencies like Ruby) if you've already compiled the software. Obviously, this is to achieve a tiny Docker image. RUN emerge foo && emerge -W --rage-clean foo-dependency
Yeah, my bad, the fat thing is /var/db/repos/gentoo. In a remote case where you want to execute a shell session for the container and want to restore the ebuild repository, you can simply do: emaint sync -r gentoo At least, that's what works for me. Regarding the "empty" directories, it depends on the thing you emerge to the system; a fresh container doesn't have many things to delete. |
The images, For the end image that you want to run, say a web server like nginx, ideally it would be a single Or use Kubler: Kubler is a build tool that uses Gentoo to build packages, and creates a docker image with just the packages - the final image does not have portage, emerge, the rest of the file system - it just has the packages and whatever you explicitly created. If you want an official slimmed gentoo docker image, that still has |
I don't know if this is the right place because this isn't really an issue, but more of a question.
Why do the gentoo containers have such a large image size? Currently, latest on am64 is 287.76 MB, while the Fedora image is 58.39 MB and Ubuntu is down to 22.95 MB. I'm seeing that
/usr/libexec/gcc
is taking 111 MB, and I understand that it wouldn't be Gentoo without GCC, but is there any other place to trim some fat?The text was updated successfully, but these errors were encountered: