RHEL7 Docker 虛擬化使用
Docker是一個開源工具,它可以讓創(chuàng)建和管理linux容器變得簡單。容器就像是輕量級的虛擬機(jī),作為一種新興的虛擬化方式,Docker跟傳統(tǒng)的虛擬化方式相比具有眾多優(yōu)勢。

環(huán)境:Centos7ip:172.16.1.10Docker version 1.13.1運行一個容器、“-i”捕獲標(biāo)準(zhǔn)輸入輸出、“-t分配一個控制臺”[root@localhost~]#dockerrun-i-tcentos/bin/bash[root@86a46aa13531/]#lsbindevetchomeliblib64lost+foundmediamntoptprocrootrunsbinsrvsystmpusrvar[root@86a46aa13531/]#創(chuàng)建鏡像-a 作者信息,-m 提交信息,-p 提交時暫停容器運行,如果提交成功會返回一個id數(shù)字串。
[root@localhost~]#dockercommit-m"aaa"-a"chao"86a46aa13531sha256:6efd478542f1a99b20796c9372c2976b87344263a051dbf39fd385ea4dbb8873查看鏡像[root@localhost~]#dockerimagesREPOSITORYTAGIMAGEIDCREATEDSIZEchaolatest7b6e3368140a47hoursago237MB6efd478542f147hoursago237MBdocker.io/centoslatest470671670cac6weeksago237MB轉(zhuǎn)出轉(zhuǎn)入鏡像docker save命令轉(zhuǎn)出,docker load命令轉(zhuǎn)入。
轉(zhuǎn)出chao鏡像為CHAO[root@localhost~]#dockersave-oCHAO.tarchao:latest[root@localhost~]#ls123anaconda-ks.cfgCHAO.tarinitial-setup-ks.cfg刪除鏡像[root@localhost~]#dockerimagesREPOSITORYTAGIMAGEIDCREATEDSIZEchaolatest7b6e3368140a47hoursago237MB6efd478542f147hoursago237MBdocker.io/centoslatest470671670cac6weeksago237MB[root@localhost~]#dockerrmi-f7b6e3368140aUntagged:chao:latestDeleted:sha256:7b6e3368140ac0e977bc37110f267e3c7b641e0b42ba04e93b1bbda46331c29c[root@localhost~]#dockerimagesREPOSITORYTAGIMAGEIDCREATEDSIZE6efd478542f147hoursago237MBdocker.io/centoslatest470671670cac6weeksago237MB轉(zhuǎn)入鏡像[root@localhost~]#dockerload<chao.tarLoadedimage:chao:latest[root@localhost~]#dockerimagesREPOSITORYTAGIMAGEIDCREATEDSIZEchaolatest7b6e3368140a47hoursago237MB6efd478542f147hoursago237MBdocker.io/centoslatest470671670cac6weeksago237MB以上就是docker的基礎(chǔ)操作
了解更多相關(guān)內(nèi)容歡迎關(guān)注http://www.vecloud.com/