The images we used before were all pulled from the DockerHub public warehouse, and we also learned how to make our own images. However, it is not particularly friendly for team development to realize the backup, recovery and migration of images through the tar package. We can also push the images to the DockerHub warehouse for convenient use.

Tip: If you build an image that carries project data, it is recommended to use a private repository.

  

Registered account

  

Liverpoolfc.tv: hub.docker.com/

  

Login account

  

Run the docker login command to enter the account password to login to the DockerHub.

  

Push an image to the repository

  

For testing purposes, we pulled the Hello-world image locally and then uploaded it to the DockerHub repository.

Docker tag local-image:tagname new-repo:tagname;

Docker push new-repo: tagName

Docker tag hello-world:latest MRHelloWorld /test-hello-world:1.0.0 Docker push MRHelloWorld /test-hello-world:1.0.0Copy the code

  

Look at the warehouse

  

  

Pull the mirror

  

Docker pull mrhelloWorld /test-hello-world:1.0.0 test whether the image can be pulled.

  

Withdraw from the account

  

Exit the DockerHub by running the docker logout command.

[root@localhost ~]# docker logout
Removing login credentials for https://index.docker.io/v1/
Copy the code

DockerHub image warehouse use to learn here, considering the reasons of the network, from DockerHub download and upload image speed may be slow, and production use of Docker image may contain our code, configuration information, do not want to be external personnel to obtain, only allow Intranet developers to download. How do you solve it? This can be achieved by building a private image repository. Below, we will learn how to build a Docker private image repository together.

This article is licensed under a Creative Commons attribution – Noncommercial – No Deductive 4.0 International license.

You can check out more Docker articles in the category below.

  

🤗 your likes and retweets are the biggest support for me.

📢 Scan code pay attention to Mr. Hallward “document + video” each article is equipped with a special video explanation, learning more easily oh ~