1 运行一个centos容器
docker run -id --name centos_vim centos:centos7
2 在容器中装vim
docker exec -it a6e240 /bin/bash
yum install vim -y
3 把容器做成镜像(centos+vim)
docker commit centos_vim centos_vim_image
4 把centos_vim 容器删除
docker rm centos_vim -f
5 基于新构建的镜像,运行成容器
docker run -id --name centos_vim centos_vim_image:latest
# 进入到容器中查看,软件都在
docker exec -it c3e633bd1 /bin/bash
标签:容器,自定义,centos,备份,vim,dock,镜像,docker From: https://www.cnblogs.com/wellplayed/p/18071501