-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow `docker push' to push multiple/a subset of tags #267
Comments
@dnephin, super cool tool! imma try it out. for my educational purposes, i'm going to implement this feature. :) |
Also it can save resources while building - the same image does not have to be uploaded twice. |
Prior discussions on this feature can be found in moby/moby#7336, moby/moby#11682, moby/moby#16106, and related, moby/moby#23383 Note that adding support for this on the command-line will not provide enhancements other than not having to "loop" through tags for pushing (see #458 (review)) |
I wonder how that ticket is still open. it started in 2014.. was a quest to finally find the last instance here :) |
+1 It's curious/weird how you can tag multiple tags at once with |
Guys what the progress on this issue? Still need |
This, please! |
+1 |
1 similar comment
+1 |
How is this still a thing? |
There's currently the PR #458 (review) which is under review. AFAIK for now it only adds a loop for the docker push instead of trying to do it in parallel, which is how it works in |
Oh its open. I though its already implemented :( |
Ignoring the performance, the options either to push image with all tags or single tag seems bit odd. |
You can install dokr . and use |
Please do this at least, so many time since this started, I was thinking it's already implemented. |
+1 |
This is more of a design problem. I'd blindly assumed that this would have worked for me $ docker push $(docker images --format "{{.Repository}}" | grep "foobar") only to realize it takes just one argument. I'd say the same for docker pull. There are just too many great use cases for a multi-push. Plus, it's pretty neat instead of a $ for i in `docker images --format "{{.Repository}}" | grep "foobar"; do docker push $i; done Not very command-like. |
Is it not necessary pass the tag? Example: docker images --format "{{.Repository}}:{{.Tag}}" | grep "foobar"
|
I was able to do this using AWS ECR for our docker image hosting. We're using jenkins for CI to push the image up to ECR once the build is finished. Then you can use aws cli to re-tag the image with whatever you want, including variables. In this example, push your initial image up with the latest tag, then specify whatever additional tag you'd like in the second command behind
We're using ECS for hosting so this actually fit nicely into our pipe. You can still use amazon ECR if you're hosting elsewhere though. |
Any new?! |
I achieve this by using pipes with If anyone wondering: |
Any news on this? |
Abandon hope all ye who enter here. I've had great success using skopeo which allows flexible manipulation of remote docker image registries, like re-tagging images on remotes without needing to push/pull locally, or pushing/pulling multiple images in parallel, etc. |
May I recommend the SawStop? |
sound good |
This is a really funny comment :) |
@ devs limit discussion |
@solvaholic do you at least sell it online? 😂 |
If that really happens, hope he wasn't an Emacs user. As it strictly requires all the 10 fingers (sometimes even more), you know... |
At the risk of taking us even further off topic (and further vexing the Docker maintainers), I broke my right wrist almost 20 years ago, and I find Emacs outrageously uncomfortable to use with a nomal-ish keyboard layout (QWERTY with a couple of remaps to make it closer to the old-school Sun layout). As I don't have this issue with vi/vim, that's my preferred editor. And yes, I still futz around with code from time to time, just not for money. It's a lot more fun that way. |
@cpuguy83 - I'm not afraid of loops. This is not my problem. The use-case is to avoid instability where some tags have been published and some have not. What I expect from such API is to apply ALL tags provided and exit well, or NONE of them and exit with an error. Use-Case:
If following a build only a part of the images that should have been tagged The solution now is a whole bunch of scriptology that handles many concerns and more, where the true concerns of my code as a user are naming the images and sending success/fail notifications from the CI. Perhaps this requires evolution also on the registry side - I'm not involved enough to know. |
The best description for a Debezium Kafka Connector ever |
In addition, executing the command multiple times for the same image with different tags could be a problem to some CI/CD pipeline that cost network traffic. |
@osher Atomic push of multiple tags is indeed something that would need to live within the registry specification. This sounds like a different case for sure.
I'm not sure I understand this. |
Pushing same image multiple times (even with different tags), results in almost no traffic, since the registry will already have the same layers, and it will just skip them. |
Requests are still made. And CPU time is still lost. A push that shouldn't technically transfer anything takes 10 seconds in our CI. Multiply by 5 images like that and it's a minute of CI time lost on Docker nonsense. TOP1 most upvoted feature request. This is where the discussion ends, and no technical reason for not implementing this feature is valid. |
@Nowaker Requests to the docker CLI are cheap. The requests to the registry are expensive. Having docker support multiple tags on push does not change the number of requests that have to be made to the registry. |
There may be an exception here for auth tokens. In which case I'd recommend pushing with buildkit instead of |
I think the issue with the current solutions proposed to that problem, is that they would allow to push multiple images at once, which would requires multiple HTTP requests, which is no better than simply calling But the issue people are usually facing is not to push multiple images at once, but push multiple tags of the same image at once. Yes, there is already the It is not very practical to call Since docker cli already has the
Or
I am assuming the registry already supports sending multiple tags with the image (since that's what the |
This issue is still here? Just leave a name and looking forward for any updates. |
Just push as may times as you need to - the duplicate layers wont be sent anyway, might be ugly - but I think the protocol is clever enough to not send things twice - you can push repeatedly without sending large chunks of data. For example - from our build chain recently - redacted - but you should get the idea -
It would obviously be neater to just list a bunch of tags you want in one command, --all-tags is annoying because it sends an un-tagged version up also. |
Allow the following usage:
docker push org/image-a:some_tag org/image-b:other_tag
This would make docker push simpler to use in systems that need to build and push multiple images to dockerhub by obviating the need to wrap
docker push
in a loop.The text was updated successfully, but these errors were encountered: