Search code examples
dockerboot2docker

Unable to access Docker containers folder on command line


I've just created my first docker container and it runs successfully. My problem now is that I can't access the folder where they are stored by default

/var/lib/docker/containers

It keeps throwing the error

can't cd to containers


Solution

  • You need root to access it:

    sudo ls /var/lib/docker/containers/
    

    Without root access:

    docker@boot2docker:/c/Users/VonC/prog/b2d$ cd /var/lib/docker/containers
    -sh: cd: can't cd to /var/lib/docker/containers
    

    So this would work:

    docker@boot2docker:/c/Users/VonC/prog/b2d$ sudo su -
    Boot2Docker version 1.6.0, build master : a270c71 - Thu Apr 16 19:50:36 UTC 2015
    Docker version 1.6.0, build 4749651
    root@boot2docker:~# cd /var/lib/docker/containers/
    root@boot2docker:/mnt/sda1/var/lib/docker/containers#