docker_practice/arch/container.md

9 lines
527 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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