李明
|
Container 转成Image(不推荐)
docker image ls docker run -it centos yum install -y vimexit
docker container ls -a docker commit docker commit 容器的名称 liming/centos-vim docker image ls
docker history 容器ID docker history centos的容器ID
docker build的方式也就是通过Dockfile的方式(推荐)
docker image rm liming/centos-vim docker image ls docker container ls docker container ls -a docker container rm c5a14ab5c071 docker container ls -a docker container ls
mkdir docker-centos-vim cd docker-centos-vim/ vim Dockerfile
FROM centos RUN yum install -y vim
docker build -t liming/centos-vim-new .
PS:为啥推荐用Dockerfile的方式,因为文件可以随便编辑,如果你用容器的话,你发给别人如何发麻烦不?还是单文件方便吧。
|
2018-08-29 10:39:33