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

Docker build caching #517

Merged
merged 3 commits into from
Jul 13, 2024
Merged

Docker build caching #517

merged 3 commits into from
Jul 13, 2024

Conversation

timwhite
Copy link
Contributor

Split installation of services, dependency installation, and code building steps so we can make the most use of docker build caches. When only making changes to code, this can now use the build cache to build an image in <10s. This means that if the base dependencies (redis/nginx etc) don't change between versions, the changed layers to download are less, allowing for quicker updates.

This also makes it easy to see runtime deps vs build only deps, so we can uninstall the packages we don't need once the pipenv is setup.

Dive report on ghcr.io/meeb/tubesync:latest with 10 layers

Total Image size: 621 MB             
Potential wasted space: 26 MB                  
Image efficiency score: 96 %

Dive report with these changes, with 12 layers, but quicker rebuild time, and also improved space efficiency

Total Image size: 603 MB                       
Potential wasted space: 8.1 MB         
Image efficiency score: 98 %

@meeb
Copy link
Owner

meeb commented Jul 13, 2024

Appreciate the tidy-up!

@meeb meeb merged commit 94dbe8b into meeb:main Jul 13, 2024
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

Successfully merging this pull request may close these issues.

2 participants