Home > Article > Operation and Maintenance > Where is the file downloaded by docker?
The downloaded files in the Docker container are stored in the container's independent file system by default. The specific location is /var/lib/docker/containers/[container_id]/[layer_id]/, where container_id is the container ID and layer_id Is the ID of the source image layer. The exact location of a specific file can be obtained through the docker inspect command.
Docker download file default storage location
Docker download file within the container is stored in the container's file system by default . The container's file system is an independent, isolated virtual file system, which is different from the host file system.
Specific location:
Downloaded files are usually stored in /var/lib/docker/containers/[container_id]/[layer_id]/ directory, where:
container_id
is the ID of the container. layer_id
is the ID of the source image layer of the file. Command to get the exact location:
You can get the exact location of a specific file in the container file system using the following command:
<code class="shell">docker inspect [container_id] | jq -r '.[0].GraphDriver.Data["/var/lib/docker/overlay2/[layer_id]/.diff"]'</code>
Replace [container_id]
and [layer_id]
to get the required information.
Note:
-v
flag. The above is the detailed content of Where is the file downloaded by docker?. For more information, please follow other related articles on the PHP Chinese website!