Where are Docker images stored on the host machine?

后端 未结 29 1626
逝去的感伤
逝去的感伤 2020-11-22 06:28

I managed to find the containers under directory /var/lib/docker/containers, but I can\'t find the images.

What are the directories and files under

相关标签:
29条回答
  • 2020-11-22 06:49

    If you keep in mind that Docker is still running in a VM, the system paths are relative to the VM and not from the Mac Osx system. As it says all is contained in a VM file :

    /Users/MyUserName/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.qcow2

    Try to run Alpine image with this volume option and the ls command you are able to list the VM host:

    docker run --rm -it -v /:/vm-root alpine:edge ls -l /vm-root

    After this just try :

    docker run --rm -it -v /:/vm-root alpine:edge ls -l /vm-root/var/lib/docker

    Now, you are able to list the docker folder from the VM host

    0 讨论(0)
  • 2020-11-22 06:49

    According to the Docker Getting Started guide "your built image" is "in your machine’s local Docker image registry."

    This is still strange to me, because now it leads to the question. Where is my machine's local Docker image registry?

    Nevertheless, I definitely think this info is worth sharing as an answer.

    0 讨论(0)
  • 2020-11-22 06:51

    In Docker for Windows, the logs are here: %USERPROFILE%\AppData\Local\Docker

    0 讨论(0)
  • 2020-11-22 06:53

    On Debian Unstable/Sid,

    docker info to find system-wide information.

    images are stored at /var/lib/docker/image/overlay2/imagedb/content and

    containers are stored at /var/lib/docker/containers

    docker version 18.06.0-ce, API version 1.38

    0 讨论(0)
  • 2020-11-22 06:54

    I use the boot2docker for Docker on Mac OSX, so the images is stored into the /Users/<USERNAME>/VirtualBox VMs/boot2docker-vm/boot2docker-vm.vmdk.

    0 讨论(0)
  • 2020-11-22 06:54

    Images are stored inside /var/lib/docker and then under applicable storage driver directory.

    Storage driver, being used, can be determined by executing docker info command.

    0 讨论(0)
提交回复
热议问题