Location container Docker on host

Asked

Viewed 3,029 times

1

Since I started using Docker last year, to directly access the files in my container I used the following steps:

  • Docker Inspect -f {{. Id}} container_id

It returns me the full id container

With the full container id I accessed the directory where the container files were located:

  • cd /var/lib/Docker/aufs/mnt/container_id_full

But currently when I do it returns: file or directory not found. I found that in mnt folder there are dozens of diets with full ids names but none of them are recent containers.

I tried to see if you could find the directory using the command:

  • find -name container_id_full

but finds no folder

Can anyone tell if Docker has made any modifications to this in its latest updates and if so how can I access the container files directly through the host?

OS: Linux Mint 17.3 64bits

Docker: 1.10.3

1 answer

2


According to the docker’s documentation, from the version 1.10 the names of directories in which the containers are located within the host are not equal to the Ids of containers.

And the filesystems of containers stay inside /var/lib/docker/aufs/diff/.

I even took a test to see if I could find my container inside that directory diff/, and what would be the directory name. My ID container being executed:

"Id": "099bc297959fb860f5190f9d14d518071ef9626efd941215e28d054382750f6d"

and in the meantime, the filesystem that container was mounted in:

/var/lib/docker/aufs/diff/7864538e8d46047fc57bcf618472a42972b7e377335dd09695eea1ddf0003676

(I know it’s the same container because I put some text file inside it, and I saw that it was in that way inside the host)

OS: Ubuntu 14.04 64bits

Docker: 1.10.3

  • 1

    Yeah, after performing more tests I found my container in the aufs directory, gave an ls -lt and deduced what it was by the creation date and there it was but with a different container ID name as it was before, I do not know why this change, maybe security issue, or to hinder direct access to folders via host, I found the change unnecessary anyway.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.