Does docker push possess a --force flag which forces all layers to be pushed to the repository, regardless of whether the repository believes those layers are unchanged?
Thank you!
-
This appears to be an X-Y problem. Here's a possible duplicate to the best guess of the actual issue from the limited details here: stackoverflow.com/q/35154219/596285BMitch– BMitch2022年12月04日 00:57:26 +00:00Commented Dec 4, 2022 at 0:57
1 Answer 1
No, there's no --force option to docker push. You can see the options by running docker push --help.
The only reason to force push blobs is if the registry is broken or you've encountered a sha256 hash collision within your repository. I've yet to see a hash collision in app my time using docker. And if the registry is broken, you can delete the affected images from the server and push them again, but I'd put more effort into preventing whatever is corrupting your registry.
If this is an X-Y problem, and you're just not seeing your changes, use unique tags to ensure your image is being pulled. If your builds are being cached, try building with --no-cache. And realize the container images are based on a content addressable store, so you won't have different content represented by the same digest.
4 Comments
--force flag. Your suggestion about changing the tag is correct; however, amounts to changing the name for the purpose of working around a potential bug that is unable to be probed by the provided tools. Useful, but not the problem at hand. :-) I have another post to debug this specifically, and will link it here. Thank you. 🙏buildx assumptions are made during docker push, but that is out of scope of this conversation in this thread. stackoverflow.com/questions/74669130/… Explore related questions
See similar questions with these tags.