Save an image file from running container

从一个正在运行的container提取出docker image,保存到一个tar文件里,方便传输。

docker commit my-container
sha256:84eeb121cf5d95565c3c6e1a4a5d1fcc2cfd2598e549246e65bb40f8b14aaef3
docker images
REPOSITORY              TAG                 IMAGE ID            CREATED             SIZE
                                84eeb121cf5d        3 seconds ago       64.2MB
docker tag 84eeb121cf5d my-img:18.04
docker save --output my-img.tar my-img:18.04
docker load --input my-img.tar

你可能感兴趣的:(Save an image file from running container)