Docker Push: How to push your docker image to your organization in hub.docker.com

March 07, 2018

Introduction

I have seen the repeated solution on docker help pages which helps to push your image to your username. Example: ``` First build the image docker build -t .

Tag the image, by seeing its image id, from docker images command docker tag 04d7cc352e96 /<myimagename>:

Finally, push your image docker push /<myimagename> </myimagename></myimagename></myimagename>

<h3>Problem</h3>
With above approach, the image will be pushed in path: /<USERNAME>/<my_image_name>

<h3>Example:</h3>
If my username is: goravsingal, and my_image_name=php-apache-mongo

The image will not be published in organization's space. Rather in user's space.

<h2>Solution</h2>

First build the image docker build -t <myimagename> .

Tag the image, by seeing its image id, from docker images command docker tag 04d7cc352e96 <organizationname>/<myimage_name>:

Finally, push your image docker push <organizationname>/<myimagename> </myimagename></organizationname></myimagename></organizationname></myimage_name>

<h3>Example:</h3>
My org name is: gyanblog, my_image_name is php-apache-mongo

Build Image docker build -t php-apache-mongo .

Tag image docker tag 04d7cc352e96 gyanblog/php-apache-mongo:latest

Push in organization docker push gyanblog/php-apache-mongo

Finally, my path becomes:<a href="https://hub.docker.com/r/gyanblog/php-apache-mongo/">https://hub.docker.com/r/gyanblog/php-apache-mongo/</a>

Bingo!

Similar Posts

Latest Posts