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

Optimize image size #3

Closed
LaszloGombos opened this issue Dec 11, 2023 · 8 comments
Closed

Optimize image size #3

LaszloGombos opened this issue Dec 11, 2023 · 8 comments

Comments

@LaszloGombos
Copy link
Contributor

Noticed that the default boot partition is much larger than needed.

/dev/vda16 881M 40M 780M 5% /boot
/dev/vda15 105M 6.1M 99M 6% /boot/efi

We should consider making them smaller or at least zero them out so that qcow2 can compress.

CC @abiosoft

@abiosoft
Copy link
Owner

Thanks for pointing that out.
I am open to contributions for this as well if you know how to go about it :)

@abiosoft
Copy link
Owner

Another thing to note, considering that the cloud-image is just around 200MB before adding extra packages, the boot partition may not have much of an influence on the final size i.e. probably zeroed out already.

@LaszloGombos
Copy link
Contributor Author

cloud-image is just around 200MB before adding extra packages, the boot partition may not have much of an influence on the final size

Thats a valid point. We should try to find the reason of this size increase.
I have not looked, but now I am thinking that taking the stable version of docker is much larger than the distro version of docker as the upstream version might package some of the dependencies so that the final image has two copies.

@LaszloGombos LaszloGombos changed the title shrink boot partition Optimize image size Dec 11, 2023
@abiosoft
Copy link
Owner

abiosoft commented Dec 12, 2023

I have not looked, but now I am thinking that taking the stable version of docker is much larger than the distro version of docker as the upstream version might package some of the dependencies so that the final image has two copies.

I also prefer the distro version of docker for same reasons but there were issues with the distro version (abiosoft/colima#856, abiosoft/colima#863) that were only fixed by switching to the official version.

@LaszloGombos
Copy link
Contributor Author

there were issues with the distro version

Let's hope this is a temporary situation. We can follow upstream changes with this bug

https://bugs.launchpad.net/ubuntu/+source/docker.io-app/+bug/2040461

@LaszloGombos
Copy link
Contributor Author

@abiosoft thinking more about the goals of this image and size, I am wondering why not to use the LTS (22.04) version of Ubuntu (especially given that anyways we do not use the distro version of docker). Can you help understanding this ?

Seems the initial commit is already on 23.10 1d342e9 .

@abiosoft
Copy link
Owner

I am wondering why not to use the LTS (22.04) version of Ubuntu (especially given that anyways we do not use the distro version of docker). Can you help understanding this ?

Because there is no minimal ubuntu image for 22.04 LTS arm64. It only exists for amd64.

@LaszloGombos
Copy link
Contributor Author

LaszloGombos commented Dec 12, 2023

Because there is no minimal ubuntu image for 22.04 LTS arm64. It only exists for amd64.

Oh, I see. Technically we could pick the server image and uninstall packages and end-up with a similar package set even based on 22.04 LTS server image, but it seems this issue soon will be resolved with the 24.04 LTS, so probably better to wait a few month with this and decide based after the 24.04 LTS upgrade.

Hopefully with 24.04 we will be able to shrink the size a bit. Other than that I do not have any more ideas for significant gain, so for now I just close this issue. We can always reopen.

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

No branches or pull requests

2 participants