Docker Tutorial - Warehouse Management

Brief introduction

Relationship is very similar to Git and Github, the Docker and Docker Hub is true, Docker Hub is a public official Docker warehouse maintenance, where users can register an account, push their own local mirroring to a remote warehouse. Currently, the vast majority of demand required image can be found on the Docker Hub.

Docker Hub Register

Click on the official website link to register to the specific fill as shown below, click Sign up registration will ask for personal information, and then confirm your registration e-mail to the mailbox to log normal Docker Hub. Note, remember your user name ID and password is required to log in Docker on the local machine.

Here Insert Picture Description

Log on locally

docker loginCommand is used to log Docker Hub account, execute the command prompts for username and password, you can log in successfully verified.

docker logoutDocker Hub account logout command, the command is executed on behalf of Docker logs out the current account.

After following figure successful login, you can push (push) or pull (pull) mirror under their own account, the previous blog mentioned use docker searchcommand to find public mirrored in the official image library, use the docker pullcommand to the remote public image pull locally, these two operations are not required to log Docker hub account .

Here Insert Picture Description

Mirroring Push

Below the hello-world image modification, for example, demonstrates how to push and pull their own image.

First, tagcreate a hello-world modeled to a mirror command, can also be a mirror image from any source, (such as DockerFile built Docker hub or pull revised), here is a demonstration of personal image only.

Here Insert Picture Description

Sure you are logged in Docker hub account as it appears on one of the following, the command docker push username/appname:tagpush their own personal image to the remote repository. Here is the image name must be standardized username/appname:tagand must be the username of the user currently logged on, otherwise it will push failed.

When the push-command results in the following figure, showing the success of the push (network format specification substantially no problem will succeed).

Here Insert Picture Description

At this point, log Docker Hub account, view your warehouse, you can see the push content, specifically as shown. Pushed to mirror their own accounts are public by default, others can be accessed on the Docker hub, docker searchthe command will search mirrored in Docker official warehouse, you can not find personal disclosure.

Here Insert Picture Description

At this time, delete the local mirror, pulling back from the local Docker Hub. Here we must note, pulling their image using standard image name, if the public image (the default is to push public), without logging pull success. Specific presentations shown below.

Here Insert Picture Description

Finally, add that personal image can be private, need to change in the repository set up in the following figure, but there are use restrictions, needs more private warehouse purchase, unrestricted public warehouse.

Here Insert Picture Description

Supplement

This paper describes the use of the remote mirror Docker Hub warehouse, primarily push and pull operations. Article if imperfect, comments are welcome correction.

Published 236 original articles · won praise 149 · Views 140,000 +

Guess you like

Origin blog.csdn.net/zhouchen1998/article/details/104591149