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 /<my_image_name>:

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


<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 <my_image_name> .

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

Finally, push your image docker push <organization_name>/<my_image_name> </my_image_name></organization_name></my_image_name></organization_name></my_image_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