Page MenuHomePhabricator

docker-pkg: it would be nice to have a --rebuild option or similar
Open, Needs TriagePublic

Description

Currently if one wants to rebuild a production image on one's local system (e.g. to try and check one's docker-pkg setup is working properly), you cannot trivially do so; instead one must use --nightly (or edit a changelog by hand) to make a new version, leaving working-tree detritus to clear up. It would be nice to have a --rebuild option to say "rebuild matching image(s) even though the configured registry already has them.

Relatedly, if build --select output "did not build matching image(s) x,y,z,... because repsitory already up-to-date" that would be more user-friendly (you currently don't know if you messed up the --select pattern or just everything is already up-to-date).

Event Timeline

docker-pkg would not build an image (name:tag) which is existing in the local containers storage or in the remote registry. It considers they already have been build and skip them, so you can consider them immutable once they got built. If an image is not present in the local containers storage, it would fetch them from the remote registry instead of building them. The reason, is that you don't want to have different images carrying the same name:tag!

You can use --snapshot (possibly with --use-cache to reuse local layers and speed it up)

Assuming the image has NOT been published (else docker-pkg would pull it), you can delete it from your local storage and start a build: docker rmi whateverimage && docker-pkg build --select '*whateverimage:*'

Improving the output when every slelected images are up to date is probably worth filing another task :)