DEPRECATED, use https://github.com/vincepare/docker-backup instead
Finds the readwrite layer (top-most layer) and filesystem root of a docker container.
Accessing the readwrite layer from the docker host can be useful to backup ephemeral container data, while finding the filesystem root allow to browse a container directory structure without having to login into.
Please not that this could only work with union filesystem based storage driver like AUFS and Overlay2. Currently, only AUFS is supported, feel free to contribute to add Overlay2 support.
curl -Lo /usr/local/bin/docker-layer https://gist.github.com/vincepare/fed1400108c70cda89eeaaf4f3cdc514/raw/docker-layer.sh && chmod +x /usr/local/bin/docker-layer
OR :
wget -O /usr/local/bin/docker-layer https://gist.github.com/vincepare/fed1400108c70cda89eeaaf4f3cdc514/raw/docker-layer.sh && chmod +x /usr/local/bin/docker-layer
# docker-layer musing_wiles
rw layer : /var/lib/docker/aufs/diff/c83338693ff190945b2374dea210974b7213bc0916163cc30e16f6ccf1e4b03f
mnt : /var/lib/docker/aufs/mnt/c83338693ff190945b2374dea210974b7213bc0916163cc30e16f6ccf1e4b03f
# docker-layer -w musing_wiles
/var/lib/docker/aufs/diff/c83338693ff190945b2374dea210974b7213bc0916163cc30e16f6ccf1e4b03f
# docker-layer -m musing_wiles
/var/lib/docker/aufs/mnt/c83338693ff190945b2374dea210974b7213bc0916163cc30e16f6ccf1e4b03f