docker自定义增强镜像
一、commit命令
1.初始化
- 更新包管理工具
root@373019bd83f8:~# apt-get update
- 安装需要的插件
2.打包
[root@localhost ~]# docker commit -m="vim cmd add" -a="chet" 373019bd83f8 ubuntu-vim:1.1
sha256:38502e41e73e3a26c137b47ec78a8dea5fdc639486fc72051c6c130f263ce4e1
3.查看
[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu-vim 1.1 38502e41e73e 55 seconds ago 178MB
tomcat latest fb5657adc892 7 months ago 680MB
redis latest 7614ae9453d1 7 months ago 113MB
mysql latest 3218b38490ce 7 months ago 516MB
ubuntu latest ba6acccedd29 9 months ago 72.8MB
- 可以观察到新的镜像包变大了