docker images stored location

Where the Docker images are stored locally?

This tutorial shows how to check where the docker images are stored locally depending on the docker storage driver and based on your operating system.

Where the docker images are stored ?

Open the terminal and run the following command $ docker info

$ docker info
 Debug Mode: false

 Server Version: 18.09.6
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
  Volume: local
  Network: bridge host macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: b34a5c8af56e510852c35414db4c1f4fa6172339
 runc version: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
 init version: fec3683
 Security Options:
   Profile: default
 Kernel Version: 4.19.79+
 Operating System: Debian GNU/Linux 9 (stretch) (containerized)
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 1.949GiB
 Name: cs-6000-devshell-vm-ea287578-f8bb-440d-9448-b06672f20f20
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
 Registry Mirrors:
 Live Restore Enabled: false
 Product License: Community Engine

From the above response you know that docker root directory is /var/lib/docker  (Docker Root Dir: /var/lib/docker). The contents of the docker root directory vary depending on the docker storage driver, it can be aufs or overlay, overlay2, btrfs, devicemapper etc. In our case it is overlay2 (Storage Driver: overlay2).

$ cd /var/lib/docker
$ ls
builder  buildkit  containerd  containers  image  network  overlay2  plugins  runtimes  swarm  tmp  trust  volumes

Note, debian by default it will be overlay2 and in case of RedHats it will be devicemapper. And in some other operating systems or some other distribution of linux it would be different.

The location of docker images  in our case identified using the following linux commands as shown below


$ ls
builder  buildkit  containerd  containers  image  network  overlay2  plugins  runtimes  swarm  tmp  trust  volumes
$ cd image
$ ls
$ cd overlay2
$ ls
distribution  imagedb  layerdb  repositories.json


"[email protected]:ddba4d27a7ffc3f86dd6c2f920f252a1f23a8e76e1297bfa1bc0c45":"sha256:e7d92cdc71feacf907b59182d0df1b911f8a29e8e95d75ca6a99776a"},

Note, repositories.json is a JSON file which contains local image information and the same information can also be view using the following command $ docker images

/var/lib/docker/image/overlay2 $ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
hello-docker        v1                  22f537369297        5 minutes ago       5.59MB
alpine              latest              e7d92cdc71fe        12 days ago         5.59MB

Further Learning


Leave a Reply

Notify of