Detailed explanation of the use of DockerHub image repository

Detailed explanation of the use of DockerHub image repository

Previously, the images we used were all pulled from the DockerHub public repository. We also learned how to make our own images, but backing up, restoring and migrating images through tar packages is not particularly friendly for team collaboration development. We can also push the images to the DockerHub repository for easy use.

Tips: If the built image contains project data, it is recommended to use a private repository.

Register an account

Official website: https://hub.docker.com/

Login Account

Use the docker login command to enter your account and password to log in to DockerHub.

Push the image to the warehouse

To facilitate testing, we pull the hello-world image locally and then upload it to the DockerHub repository.

First set the tag docker tag local-image:tagname new-repo:tagname for the image;

Then push the image to the repository 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.0 

View Warehouse

Pull the image

Test whether the image can be pulled by docker pull mrhelloworld/test-hello-world:1.0.0 .

Log out

Exit DockerHub using the docker logout command.

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

This is the end of our learning on how to use the DockerHub image repository. Considering network reasons, the speed of downloading and uploading images from DockerHub may be slow. In addition, the Docker images used in production may contain our code, configuration information, etc., which we do not want to be obtained by outsiders, so only developers on the intranet are allowed to download them. How to solve it? This can be achieved by building a private image repository. Let's learn how to build a Docker private image repository below.

This is the end of this article about the detailed use of DockerHub image repository. For more information about the use of DockerHub image repository, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Detailed explanation of using Alibaba Cloud image repository to build foreign Docker images
  • Implementation of Docker configuration modification of Alibaba Cloud image repository
  • How to implement Docker Registry to build a private image warehouse
  • Steps for Docker to build its own local image repository
  • How to use Alibaba Cloud image repository with Docker
  • How to use domestic image warehouse for Docker

<<:  The practical process of login status management in the vuex project

>>:  Detailed explanation of MySQL clustered index and non-clustered index

Recommend

How to configure two or more sites using Apache Web server

How to host two or more sites on the popular and ...

Sample code for implementing multi-application deployment using tomcat+nginx

Table of contents Multi-application deployment 1-...

Summary of MySQL lock related knowledge

Locks in MySQL Locks are a means to resolve resou...

How to connect Navicat to the docker database on the server

Start the mysql container in docekr Use command: ...

Detailed explanation of Nginx passively checking the server's survival status

introduce Monitors the health of HTTP servers in ...

11 common CSS tips and experience collection

1. How do I remove the blank space of a few pixels...

How to build php7 with docker custom image

First, perform a simple Docker installation. To c...

About the problem of writing plugins for mounting DOM in vue3

Compared with vue2, vue3 has an additional concep...

vue dynamic component

Table of contents 1. Component 2. keep-alive 2.1 ...

XHTML introductory tutorial: Use of list tags

Lists are used to list a series of similar or rela...

MySQL whole table encryption solution keyring_file detailed explanation

illustrate MySql Community Edition supports table...

Detailed explanation of the process of building an MQTT server using Docker

1. Pull the image docker pull registry.cn-hangzho...

Summary of MySQL composite indexes

Table of contents 1. Background 2. Understanding ...

Sharing ideas on processing tens of millions of data in a single MySQL table

Table of contents Project Background Improvement ...

Build a Docker private warehouse (self-signed method)

In order to centrally manage the images we create...