Save the image as a file, the command is as follows:
docker save -o 要保存的文件名 要保存的镜像
Example:
[root@iZbp16cdvzk4rhl0vn1gedZ ~]# ls aaa.cap install.sh mobile-1.0.0-SNAPSHOT.jar sa_recovery.log [root@iZbp16cdvzk4rhl0vn1gedZ ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE bb v1.0 3b8d26737bcb 10 minutes ago 202MB centos latest 9f38484d220f 3 weeks ago 202MB java latest d23bdf5b1b1b 2 years ago 643MB [root@iZbp16cdvzk4rhl0vn1gedZ ~]# docker save -o cc.tar bb:v1.0 [root@iZbp16cdvzk4rhl0vn1gedZ ~]# ls aaa.cap cc.tar install.sh mobile-1.0.0-SNAPSHOT.jar sa_recovery.log
Recommended tutorial:docker tutorial
The above is the detailed content of How docker packages images into files. For more information, please follow other related articles on the PHP Chinese website!