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

Ubuntu 15.04 opens mysql remote port 3306

Ubuntu 15.04 opens MySQL remote port 3306. All th...

In-depth understanding of mathematical expressions in CSS calc()

The mathematical expression calc() is a function ...

A brief analysis of the difference between ref and toRef in Vue3

1. ref is copied, the view will be updated If you...

React Hooks Common Use Scenarios (Summary)

Table of contents 1. State Hook 1. Basic usage 2....

HTML table tag tutorial (27): cell background image attribute BACKGROUND

We can set a background image for the cell, and w...

Build Maven projects faster in Docker

Table of contents I. Overview 2. Conventional mul...

JS implements simple calendar effect

This article shares the specific code of JS to ac...

Using JS to implement a rotating Christmas tree in HTML

<!DOCTYPE HEML PUBLIC> <html> <hea...

CSS perfectly solves the problem of front-end image deformation

I saw an article in Toutiao IT School that CSS pe...

vue+ts realizes the effect of element mouse drag

This article example shares the specific code of ...

Top 10 Js Image Processing Libraries

Table of contents introduce 1. Pica 2. Lena.js 3....

JavaScript common statements loop, judgment, string to number

Table of contents 1. switch 2. While Loop 3. Do/W...

The Complete List of MIME Types

What is MIME TYPE? 1. First, we need to understan...

Comprehensive summary of mysql functions

Table of contents 1. Commonly used string functio...