📅  最后修改于: 2023-12-03 14:40:49.690000             🧑  作者: Mango
Docker is a powerful tool for building, shipping, and running applications in containers. One of the key features of Docker is the ability to save and load images from a registry or from a local file system. In this tutorial, we will explore how to use the docker save
command in Windows using the Shell/Bash.
To save a Docker image in Windows, follow these steps:
docker images
docker save <image-name>:<tag> -o <path-to-output-file>
For example:docker save my-image:latest -o /path/to/my-image.tar
This will save the my-image
image with the latest
tag to the file /path/to/my-image.tar
.ls /path/to/
You should see the my-image.tar
file listed.To load a Docker image from a saved file, follow these steps:
docker load -i <path-to-input-file>
For example:docker load -i /path/to/my-image.tar
This will load the my-image
image with the latest
tag from the file /path/to/my-image.tar
.docker images
You should see the my-image
image with the latest
tag listed.In this tutorial, we have covered how to use the docker save
and docker load
commands in Windows using the Shell/Bash. These commands are essential for managing Docker images and can be useful in various scenarios, such as backing up images or moving them between machines. With this knowledge, you should be able to handle Docker images with ease in your Windows environment.