Detailed explanation of the use of docker tag and docker push

Detailed explanation of the use of docker tag and docker push

Docker tag detailed explanation

The use of the docker tag command and how to push the local image to daocloud.io. Docker hub is not used for experiments here because the network speed of Docker hub is not strong enough and push failure is easy to occur.

Use docker tag to rename the image using its ID

chenyangdeMacBook-Pro:~ chenyang$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest fce289e99eb9 9 weeks ago 1.84 kB
chenyangdeMacBook-Pro:~ chenyang$
chenyangdeMacBook-Pro:~ chenyang$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest fce289e99eb9 9 weeks ago 1.84 kB
chenyangdeMacBook-Pro:~ chenyang$ docker tag fce289e99 hello-world:v1
chenyangdeMacBook-Pro:~ chenyang$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest fce289e99eb9 9 weeks ago 1.84 kB
hello-world v1 fce289e99eb9 9 weeks ago 1.84 kB

Use docker tag to rename the image tag

chenyangdeMacBook-Pro:~ chenyang$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest fce289e99eb9 9 weeks ago 1.84 kB
hello-world v1 fce289e99eb9 9 weeks ago 1.84 kB
chenyangdeMacBook-Pro:~ chenyang$ docker tag hello-world:latest hello-world:v2
chenyangdeMacBook-Pro:~ chenyang$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest fce289e99eb9 9 weeks ago 1.84 kB
hello-world v1 fce289e99eb9 9 weeks ago 1.84 kB
hello-world v2 fce289e99eb9 9 weeks ago 1.84 kB

Use docker push to push the image to daocloud.io

You need to log in to daocloud.io. If you don’t have an account, you need to register one on the website.

chenyangdeMacBook-Pro:~ chenyang$ docker login daocloud.io
Username (chenyang_1010): chenyang_1010
Password: 
Login Succeeded
chenyangdeMacBook-Pro:~ chenyang$

Tag it and upload it

chenyangdeMacBook-Pro:~ chenyang$ docker tag hello-world daocloud.io/zter/hello-world:v1
chenyangdeMacBook-Pro:~ chenyang$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest fce289e99eb9 9 weeks ago 1.84 kB
hello-world v1 fce289e99eb9 9 weeks ago 1.84 kB
hello-world v2 fce289e99eb9 9 weeks ago 1.84 kB
daocloud.io/zter/hello-world v1 fce289e99eb9 9 weeks ago 1.84 kB
chenyangdeMacBook-Pro:~ chenyang$ docker push daocloud.io/zter/hello-world:v1
The push refers to a repository [daocloud.io/zter/hello-world]
af0b15c8625b: Pushed 
v1: digest: sha256:39bbd4a41b5d3b164632d3b4a295c0db31139992a8fe985f949dac7ccff7aa54 size: 524

Upload results

Upload the image to daocloud.io

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:
  • Docker renames the image name and TAG operation
  • How to delete an image in Docker
  • Docker packages the local image and restores it to other machines
  • Docker implements re-tagging and deleting the image of the original tag

<<:  How to use tinymce in vue3.0+ and implement the function of uploading multiple images and file upload formula editing

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

Recommend

JavaScript to achieve simple drag effect

This article shares the specific code of JavaScri...

How to fix the WeChat applet input jitter problem

Find the problem Let's look at the problem fi...

Experience of redesigning the homepage of TOM.COM

<br />Without any warning, I saw news on cnB...

Analysis of the operating principle and implementation process of Docker Hub

Similar to the code hosting service provided by G...

Vue3 navigation bar component encapsulation implementation method

Encapsulate a navigation bar component in Vue3, a...

Detailed explanation of destructuring assignment syntax in Javascript

Preface The "destructuring assignment syntax...

10 ways to view compressed file contents in Linux (summary)

Generally speaking, when we view the contents of ...

JavaScript Basics: Scope

Table of contents Scope Global Scope Function Sco...

Add a startup method to Linux (service/script)

Configuration file that needs to be loaded when t...

JavaScript implements password box input verification

Sometimes it is necessary to perform simple verif...

Native JavaScript to achieve slide effects

When we create a page, especially a homepage, we ...

Markup Language - Image Replacement

Click here to return to the 123WORDPRESS.COM HTML ...

Beginners learn some HTML tags (1)

Beginners can learn HTML by understanding some HT...

Tomcat's class loading mechanism process and source code analysis

Table of contents Preface 1. Tomcat class loader ...