1. 程式人生 > >centos7下安裝docker(2鏡像)

centos7下安裝docker(2鏡像)

world 組成 啟動 ges src img es2017 base .com

docker最小的鏡像——hello-world

下載鏡像 docker pull

docker pull hello-world

查看鏡像 docker images

docker images hello-world

技術分享

運行鏡像 docker run

技術分享

docker基礎鏡像:自我感覺基礎鏡像Linux各種版本沒有做過任何操作過的鏡像

以centos為例

下載centos的鏡像:docker pull centos

技術分享

技術分享

註:Linux的操作系統是由內核空間kernel和用戶空間組成的;

內核空間:kernel,linux啟動的時候會加載bootfs文件系統,之後bootfs會被卸載掉;

用戶空間的文件系統是rootfs,包括/dev/,/proc,/bin等目錄

對於docker的基礎鏡像來說,底層用的是Host的內核空間kernel,docker只需要提供rootfs。

note:不同的linux發行版的主要區別是rootfs不同

important note:基礎(base)鏡像只是在用戶空間與發行版一致,內核空間kernel不一定一致,容器的內核版本與底層Host保持一致,容器只能使用Host的內核版本,不能修改

啟動並進入centos容器:docker run -it centos

centos7下安裝docker(2鏡像)