19年第41周:Docker——仓库

2019-10-10  本文已影响0人  习惯研究所所长

一、容器Container、仓库Repository、镜像Image的理解

镜像就像我们伟大的袁隆平的杂交水稻的种子;
容器就像我们伟大的袁隆平的稻田;
仓库就想我们伟大的袁隆平的粮仓;

二、仓库

NOTE: 仓库(Repository)存放了着各种各样的镜像(image)
NOTE: 注册服务器(Registry)是存储管理仓库的具体服务器,服务器上有多个仓库,仓库有多个镜像

NOTE: Docker仓库使用和Github仓库有着神似

NOTE: 这个就很有用了,可以用github实现自动部署升级项目版本


升级镜像内程序
git一键部署

三、私有仓库

$ docker tag ubuntu:latest 127.0.0.1:5000/ubuntu:latest
$ docker image ls
REPOSITORY                        TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
ubuntu                            latest              ba5877dc9bec        6 weeks ago         192.7 MB
127.0.0.1:5000/ubuntu:latest      latest              ba5877dc9bec        6 weeks ago         192.7 MB
$ docker push 127.0.0.1:5000/ubuntu:latest
The push refers to repository [127.0.0.1:5000/ubuntu]
373a30c24545: Pushed
a9148f5200b0: Pushed
cdd3de0940ab: Pushed
fc56279bbb33: Pushed
b38367233d37: Pushed
2aebd096e0e2: Pushed
latest: digest: sha256:fe4277621f10b5026266932ddf760f5a756d2facd505a94d2da12f4f52f71f5a size: 1568
$ docker image rm 127.0.0.1:5000/ubuntu:latest

$ docker pull 127.0.0.1:5000/ubuntu:latest
Pulling repository 127.0.0.1:5000/ubuntu:latest
ba5877dc9bec: Download complete
511136ea3c5a: Download complete
9bad880da3d2: Download complete
25f11f5fb0cb: Download complete
ebc34468f71d: Download complete
2318d26665ef: Download complete
上一篇 下一篇

猜你喜欢

热点阅读