Docker image storage location
The image downloaded by Docker is stored in the following folder by default:
<code>/var/lib/docker/image</code>
This folder is located in the Docker installation directory and contains the download All images. Each image is stored in a separate subfolder, which contains the image's metadata and layer files.
Image storage mechanism
Docker stores images in a layered manner, which means that each new image is built based on one or more existing images. When a new image is downloaded, Docker first checks to see if it already exists in local storage. If it exists, there is no need to download it again. Otherwise, Docker will download the image from the registry and store it in the image
folder.
Change the default storage location
In some cases, you may need to store the image in a different location, such as to improve performance or save space. You can change the default storage location by setting the docker-root
flag:
<code>sudo dockerd --gpus all --storage-driver overlay2 --docker-root /path/to/new/storage/location</code>
Note that this change will not take effect until the Docker service is restarted.
Other storage options
In addition to the default storage location, Docker also provides other storage options, including:
The above is the detailed content of In which folder should the image downloaded by docker be placed?. For more information, please follow other related articles on the PHP Chinese website!