An Enthusiastic Programmer

Share your Images on Docker Hub

|

You have created a containerized application. This article will show you how to share your images on the Docker Hub step by step. Note all images on Docker Hub are public except private.

Sign up Docker Hub Page

Go the Docker Hub Sign Up page, then type your <Docker ID> and finish other requirements.

Create a repository

Click the create repository button, enter a name.

NOTE: You can choose your repository whether is a public repository. A public repository can be used by anyone. If you want to secret your repository, then you can make your repository private.

Tag your image

Tag your image, before you push your image into the remote repository. Your tag name should be like this <Your Docker ID>/<Repository Name>:<tag>.

docker tag is basically to create an alias from another image. The above code will create a new alias <Your Docker ID>/tweet_app:1.0 of the tweet_app:1.0 image. After this, you will have two names tweet_app:1.0 and <Your Docker ID>/tweet_app:1.0. You can run docker image ls to list all your images. You can omit your tag part, if you do that, your tag will be the latest by default.

The above code will create a new image named as <Your Docker ID>/tweet_app:latest, the tag value is latest. The following code is the same meaning:

Push your image to the repository

You have to log in at command line first. Type the docker login command to log in, or docker logout to log out. After you login successfully, then you can run the docker push <Your Docker ID>/<repository>:tag to push your images to the remote repository.

if you are in the latest tag, you can omit it.

Pull your image back

Now your Image is on Docker Hub available. You can pull your image back in many ways eg. FROM in a Dockerfile, or docker pull in the command line environment. The following snippet shows you the docker pull.

Comments