Implementation of pushing Docker images to Docker Hub

Implementation of pushing Docker images to Docker Hub

After the image is built successfully, it can be used as long as there is a Docker environment, but the image must be pushed to Docker Hub. The image we created previously does not meet the tag requirements of Docker Hub. Because the username registered in Docker Hub is boonyadocker instead of boonya, the docker tag needs to be modified, and finally the docker push command is used to push the image to the public repository.

Docker hub registered user

Go to the official website to register an account: https://hub.docker.com/

Log in to docker in local Linux:

 docker login

Enter your username and password to log in:

docker@default:~$ docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: boonyadocker
Password: 
Login Succeeded
docker@default:~$

tag to modify the image name

The specifications for pushing images are:

docker push registered username/image name

The tag command is modified to a standard image:

docker tag boonya/tomcat-allow-remote boonyadocker/tomcat-allow-remote

View the modified specification image:

docker@default:~$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
boonyadocker/tomcat-allow-remote latest 6137f64875dd 7 hours ago 571MB
boonyadocker/tomcat-web latest 09677d05b579 2 days ago 571MB
<none> <none> e1471ab1845a 3 days ago 188MB
<none> <none> cf240e31edfb 3 days ago 188MB
<none> <none> 717961796ae2 3 days ago 334MB
apptomcat 1.0 249dc3f5dfb0 3 days ago 334MB
tomcat 8 a2fbbcebd67e 8 days ago 334MB
ubuntu 14.04 4a2820e686c4 2 weeks ago 188MB
wurstmeister/kafka latest 12453f4efa7b 6 weeks ago 265MB
docker@default:~$

Push the image to Docker Hub

Push the image using the push command:

docker push boonyadocker/tomcat-allow-remote:latest 


Note: Pushing to Docker Hub is very slow, so please be patient. It is likely to fail. If it fails, the server will try to retransmit multiple times and then disconnect the push (but the files that have been pushed will be retained, but it is unknown how long they will be retained).

Here is the output after the upload is complete (multiple retransmissions):

docker@default:~$ docker push boonyadocker/tomcat-allow-remote:latest
The push refers to a repository [docker.io/boonyadocker/tomcat-allow-remote]
464a44ea0195: Layer already exists 
29b57e33a4da: Pushed 
d649a240e453: Layer already exists 
d0757a6730d0: Layer already exists 
768dcfe5d05f: Layer already exists 
f5cfc06b640d: Layer already exists 
9669d6b73383: Layer already exists 
latest: digest: sha256:1e7562a15ef1728f213922d9633be67f3025447d0a641e333a8ec5107749c386 size: 11802
docker@default:~$

Patience is still required because large files are time-consuming.

Visit Docker Hub to publish images

After uploading, visit: https://hub.docker.com/r/boonyadocker/tomcat-allow-remote/, as shown in the figure below, everyone can use the image I released:


You can also search for it on Docker Hub:


So far we have published our own image to the Docker Hub repository.

Docker uses published images

Search for published images:

docker@default:~$ docker search boonyadocker/tomcat-allow-remote
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
boonyadocker/tomcat-allow-remote In this Tomcat image server you can use ma... 0          
docker@default:~$

Because we have published our own image, we can directly use the docker pull command to pull and use the image in the future:

docker pull boonyadocker/tomcat-allow-remote 


Note: The image is based on the remote management role permissions of Tomcat8. The management account and password are: tomcat/password.

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Analysis of the operating principle and implementation process of Docker Hub
  • How to build DockerHub yourself
  • Detailed explanation of the use of DockerHub image repository
  • How to publish a locally built docker image to dockerhub
  • Docker Tutorial: Docker Hub Introduction
  • Detailed explanation of how to use the official MySQL image from DockerHub
  • How to create your own Docker image and upload it to Dockerhub

<<:  mysql installer web community 5.7.21.0.msi installation graphic tutorial

>>:  MySQL 5.7 zip archive version installation tutorial

Recommend

How to simulate enumeration with JS

Preface In current JavaScript, there is no concep...

User experience analysis of facebook dating website design

<br />Related article: Analysis of Facebook&...

Share 8 CSS tools to improve web design

When one needs to edit or modify the website desi...

Vue directives v-html and v-text

Table of contents 1. v-text text rendering instru...

A brief analysis of the usage of USING and HAVING in MySQL

This article uses examples to illustrate the usag...

Comprehensive analysis of MySql master-slave replication mechanism

Table of contents Master-slave replication mechan...

Share the responsive frameworks commonly used by web design masters (summary)

This article introduces and shares the responsive...

Oracle VM VirtualBox installation of CentOS7 operating system tutorial diagram

Table of contents Installation Steps Environment ...

JavaScript implementation of the back to top button example

This article shares the specific code for JavaScr...

Share CSS writing standards and order [recommended for everyone to use]

CSS writing order 1. Position attributes (positio...

Some experience in building the React Native project framework

React Native is a cross-platform mobile applicati...