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

Detailed explanation of Javascript Echarts air quality map effect

We need to first combine the air quality data wit...

Vue imitates ElementUI's form example code

Implementation requirements The form imitating El...

Mysql sql slow query monitoring script code example

1. Modify my.cnf #The overall effect is that both...

In-depth explanation of the impact of NULL on indexes in MySQL

Preface I have read many blogs and heard many peo...

Mysql database recovery actual record by time point

Introduction: MySQL database recovery by time poi...

Implementing a simple age calculator based on HTML+JS

Table of contents Preface Demonstration effect HT...

How to implement communication between Docker containers

Scenario: A laradock development environment (php...

How to set up cross-domain access in IIS web.config

Requirement: The page needs to display an image, ...

Two ways to install Python3 on Linux servers

First method Alibaba Cloud and Baidu Cloud server...

Build Maven projects faster in Docker

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

In-depth exploration of whether Mysql fuzzy query is case-sensitive

Preface Recently, I have been busy writing a smal...

JavaScript to implement click to switch verification code and verification

This article shares the specific code of JavaScri...