docker run 命令 如果local image中有对应 镜像+tag 不会从新拉取镜像

docker pull 会进行拉取

先进行镜像更改

[root@master01 ~]# docker tag alpine:latest registry.song.test.cnpc:5000/apline:1.1
[root@master01 ~]# docker push registry.song.test.cnpc:5000/apline:1.1
The push refers to a repository [registry.song.test.cnpc:5000/apline]
a464c54f93a9: Pushed
1.1: digest: sha256:5c40b3c27b9f13c873fefb2139765c56ce97fd50230f1f2d5c91e55dec171907 size: 528

[root@master01 ~]# docker tag registry.song.test.cnpc:5000/openshift3/logging-curator:v3.6  registry.song.test.cnpc:5000/apline:1.1
[root@master01 ~]# docker push registry.song.test.cnpc:5000/apline:1.1
The push refers to a repository [registry.song.test.cnpc:5000/apline]
37690f4f1c61: Mounted from openshift3/logging-curator
02404b4d7e5d: Mounted from openshift3/logging-curator
e1d829eddb62: Mounted from openshift3/logging-curator
1.1: digest: sha256:9a0d7cf6532da31f08239cc25e74bad118a828b4dc3a67a8bf442ff6faba140f size: 949  

测试两个命令

[root@ha ~]# docker run -it --name song registry.song.test.cnpc:5000/apline:1.1
/ # ls
bin    dev    etc    home   lib    media  mnt    opt    proc   root   run    sbin   srv    sys    tmp    usr    var

[root@ha ~]# docker pull registry.song.test.cnpc:5000/apline:1.1
Trying to pull repository registry.song.test.cnpc:5000/apline ...
1.1: Pulling from registry.song.test.cnpc:5000/apline
Digest: sha256:9a0d7cf6532da31f08239cc25e74bad118a828b4dc3a67a8bf442ff6faba140f
Status: Downloaded newer image for registry.song.test.cnpc:5000/apline:1.1

  

05-11 15:19