Where are Docker images stored on the host machine?

后端 未结 29 2559
逝去的感伤
逝去的感伤 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

提交回复
热议问题