Docker 总结(转载)
查看docker的子命令,直接敲docker
或完整的docker help
就可以了:
root@tankywoo-docker:~# docker [/]
Usage: docker [OPTIONS] COMMAND [arg...]
-H=[unix:///var/run/docker.sock]: tcp://host:port to bind/connect to or unix://path/to/socket to use A self-sufficient runtime for linux containers. Commands:
attach Attach to a running container
build Build a container from a Dockerfile
commit Create a new image from a container's changes
cp Copy files/folders from the containers filesystem to the host path
diff Inspect changes on a container's filesystem
events Get real time events from the server
export Stream the contents of a container as a tar archive
history Show the history of an image
images List images
import Create a new filesystem image from the contents of a tarball
info Display system-wide information
inspect Return low-level information on a container
kill Kill a running container
load Load an image from a tar archive
login Register or Login to the docker registry server
logs Fetch the logs of a container
port Lookup the public-facing port which is NAT-ed to PRIVATE_PORT
ps List containers
pull Pull an image or a repository from the docker registry server
push Push an image or a repository to the docker registry server
restart Restart a running container
rm Remove one or more containers
rmi Remove one or more images
run Run a command in a new container
save Save an image to a tar archive
search Search for an image in the docker index
start Start a stopped container
stop Stop a running container
tag Tag an image into a repository
top Lookup the running processes of a container
version Show the docker version information
wait Block until a container stops, then print its exit code
查看docker支持的选项:
docker --help
常用命令
总结一下常用命令:
其中<>
阔起来的参数为必选,[]
阔起来为可选
docker version
查看docker的版本号,包括客户端、服务端、依赖的Go等docker info
查看系统(docker)层面信息,包括管理的images, containers数等docker search <image>
在docker index中搜索imagedocker pull <image>
从docker registry server 中下拉imagedocker push <image|repository>
推送一个image或repository到registrydocker push <image|repository>:TAG
同上,指定tagdocker inspect <image|container>
查看image或container的底层信息docker images
TODO filter out the intermediate image layers (intermediate image layers 是什么)docker images -a
列出所有的imagesdocker ps
默认显示正在运行中的containerdocker ps -l
显示最后一次创建的container,包括未运行的docker ps -a
显示所有的container,包括未运行的docker logs <container>
查看container的日志,也就是执行命令的一些输出docker rm <container...>
删除一个或多个containerdocker rm `docker ps -a -q
` 删除所有的containerdocker ps -a -q | xargs docker rm
同上, 删除所有的containerdocker rmi <image...>
删除一个或多个imagedocker start/stop/restart <container>
开启/停止/重启containerdocker start -i <container>
启动一个container并进入交互模式docker attach <container>
attach一个运行中的containerdocker run <image> <command>
使用image创建container并执行相应命令,然后停止docker run -i -t <image> /bin/bash
使用image创建container并进入交互模式, login shell是/bin/bashdocker run -i -t -p <host_port:contain_port>
将container的端口映射到宿主机的端口docker commit <container> [repo:tag]
将一个container固化为一个新的image,后面的repo:tag可选docker build <path>
寻找path路径下名为的Dockerfile的配置文件,使用此配置生成新的imagedocker build -t repo[:tag]
同上,可以指定repo和可选的tagdocker build - < <dockerfile>
使用指定的dockerfile配置文件,docker以stdin方式获取内容,使用此配置生成新的imagedocker port <container> <container port>
查看本地哪个端口映射到container的指定端口,其实用docker ps
也可以看到
使用images新建一个container并登录
使用image来创建container:
root@tankywoo-docker:~# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
ubuntu 13.10 5e019ab7bf6d days ago MB
ubuntu saucy 5e019ab7bf6d days ago MB
ubuntu 12.04 74fe38d11401 days ago 209.6 MB
ubuntu precise 74fe38d11401 days ago 209.6 MB root@tankywoo-docker:~# docker run -i -t 74fe38d11401 /bin/bash root@80c761d06a87:/# cat /etc/issue
Ubuntu 12.04. LTS \n \l
使用repository来创建container, 这时默认使用tag为lastest的image:
root@tankywoo-docker:~# docker run -i -t ubuntu /bin/bash
root@442e1cc85a8d:/# uname -a
Linux 442e1cc85a8d 3.8.--generic #~precise1-Ubuntu SMP Fri Jun :: UTC x86_64 x86_64 x86_64 GNU/Linux
root@442e1cc85a8d:/# cat /etc/issue
Ubuntu 14.04 LTS \n \l root@442e1cc85a8d:/# exit
使用commit将一个container固化为一个image
root@tankywoo-docker:~# docker ps -l
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f1fd375204af ubuntu:12.04 /bin/bash minutes ago Exited () seconds ago lonely_colden root@tankywoo-docker:~# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
ubuntu 13.10 5e019ab7bf6d days ago MB
ubuntu saucy 5e019ab7bf6d days ago MB
ubuntu 12.04 74fe38d11401 days ago 209.6 MB
提交当前container为一个image,顺便带上作者信息,并指定repository 和 tag
root@tankywoo-docker:~# docker commit -a "Tanky Woo <me@tankywoo.com>" f1fd375204af ubuntu:test
fe65a2781daea01c67c33f11868abe6d510833bca07b90fc681cdfe98a9196ac root@tankywoo-docker:~# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
ubuntu test fe65a2781dae seconds ago 209.6 MB
ubuntu 13.10 5e019ab7bf6d days ago MB
ubuntu saucy 5e019ab7bf6d days ago MB
attach一个运行中的容器
root@tankywoo-docker:~# docker ps -l
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e2e6c95f0bf5 ubuntu:test /bin/bash minutes ago Exited () minutes ago suspicious_mccarthy
启动一个container:
root@tankywoo-docker:~# docker start e2e6c95f0bf5
e2e6c95f0bf5
可以看此container到正在运行中:
root@tankywoo-docker:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e2e6c95f0bf5 ubuntu:test /bin/bash minutes ago Up seconds suspicious_mccarthy
attach这个container:
root@tankywoo-docker:~# docker attach e2e6c95f0bf5
进入container:
root@e2e6c95f0bf5:/#
docker build 构建
root@tankywoo-docker:~# cat Dockerfile
FROM ubuntu:test
ENTRYPOINT echo "Welcome!" root@tankywoo-docker:~# docker build -t ubuntu:newtest - < Dockerfile
Uploading context 2.048 kB
Uploading context
Step : FROM ubuntu:test
---> fe65a2781dae
Step : ENTRYPOINT echo "Welcome!"
---> Running in 09a062a296c5
---> f8104f05df90
Successfully built f8104f05df90
Removing intermediate container 09a062a296c5
root@tankywoo-docker:~# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
ubuntu newtest f8104f05df90 seconds ago 209.6 MB
ubuntu test fe65a2781dae minutes ago 209.6 MB
ubuntu 13.10 5e019ab7bf6d days ago MB
ubuntu saucy 5e019ab7bf6d days ago MB
ubuntu precise 74fe38d11401 days ago 209.6 MB
ubuntu 12.04 74fe38d11401 days ago 209.6 MB
ubuntu 12.10 a7cf8ae4e998 days ago 171.3 MB
ubuntu quantal a7cf8ae4e998 days ago 171.3 MB
ubuntu 14.04 99ec81b80c55 days ago MB
ubuntu trusty 99ec81b80c55 days ago MB
ubuntu latest 99ec81b80c55 days ago MB
ubuntu 13.04 316b678ddf48 days ago 169.4 MB
ubuntu raring 316b678ddf48 days ago 169.4 MB
ubuntu 10.04 3db9c44f4520 weeks ago MB
ubuntu lucid 3db9c44f4520 weeks ago MB root@tankywoo-docker:~# docker run ubuntu:newtest
// :: Unrecognized input header
root@tankywoo-docker:~# docker run -i -t ubuntu:newtest /bin/bash
Welcome!
TODO: 为何要使用 -i 和 -t
使用 docker run -p 的例子
镜像ubuntu:12.04没有vi,没法编辑/etc/apt/sources.list
现在本地有一份,想上传上去
首先映射端口(宿主的2222端口和container的33333端口映射):
docker run -i -t -p : fe65a2781dae /bin/bash
container上监听33333:
nc -l -p > /etc/apt/sources.list
本地使用22222端口传输:
nc localhost < sources.list
查看映射的端口
root@tankywoo-docker:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7abe8e31ac8b ubuntu:test /bin/bash minutes ago Up minutes 0.0.0.0:->/tcp hungry_carson root@tankywoo-docker:~# docker port 7abe8e31ac8b
0.0.0.0: root@tankywoo-docker:~# netstat -tlnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0.0.0.0: 0.0.0.0:* LISTEN /sshd
tcp6 ::: :::* LISTEN /docker
tcp6 ::: :::* LISTEN /sshd
但是这里很好奇为啥是监听在ipv4的地址上?
删除image/container遇到的依赖关系
关于删除时的依赖关系,按照提示删除就行了
比如删除images时,需要先删除通过它创建的所有containers:
root@tankywoo-docker:~# docker rmi 666c5d65f396 3494872e31a4 62fda5e450d5 5e1829f90d6e 89554a25c998
Error: Conflict, cannot delete 666c5d65f396 because the container 43a7072bac7a is using it
Error: Conflict, cannot delete 3494872e31a4 because the container 40b3cd8b2e42 is using it
Error: Conflict, cannot delete 62fda5e450d5 because the container 5142a3d092a6 is using it
Untagged: test:latest
Deleted: 5e1829f90d6e9ac09645841fe6ab85a0b0f9b28f008a571299a624e566684afe
Deleted: ae5ae236a8e1d946963a7c2c142cc892b1979cb9458e0ecac4d33d2283ace567
Untagged: memchaced:latest
Deleted: 89554a25c998d14c76ff885ddac7cc1a47ae4caf9edcddaa43408b402a1684fb
// :: Error: failed to remove one or more images root@tankywoo-docker:~# docker rm 43a7072bac7a 40b3cd8b2e42 5142a3d092a6
43a7072bac7a
40b3cd8b2e42
5142a3d092a6
且删除images时也可能会遇到依赖其它的images,比如直接删除父镜像时,就会提示需要先删除子镜像。
可以通过:
docker images --tree
来查看,不过官方提示 --tree
已经弃用了,会在以后的版本去掉.
首先清空所有containers:
root@tankywoo-docker:~# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
然后以树形结构查看依赖关系:
root@tankywoo-docker:~# docker images --tree
Warning: '--tree' is deprecated, it will be removed soon. See usage.
└─511136ea3c5a Virtual Size: B
├─e2aa6665d371 Virtual Size: 106.1 MB
│ └─f0ee64c4df74 Virtual Size: 106.3 MB
│ └─2209cbf9dcd3 Virtual Size: 106.3 MB
│ └─5e019ab7bf6d Virtual Size: MB Tags: ubuntu:13.10, ubuntu:saucy
├─f10ebce2c0e1 Virtual Size: 103.7 MB
│ └─82cdea7ab5b5 Virtual Size: 103.9 MB
│ └─5dbd9cb5a02f Virtual Size: 103.9 MB
│ └─74fe38d11401 Virtual Size: 209.6 MB Tags: ubuntu:precise, ubuntu:12.04
│ └─fe65a2781dae Virtual Size: 209.6 MB Tags: ubuntu:test
│ └─276cc641e40e Virtual Size: 388.3 MB Tags: ubuntu:newtest
├─ef519c9ee91a Virtual Size: 100.9 MB
│ └─07302703becc Virtual Size: 101.2 MB
│ └─cf8dc907452c Virtual Size: 101.2 MB
│ └─a7cf8ae4e998 Virtual Size: 171.3 MB Tags: ubuntu:12.10, ubuntu:quantal
├─5e66087f3ffe Virtual Size: 192.5 MB
│ └─4d26dd3ebc1c Virtual Size: 192.7 MB
│ └─d4010efcfd86 Virtual Size: 192.7 MB
│ └─99ec81b80c55 Virtual Size: MB Tags: ubuntu:14.04, ubuntu:latest, ubuntu:trusty
├─02dae1c13f51 Virtual Size: 98.35 MB
│ └─e7206bfc66aa Virtual Size: 98.54 MB
│ └─cb12405ee8fa Virtual Size: 98.54 MB
│ └─316b678ddf48 Virtual Size: 169.4 MB Tags: ubuntu:raring, ubuntu:13.04
└─6cfa4d1f33fb Virtual Size: B
└─3db9c44f4520 Virtual Size: MB Tags: ubuntu:10.04, ubuntu:lucid
现在准备删除12.10版本的父镜像 cf8dc907452c, 会提示有冲突,删不掉:
root@tankywoo-docker:~# docker rmi cf8dc907452c
Error: Conflict, cf8dc907452c wasn't deleted
// :: Error: failed to remove one or more images
但是可以删除叶子节点 a7cf8ae4e998:
root@tankywoo-docker:~# docker rmi a7cf8ae4e998
Untagged: ubuntu:12.10
Untagged: ubuntu:quantal
Deleted: a7cf8ae4e998c5339e769d6cc466f9133bd4d330a549bb846cb1641cd638247c
Deleted: cf8dc907452c970224551599da573c9e32897fc65286d942625c4c86dabd680d
Deleted: 07302703beccc2ea25f34333decad32ed06446e8a14c020ffbd0be017364b9fe
Deleted: ef519c9ee91a06fc33cefbda1bce27686617761700252dff0397f2c0e269f3c5
containers之间共享数据
docker 的 containers之间共享目录是通过 volume
。
docker run
命令使用 -v
可以绑定一个volume, -v
可以使用多次,创建多个volume:
root@tankywoo-docker:~# docker run -i -t -v /tmp/tankywoo --name data ubuntu:newtest /bin/bash [/]
使用 mount 看到 /tmp/tankywoo 已经被mount了:
root@fec65f523cef:/# mount
none on / type aufs (rw,relatime,si=f7ac8b1595d13ed9)
...
/dev/disk/by-uuid/b77aed99-bb9b---4ed204fe5d46 on /tmp/tankywoo type ext3 (rw,relatime,errors=remount-ro,user_xattr,acl,barrier=,data=ordered)
查看 /tmp/tankywoo 目录下,是空的:
root@fec65f523cef:/tmp/tankywoo# ls
root@fec65f523cef:/tmp/tankywoo#
然后在宿主机新建一个container,来绑定这个volume:
按照 docker run 的命令行参数:
--volumes-from=[]: Mount volumes from the specified container(s)
有问题:
root@tankywoo-docker:/tmp/tankywoo# docker run -i -t --volumes-from=["data"] ubuntu:newtest /bin/bash [/]
// :: Error: Cannot start container 5d83dcaf8f0220024e0403a362c0512a8218cfcb45dc911df5d2cd37f9a4e8a4: Container [data] not found. Impossible to mount its volumes
必须像short option的方式使用:
root@tankywoo-docker:/tmp/tankywoo# docker run -i -t --volumes-from data ubuntu:newtest /bin/bash root@d100d9604b4b:/# mount
none on / type aufs (rw,relatime,si=f7ac8b15b25036d9)
...
/dev/disk/by-uuid/b77aed99-bb9b---4ed204fe5d46 on /tmp/tankywoo type ext3 (rw,relatime,errors=remount-ro,user_xattr,acl,barrier=,data=ordered)
也可以看到 /tmp/tankywoo 目录,并且是空的,然后新建一个文件:
root@d100d9604b4b:/tmp/tankywoo# ls
root@d100d9604b4b:/tmp/tankywoo# touch file
root@d100d9604b4b:/tmp/tankywoo# ls
file
再看看之前那个container:
root@fec65f523cef:/tmp/tankywoo# ls
file
也有这个文件了
参考
退出container但是保持运行
默认情况下,如果使用ctrl-c
退出container,那么container也会stop
按ctrl-p ctrl-q
可以退出到宿主机,而保持container仍然在运行
Docker被墙
关于 Docker 被墙,老甘的文章里提到的修改hosts文件,先mark,未验证:
# /etc/hosts
54.234.135.251 get.docker.io
54.234.135.251 cdn-registry-.docker.io
遗留的问题
有时docker执行不了任何命令(会卡住),包括重启docker server,在日志里看到这些:
May 5 17:41:48 tpl-ubuntu12-04 kernel: [99589.489241] unregister_netdevice: waiting for lo to become free. Usage count = 3
May 5 17:41:58 tpl-ubuntu12-04 kernel: [99599.708117] unregister_netdevice: waiting for lo to become free. Usage count = 3
May 5 17:42:08 tpl-ubuntu12-04 kernel: [99609.927057] unregister_netdevice: waiting for lo to become free. Usage count = 3
May 5 17:42:18 tpl-ubuntu12-04 kernel: [99620.145993] unregister_netdevice: waiting for lo to become free. Usage count = 3
May 5 17:42:29 tpl-ubuntu12-04 kernel: [99630.364922] unregister_netdevice: waiting for lo to become free. Usage count = 3
May 5 17:42:39 tpl-ubuntu12-04 kernel: [99640.583850] unregister_netdevice: waiting for lo to become free. Usage count = 3
May 5 17:42:49 tpl-ubuntu12-04 kernel: [99650.802794] unregister_netdevice: waiting for lo to become free. Usage count = 3
May 5 17:42:59 tpl-ubuntu12-04 kernel: [99661.021726] unregister_netdevice: waiting for lo to become free. Usage count = 3
May 5 17:43:10 tpl-ubuntu12-04 kernel: [99671.240662] unregister_netdevice: waiting for lo to become free. Usage count = 3
May 5 17:43:20 tpl-ubuntu12-04 kernel: [99681.459572] unregister_netdevice: waiting for lo to become free. Usage count = 3
May 5 17:43:30 tpl-ubuntu12-04 kernel: [99691.678530] unregister_netdevice: waiting for lo to become free. Usage count = 3
May 5 17:43:40 tpl-ubuntu12-04 kernel: [99701.897432] unregister_netdevice: waiting for lo to become free. Usage count = 3
May 5 17:43:51 tpl-ubuntu12-04 kernel: [99712.128370] unregister_netdevice: waiting for lo to become free. Usage count = 3
May 5 17:44:01 tpl-ubuntu12-04 kernel: [99722.347289] unregister_netdevice: waiting for lo to become free. Usage count = 3
May 5 17:44:11 tpl-ubuntu12-04 kernel: [99732.566226] unregister_netdevice: waiting for lo to become free. Usage count = 3
May 5 17:44:21 tpl-ubuntu12-04 kernel: [99742.785141] unregister_netdevice: waiting for lo to become free. Usage count = 3
什么是Layer
Docker images are built up in layers. So, for instance, if you need to run WordPress, you would build the Ubuntu layer, add a layer for Apache2 web server, add a PHP layer and then a layer for the WordPress files. Lower layers can be re-used. We might take the PHP layer and layer on Drupal instead of WordPress, or update our WordPress layer with a newer version or Wordpress.
Because we can re-use layers, we can make new docker images very cheaply. We can create a new docker image by changing just a single line of one file and we do not have to rebuild the whole stack.
The beauty of docker images being “just files” means that the difference between two docker images is just a diff of the files they contain.
概念上的问题
The Docker Guidebook 的简单对比:
Image
: An image is a read only layer used to build a container. They do not change.
Container
: Is basically a self contained runtime environment that is built using one or more images. You can commit your changes to a container and create an image.
index / registry
: These are public or private servers where people can upload their repositories so they can easily share what they made.
Repository
: A repository is a group of images located in the docker registry. There are two types of repositories, Top level and user repositories. Top level repositories don't have a '/' in the name and they are usually reserved for base images. These Top level repositories is what most people build their repositories on top of. They are controlled by the maintainers of Docker. User repositories are repositories that anyone can upload into the registry and share with other people.
说直接点,Image和Container最容易理解和对比,它俩的关系就像类与类的实例这两的关系一样。
其实Index和Registry也有区别,主要就是Index存储的是用户信息、images的checksum;而Registry存储的是images。具体见官方文档Registry & Index Spec。
另外,关于Repository与Registry和Image又是什么关系?
root@tankywoo-docker:~/docker-registry-master# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
10.2.15.190/tankywoo latest 276cc641e40e days ago 388.3 MB
10.2.15.190:/tankywoo latest 276cc641e40e days ago 388.3 MB
ubuntu newtest 276cc641e40e days ago 388.3 MB
ubuntu test fe65a2781dae days ago 209.6 MB
ubuntu 13.10 5e019ab7bf6d weeks ago MB
ubuntu saucy 5e019ab7bf6d weeks ago MB
ubuntu 12.04 74fe38d11401 weeks ago 209.6 MB
ubuntu precise 74fe38d11401 weeks ago 209.6 MB
ubuntu 14.04 99ec81b80c55 weeks ago MB
ubuntu latest 99ec81b80c55 weeks ago MB
ubuntu trusty 99ec81b80c55 weeks ago MB
ubuntu 13.04 316b678ddf48 weeks ago 169.4 MB
ubuntu raring 316b678ddf48 weeks ago 169.4 MB
busybox latest 2d8e5b282c81 weeks ago 2.489 MB
ubuntu 10.04 3db9c44f4520 weeks ago MB
ubuntu lucid 3db9c44f4520 weeks ago MB
以这个为例
这里的ubuntu是image名称吗?(后面解答)
一个image完整的名称是:
username/image_name:tag
docker整体和Github非常像,image管理也不例外。
其中,如果username没有写,则被认为是官方认证过的image。如前面提到,如果tag没有写,则被认为tag是lastest
。
另外,如果username写了,如 tankywoo/ubuntu,则会在官方index中查找username为tankywoo的ubuntu仓库;如果写的如上10.2.15.190:5000/tankywoo
,则10.2.15.190:5000
则被认为是第三方registry的地址。
所以如上所说,ubuntu并不是image的名称,而是repository的名称。
再看看/var/lib/docker/
下的 repositories-aufs
,这是一个repositories的json列表:
root@tankywoo-docker:~/docker-registry-master# cat /var/lib/docker/repositories-aufs | python -m json.tool
{
"Repositories": {
"10.2.15.190/tankywoo": {
"latest": "276cc641e40e01a18f6bee9e81a576adb7090d3fbae098f809857e0696ccbc87"
},
"10.2.15.190:5000/tankywoo": {
"latest": "276cc641e40e01a18f6bee9e81a576adb7090d3fbae098f809857e0696ccbc87"
},
"busybox": {
"latest": "2d8e5b282c81244037eb15b2068e1c46319c1a42b80493acb128da24b2090739"
},
"ubuntu": {
"10.04": "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710",
"12.04": "74fe38d114018aac73c5997b95263090048ec9a1f58f33a1b53f55e92156d53b",
"13.04": "316b678ddf487a37012630ae3219c8bb78c1f4b58d31c9513c3ea6b88f9e5635",
"13.10": "5e019ab7bf6deb75b211411ef7257d1e76bf7edee31d9da62a392df98d0529d6",
"14.04": "99ec81b80c55d906afd8179560fdab0ee93e32c52053816ca1d531597c1ff48f",
"latest": "99ec81b80c55d906afd8179560fdab0ee93e32c52053816ca1d531597c1ff48f",
"lucid": "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710",
"newtest": "276cc641e40e01a18f6bee9e81a576adb7090d3fbae098f809857e0696ccbc87",
"precise": "74fe38d114018aac73c5997b95263090048ec9a1f58f33a1b53f55e92156d53b",
"raring": "316b678ddf487a37012630ae3219c8bb78c1f4b58d31c9513c3ea6b88f9e5635",
"saucy": "5e019ab7bf6deb75b211411ef7257d1e76bf7edee31d9da62a392df98d0529d6",
"test": "fe65a2781daea01c67c33f11868abe6d510833bca07b90fc681cdfe98a9196ac",
"trusty": "99ec81b80c55d906afd8179560fdab0ee93e32c52053816ca1d531597c1ff48f"
}
}
}
可以看到 10.2.15.190/tankywoo
, 10.2.15.190:5000/tankywoo
, busybox
, ubuntu
等都是repository名,里面包含了一个或多个images。
- registry是repositories的集合
- repositry是images的集合
Docker 总结(转载)的更多相关文章
- docker资料转载
Docker之理解image,container和storage-driver centos7创建docker tomcat镜像 Linux Namespace和Cgroup
- Docker学习系列(一):windows下安装docker(转载)
本文目录如下: windows按照docker的基本要求 具体安装步骤 开始使用 安装远程连接工具连接docker 安装中遇到的问题 Docker的更新 Docker中的jupyter windows ...
- docker 进程 转载:https://www.cnblogs.com/ilinuxer/p/6188303.html
今天我们会分析Docker中进程管理的一些细节,并介绍一些常见问题的解决方法和注意事项. 容器的PID namespace(名空间) 在Docker中,进程管理的基础就是Linux内核中的PID名空间 ...
- docker 进程 转载:
今天我们会分析Docker中进程管理的一些细节,并介绍一些常见问题的解决方法和注意事项. 容器的PID namespace(名空间) 在Docker中,进程管理的基础就是Linux内核中的PID名空间 ...
- docker修改存储路径(转载)
系统盘只有40G,有时docker镜像会占据大量的存储空间,于是想把docker的默认存储位置改成挂载的数据盘.docker的默认存储位置未为:/var/lib/docker 更改docker的默认存 ...
- 使用Jenkins来构建Docker容器
使用Jenkins来构建Docker容器(Ubuntu 14.04) 当开发更新了代码,提交到Gitlab上,然后由测试人员触发Jenkins,于是一个应用的新版本就被构建了.听起来貌似很简单,dua ...
- Docker入门学习
Python爬虫 最近断断续续的写了几篇Python的学习心得,由于有开发经验的同学来说上手还是比较容易,而且Python提供了强大的第三方库,做一个小的示例程序还是比较简单,这不我之前就是针对Pyt ...
- Docker详解
一.Docker 简介 Docker 两个主要部件: Docker: 开源的容器虚拟化平台 Docker Hub: 用于分享.管理 Docker 容器的 Docker SaaS 平台 -- Docke ...
- docker使用记录
1.安装(开始前要注意系统内核版本是否合适,建议用7以上的系统吧,少点坑) //安装docker yum -y install docker-io //启动 service docker start ...
随机推荐
- Android 网络图片查看器
今天来实现一下android下的一款简单的网络图片查看器 界面如下: 代码如下: <LinearLayout xmlns:android="http://schemas.android ...
- vs2013编译boost1.55.0 32/64位
在使用vs2013编译boost-1.55.0之前,先要给boost做下修改: boost_1_55_0\boost\intrusive\detail\has_member_function_call ...
- .net开发中常用的第三方组件
.net开发中常用的第三方组件 2013-05-09 09:33:32| 分类: dotnet |举报 |字号 订阅 下载LOFTER 我的照片书 | RSS.NET.dll RSS. ...
- SQL Tune Report–sqltrpt.sql
ORACLE 10g提供了一个脚本sqltrpt.sql用来查询最耗费资源的SQL语句,其输出的结果分为两部分: 15 Most expensive SQL in the cursor cache 1 ...
- 京东MySQL监控之Zabbix优化、自动化
原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://wangwei007.blog.51cto.com/68019/1833332 随 ...
- Java并发工具类Semaphore应用实例
package com.thread.test.thread; import java.util.Random; import java.util.concurrent.*; /** * Semaph ...
- Confluent介绍(一)
最开始接触confluent是通过这篇博客,How to Build a Scalable ETL Pipeline with Kafka Connect,对于做大数据的,数据的ETL(抽取,转换,装 ...
- 批处理脚本为Mysql重置root密码(重置密码为123456)
@echo off title mysql ::从注册表找到Mysql的安装路径写入文件mysql.txt reg query HKLM\SYSTEM\ControlSet001\Services\M ...
- Win7下硬盘安装Ubuntu 12.04.3双系统
一. 准备工作 1. 下载ubuntu镜像文件:Ubuntu-12.04.3-desktop-amd64.iso(4G及以上内存建议64位),注意这个amd并不是指amd芯片. 2. 下载硬盘分区工具 ...
- my_atoi()
void my_atoi(const char* s){ int i=0,res=0; if(*s<='9' && *s>='0'){ //如果输入的一个字符是数字 for ...