Re:Cache is King: A guide for Docker layer caching in GitHub...
by remram on Sunday April 07, 2024 @08:50AM
(#39960410)
Thanks, this is a very thorough explanation.
Is there really no way to cache the 'cachemount' directories?
Re:Cache is King: A guide for Docker layer caching in GitHub...
by mshekow on Sunday April 07, 2024 @10:22AM
(#39960967)
The only option I know is to use network shares/disks, but you need to make sure that each share/disk is only used by one BuildKit process at a time.
Re:Cache is King: A guide for Docker layer caching in GitHub...
by daulis on Tuesday April 09, 2024 @03:13PM
(#39983065)
After years of lurking, I made an account to reply to this
"image-manifest=true" was the magic parameter that I needed to make this work with a non-DockerHub registry (Artifactory). I spent a lot of time fighting this, and non-obvious error messages. Thank you!!
We use a multi-stage build for a DevContainer environment, and the final image is quite large (for various reasons), so a better caching strategy really helps in our use case (smaller incremental image updates, smaller downloads for developers, less storage in the repository, etc)
There I also explain that IF you use a registry cache import/export, you should use the same registry to which you are also pushing your actual image, and use the "image-manifest=true" option (especially if you are targeting GHCR - on DockerHub "image-manifest=true" would not be necessary).