docker笔记(18)——如何创建新的image

(1)通过当前运行的container创建image

# docker commit 281e7d886185 <docker image name>

(2)压缩image

# docker save <docker image name> | gzip > <docker image name>.tar.gz

(3)加载image

# zcat <docker image name>.tar.gz | docker load

参考资料:
HOW TO CREATE A DOCKER IMAGE FROM A CONTAINER
How to copy Docker images from one host to another without using a repository

 

发表评论

邮箱地址不会被公开。 必填项已用*标注

This site uses Akismet to reduce spam. Learn how your comment data is processed.