Dokcer commit更新镜像
1.拉取当前镜像
命令:docker pull <image>
样例:
2.运行镜像
命令:docker run --name <container> -it <image> /bin/bash 交互式创建容器
样例:
3.进入容器
命令:docker exec -it <container_id> /bin/bash
样例:
4.更新image
进入容器后完成相关修改,修改完成后退出容器<exit>。
命令:docker commit -m="comments" <container_id/current image> <target image>
样例:
生成新的镜像
5.运行新的镜像
同步骤2