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

Two ways to achieve horizontal arrangement of ul and li using CSS

Because li is a block-level element and occupies ...

WeChat applet implements user login module server construction

I chose node.js to build the server. Friends who ...

MySQL 8.0 can now handle JSON

Table of contents 1. Brief Overview 2. JSON basic...

Centos7.5 configuration java environment installation tomcat explanation

Tomcat is a web server software based on Java lan...

How to use Docker containers to implement proxy forwarding and data backup

Preface When we deploy applications to servers as...

Detailed analysis of MySQL master-slave replication

Preface: In MySQL, the master-slave architecture ...

Five ways to implement inheritance in js

Borrowing Constructors The basic idea of ​​this t...

How to dynamically modify the replication filter in mysql

MySQL dynamically modify replication filters Let ...

Sample code for implementing two-way authentication with Nginx+SSL

First create a directory cd /etc/nginx mkdir ssl ...

HTML web page creation tutorial Use iframe tags carefully

Using iframes can easily call pages from other we...

Using zabbix to monitor the ogg process (Windows platform)

This article introduces how to monitor the ogg pr...

mysql-8.0.16 winx64 latest installation tutorial with pictures and text

I just started learning about databases recently....

How to use node to implement static file caching

Table of contents cache Cache location classifica...