FR: an option to delay `--cache-to` pushes
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 4.5k
- Forks
- 682
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 29
Description
Description
Hello
I am doing many successive build calls, each often reusing just-built stages. Today, using --cache-to on each build call incurs an often-remote push that slows down my calls.
I would like to be able to delay pushes to registry caches and to introduce some command to push the caches after these builds. I use registry caches but this may also be useful for GHA or S3 or other cache backends.
I’m thinking a CSV option to --cache-to could be a push=false. E.g.
--cache-to type=registry,ref=myregistry.com/myslug/myimage:mytag,mode=max,push=false
The command to use to push should take filtering parameters in (like image or image and tag). E.g.
docker buildx cache push --ref=myregistry.com/myslug/myimage
A flag should allow to periodically check for new things to upload, this way the command can be run concurrently to the build calls and terminate after a set time.
docker buildx cache push --ref=myregistry.com/myslug/myimage --wait-for 5s &
Could this command be a simple registry syncing client? Or maybe the caching system is more complex than that?
This seems related: https://github.com/docker/buildx/issues/537
Have a nice day
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the existing --cache-to handling and the docker buildx cache command entry points, then read the related issue #537. The request spans delayed uploads, a cache push command, filtering, waiting, and multiple backends; done would require an agreed design and documented behavior for those cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go
- Domain
- build-system, cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100