David Bernat
David Bernat

Reputation: 361

Docker push: Force Push All Layers?

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!

Upvotes: -1

Views: 7239

Answers (1)

BMitch
BMitch

Reputation: 265045

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.

Upvotes: 0

Related Questions