docker_practice/arch/container.md
2014-09-05 15:49:42 +08:00

9 lines
527 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

当我们运行`docker run -i -t ubuntu /bin/bash`命令时docker 在后台运行的操作如下:
* 如果本地有ubuntu这个image就从它创建容器否则从公有仓库下载
* 从image创建容器
* 分配一个文件系统并在只读的image层外面挂载一层可读写的层
* 从宿主主机配置的网桥接口中桥接一个虚拟接口到容器中去
* 从地址池配置一个ip地址给容器
* 执行你指定的程序,在这里启动一个/bin/bash进程
* -i -t 指定标准输入和输出