Docker Community Forums

Share and learn in the Docker community.

Devicemapper - Browse Image for files

docker

(Paragpatil2006) #1

Hi All,
I want to look into and pulled image layers without running a container.
I am using docker 1.9.1 on CentOs7. Hence default storage driver is devicemapper to which I want to stick to.

AFAIK -
All docker related data is stored in /var/lib/docker
I have pulled in ubuntu Image. I want to brows files in it even without running a container for Ubuntu Image.

Where should I look for corresponding file system ?

When I run the container, I can see rootfs and browse the files from path /var/lib/docker/devicemapper/mnt/(ContainerID*)/rootfs .

But when container is not running, This particular path /var/lib/docker/devicemapper/mnt/(ContainerID*) is empty.
All corresponding Image layer mount-points in /var/lib/docker/devicemapper/mnt/ seems to be empty.

Is there any way I can see content without running a container ? I have achived this on AUFS. But no luck on devicemapper.

So far I found that /var/lib/docker/graph/(ImageID*)/tar-data.json.gz found interesting. and I think If I can extract this I could get the data.

I have extracted tar-data.jason from gz bundle. Opened tar-data.jason by cat command. Data looks garbage. Does anyone knows how can I extract all files/contents of tar-data.jason Or my entire approach is wrong?


(Timgriffiths) #2

why not just use docker history <imagename>