docker images
docker pull centos
docker run -it centos /bin/bash
并且进入 home 文件夹新建一个文件:
demo.txt
当然我们可以继续添加自己的环境、工具软件等功能使其完善。
exit
退出刚才做好的镜像
docker commit -m 'add demo.txt' -a 'ycmbcd' 8d000472b262 ycmbcd/centos:v1
如果没有敲错代码的话,我们的镜像就做好了,查看一下:
docker push ycmbcd/centos:v1
这样就上传好了。下次到其他电脑上:
docker pull ycmbcd/centos:v1
就可以把我们的镜像同步下来。
参考文献:
- https://blog.csdn.net/S_gy_Zetrov/article/details/78161154
- https://zhuanlan.zhihu.com/p/23599229
- https://zhuanlan.zhihu.com/p/22259092
- http://cpper.info/2016/12/03/docker-image-introduction.html
- http://blog.csdn.net/ture_dream/article/details/52651746
- http://www.leesven.com/2254.html
- https://askubuntu.com/questions/778318/how-do-i-install-gcc-6-latest-6-1-on-ubuntu-14-04-lts-make-c14-the-default
- http://blog.qiniu.com/archives/805
- http://blog.csdn.net/ziren235/article/details/78064936?locationNum=5&fps=1
- https://segmentfault.com/a/1190000002766882
- http://blog.csdn.net/jiang_xinxing/article/details/58025417
- http://blog.csdn.net/yyw794/article/details/78048372
- http://p.primeton.com/articles/549ad953e13823790300009d