View container
docker ps -a
View image
docker images
export container
docker commit
Command to generate a new image from the container
docker commit -a "打包作者名" -m "打包提交信息" 容器ID 镜像名称:1.0
docker export
command to package the container into tar,
docker export docker容器的ID > tar包名字.tar
docker export -o tar包名字.tar docker容器的ID
Export image
- Use to package multiple images
docker save
into one file at the same time , for example, package AAA and BBB in the mirror library below ,
docker save -o tar名称.tar AAA:8.2 BBB:5.6
Import image
- Use
docker import
the command to import the image file of the tar package.
docker import - 要设置的镜像名字 < tar包名字.tar
docker import tar包名字.tar 镜像名称:版本id
- Use
docker load
the command: Import docker save
the image tar package exported with the command
docker load -i tar包名称.tar