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

Prune Docker image #323

Merged
merged 1 commit into from
Dec 22, 2023
Merged

Conversation

HebaruSan
Copy link
Member

The kspckan/netkan image inherits a lot of cruft from python:3.11: autoconf, automake, make, dpkg-dev, gcc, g++, hicolor-icon-theme, imagemagick, subversion, tcl/tk, lots of libs, x11-common, etc., as well as the package download cache in /home/netkan/.cache/pip. This bloats it quite a bit:

REPOSITORY                         TAG       IMAGE ID       CREATED              SIZE
kspckan/netkan                     latest    4883cd42823b   3 days ago           1.11GB

Now it starts from ubuntu:latest, installs only the Python components it needs for each step, and excludes the pip cache from the copy-forward of /home/netkan, resulting in a much slimmed down image (~31% of previous):

REPOSITORY                         TAG       IMAGE ID       CREATED              SIZE
infra_testing                      latest    13fa9e747ffa   About a minute ago   355MB

This may slightly speed up redeploying the bot.

Note that this will downgrade Python from 3.11 to 3.10, which will not matter in the short term, but over the long term it will automatically get future Python versions as they are added to ubuntu:latest and the image is rebuilt.

@HebaruSan HebaruSan added the Environment It's about the dev/prod environment label Dec 19, 2023
@HebaruSan HebaruSan requested a review from techman83 December 19, 2023 15:49
Copy link
Member

@techman83 techman83 left a comment

Choose a reason for hiding this comment

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

Nothing stands out, looks great! Thanks @HebaruSan

@HebaruSan HebaruSan merged commit f83d013 into KSP-CKAN:master Dec 22, 2023
3 checks passed
@HebaruSan HebaruSan deleted the feature/smaller-docker branch December 22, 2023 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Environment It's about the dev/prod environment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants