Reputation: 65308
When I run the command docker ps
I get a list of containers like this:
6f8d5585918f 56058f3d1997 "test" 23 hours ago Up 23 hours test1
18edba56bfeb 2482781314c7 "java -jar test2" 2 days ago Up 2 days 0.0.0.0:8206->8484/tcp test2
The second column is the image. I want to push the second image as test11 to our private repo. I don't have the files to build the image. How would I do this?
Upvotes: 2
Views: 5779
Reputation: 6079
First you must tag the image ID. The you must login to your private Docker registry. (The correct name is registry and not repository. A Docker registry holds repositories). Then you push the image.
Substitute privateregistry with the hostname of the Registry.
docker tag 2482781314c7 privateregistry/test11
docker login privateregistry
docker push privateregistry/test11
Upvotes: 6