buildah
buildah copied to clipboard
Reduce official buildah image size
λ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
quay.io/buildah/stable latest 26b3a6ab9362 14 hours ago 723MB
moby/buildkit latest 5946db68d29a 4 days ago 168MB
gcr.io/kaniko-project/executor latest 967a3ff3beaa 2 weeks ago 66.4MB
The official buildah image hosted at https://quay.io/repository/buildah/stable is quite large, especially when compared to competitors. I took a quick look at the image, and, among other things, it includes a full distribution of python 3.12. The root filesystem is also ~160MB smaller than the image, which indicates that the image is being wastefully layered (BuildKit's root FS is only ~4MB smaller).
I think it ought to be possible for the image to be as small as BuildKit's, given that they notionally have a similar set of artifacts (go binary + qemu + ?).
As far as I can tell, there is no other officially supported way to pin to a fixed version of buildah than using this image. Distro packages will change over time, and the project offers no binary releases. So, the size of the image is unfortunate if you desire to "just use version X". In my case, I'd like to use buildah in a containerized CI environment.
I tried to take a pass at this and was not able to get much in the way of results.
I switched to fedora-minimal to reduce the base image size, but the fedora buildah package somehow has a transitive dependency on python3, which seems wrong to me (debian manages to not have one), so there was not much actual gain to be had. The only viable option I can see within the confines of this project is to not update every installed package in the base image during the build. This results in a substantial improvement:
after latest 4d80801ea0e6 6 seconds ago 583MB
before latest 4a11898ab8ea About a minute ago 728MB
The Containerfile needs to use dnf for the installation which requires python3.
Open a PR to move the image to fedora-minamal, that should be easy to get in.
I see. One wrinkle with the minimal image is that it only had dnf5 available. I am not aware of its significance but it seemed to be a drop in replacement as far as I could tell?
Sounds good, open a PR and we can get this merged. Similar PR for podman would be appreciated.
We could also look at eliminating languages and timezones if they are added.
This looks like resolved.
I disagree that it’s resolved, but it is beyond my ability as a casual contributor to improve it further.
@isker My bad, just reopened this.
A friendly reminder that this issue had no activity for 30 days.
The image size is still an ugly.
A friendly reminder that this issue had no activity for 30 days.