Search code examples
dockerdocker-container

Where is the docker container data stored on the host machine?


In docker, where is the container data, apart from the mounted volume, is stored till the container is running.

So lets say /usr/local is volume mounted, so it would be shared between the host and the container. Where is everything else stored?


Solution

  • You should inspect your docker container

    docker inspect [ID_CONTAINER]
    

    and check for the fields MergedDir, LowerDir and UpperDir. Docker uses OverlayFS file system to store the data.

    OverlayFS layers two directories on a single Linux host and presents them as a single directory. These directories are called layers and the unification process is referred to a a union mount. OverlayFS refers to the lower directory as lowerdir and the upper directory a upperdir. The unified view is exposed through its own directory called merged. enter image description here

    Check the doc here.