Where are Docker images stored on the host machine?

后端 未结 29 2347
逝去的感伤
逝去的感伤 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条回答
  •  Happy的楠姐
    2020-11-22 06:49

    this was the old way of doing, now it has changed. Disregard this answer as of 2019

    In the special case of Mac OS X or Windows, using boot2docker, your Docker images are stored within a VirtualBox VM managed by boot2docker.

    This VM will be stored in normal place of VirtualBox images:

          OS X: ~/VirtualBox VMs/boot2docker-vm

          Windows: %USERPROFILE%/VirtualBox VMs/boot2docker-vm

    You can reset it by running (WARNING: This will destroy all images you've built and downloaded so far):

    boot2docker down
    boot2docker destroy
    boot2docker init
    boot2docker up
    

    This is especially useful if you kept tons of intermediate images when building / debugging a build without the useful --rm options, I quote them here for reference: Use:

    docker build -t webapp --rm=true --force-rm=true .
    

    instead of:

    docker build -t webapp .
    

提交回复
热议问题