I have a docker image with three tags repo:latest
, repo:v1.1
, repo:dev
. When I do docker push repo:v1.1
only one tag will be pushed into repository. Is there a way to make one push with all tags or I need to push-per-tag?
The docker push command does not accept several arguments (if ever one wants to push a selection of several tags (not all) in one go), so one needs to push each tag separately, e.g.:
for t in latest v1.1 dev; do
docker push "repo:${t}"
done
Otherwise, as mentioned in @GuillaumePancak's answer, one may be interested in relying on the --all-tags
flag available from Docker 20.10.0.
Note also that it is frequent to consider pushing several different tags for the same image (which may be your use case here as well). In this case pushing these tags successively (and not at the same time with several concurrent processes) ensures the docker push
of the tag synonyms will be almost immediate, after the image has been pushed once with a given tag.
If you want to push all tags for an image, you can use the --all-tags
option:
docker image push --all-tags repository/image_name
This option is supported for Docker 20.10 and newer. The same behaviour can be achieved by omitting --all-tags
on older versions.
More information: Docker push documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With