欢迎光临散文网 会员登陆 & 注册

RHEL7 Docker 虚拟化使用

2022-01-21 13:56 作者:Vecloud_  | 我要投稿

Docker是一个开源工具,它可以让创建和管理linux容器变得简单。容器就像是轻量级的虚拟机,作为一种新兴的虚拟化方式,Docker跟传统的虚拟化方式相比具有众多优势。

环境:Centos7ip:172.16.1.10Docker version 1.13.1运行一个容器、“-i”捕获标准输入输出、“-t分配一个控制台”[root@localhost~]#dockerrun-i-tcentos/bin/bash[root@86a46aa13531/]#lsbindevetchomeliblib64lost+foundmediamntoptprocrootrunsbinsrvsystmpusrvar[root@86a46aa13531/]#创建镜像-a 作者信息,-m 提交信息,-p 提交时暂停容器运行,如果提交成功会返回一个id数字串。


[root@localhost~]#dockercommit-m"aaa"-a"chao"86a46aa13531sha256:6efd478542f1a99b20796c9372c2976b87344263a051dbf39fd385ea4dbb8873查看镜像[root@localhost~]#dockerimagesREPOSITORYTAGIMAGEIDCREATEDSIZEchaolatest7b6e3368140a47hoursago237MB6efd478542f147hoursago237MBdocker.io/centoslatest470671670cac6weeksago237MB转出转入镜像docker save命令转出,docker load命令转入。


转出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转入镜像[root@localhost~]#dockerload<chao.tarLoadedimage:chao:latest[root@localhost~]#dockerimagesREPOSITORYTAGIMAGEIDCREATEDSIZEchaolatest7b6e3368140a47hoursago237MB6efd478542f147hoursago237MBdocker.io/centoslatest470671670cac6weeksago237MB以上就是docker的基础操作

了解更多相关内容欢迎关注http://www.vecloud.com/

RHEL7 Docker 虚拟化使用的评论 (共 条)

分享到微博请遵守国家法律