user1424739
user1424739

Reputation: 13645

Where are docker images stored physically on macos?

The following shows a few locations. https://forums.docker.com/t/where-are-images-stored-on-mac-os-x/17165/4

But I don't see which file correponses to which image. Could anybody show me how to figure out the physical location of each image? Thanks.

$ docker ps  -a
CONTAINER ID        IMAGE                                         COMMAND             CREATED             STATUS                  PORTS               NAMES
a06b2d5530d4        gcc:4.9                                       "bash"              3 days ago          Up 3 days                                   awesome_northcutt
99bfd1b8c105        ubuntu                                        "bash"              3 days ago          Exited (0) 3 days ago                       heuristic_clarke
16a89b2caa3c        ubuntu                                        "/bin/bash"         3 days ago          Exited (0) 3 days ago                       xenodochial_lamarr
3137d54a035d        ubuntu                                        "bash"              8 days ago          Exited (0) 8 days ago                       eager_napier
60714fa75fc4        hello-world                                   "/hello"            8 days ago          Exited (0) 8 days ago                       zen_pare
a78b73509455        hello-world                                   "/hello"            8 days ago          Exited (0) 8 days ago                       adoring_visvesvaraya
b5ea8abe5858        hello-world                                   "/hello"            8 days ago          Exited (0) 8 days ago                       brave_tesla
$ cd $HOME/Library/Containers/com.docker.docker/Data/
$ ls -Rg
.:
total 0
srwxr-xr-x 1 staff   0 Jan  2 19:44 backend.sock
drwxr-xr-x 3 staff  96 Feb 16  2018 database
srwxr-xr-x 1 staff   0 Jan  2 19:44 docker.sock
srwxr-xr-x 1 staff   0 Jan  2 19:44 osxfs.sock
-rw-r--r-- 1 staff   0 Feb 16  2018 task.lock
drwxr-xr-x 6 staff 192 Jan  2 19:44 tasks
drwxr-xr-x 3 staff  96 Jan  2 19:44 vms
srwxr-xr-x 1 staff   0 Jan  2 19:44 vpnkit.diag.sock
srwxr-xr-x 1 staff   0 Jan  2 19:44 vpnkit.eth.sock
srwxr-xr-x 1 staff   0 Jan  2 19:44 vpnkit.pcap.sock
srwxr-xr-x 1 staff   0 Jan  2 19:44 vpnkit.port.sock

./database:
total 0

./tasks:
total 16
-rw-r--r-- 1 staff  235 Jan  2 19:44 com.docker.driver.amd64-linux
-rw-r--r-- 1 staff 1064 Jan  2 19:44 com.docker.hyperkit
-rw-r--r-- 1 staff  343 Jan  2 19:44 com.docker.osxfs
-rw-r--r-- 1 staff 1337 Jan  2 19:44 com.docker.vpnkit

./vms:
total 0
drwxr-xr-x 18 staff 576 Jan  2 19:44 0

./vms/0:
total 7712512
srwxr-xr-x 1 staff           0 Jan  2 19:44 00000002.000005f4
srwxr-xr-x 1 staff           0 Jan  2 19:44 00000002.00001000
srwxr-xr-x 1 staff           0 Jan  2 19:44 00000002.00001001
srwxr-xr-x 1 staff           0 Jan  2 19:44 00000002.0000f3a5
srwxr-xr-x 1 staff           0 Jan  2 19:44 00000003.000005f5
srwxr-xr-x 1 staff           0 Jan  2 19:44 00000003.00000948
-rw-r--r-- 1 staff 63999836160 Jan 11 08:55 Docker.raw
-rw-r--r-- 1 staff      192512 Jan  2 19:44 config.iso
srwxr-xr-x 1 staff           0 Jan  2 19:44 connect
lrwxr-xr-x 1 staff          17 Jan  2 19:44 guest.000005f5 -> 00000003.000005f5
lrwxr-xr-x 1 staff          17 Jan  2 19:44 guest.00000948 -> 00000003.00000948
-rw-r--r-- 1 staff        2304 Jan  2 19:44 hyperkit.json
-rw-r--r-- 1 staff           5 Jan  2 19:44 hyperkit.pid
drwxr-xr-x 2 staff          64 Jan  2 19:44 log
-rw-r--r-- 1 staff          36 Jan  2 19:44 nic1.uuid
lrwxr-xr-x 1 staff          12 Jan  2 19:44 tty -> /dev/ttys184

./vms/0/log:
total 0

Upvotes: 8

Views: 12565

Answers (2)

rohit verma
rohit verma

Reputation: 19

screen ~/Library/Containers//com.docker.docker/Data/vms/0/tty

This command should take you to the required file system of docker on MAC

Upvotes: 1

zhimin
zhimin

Reputation: 3050

Docker does not run natively a Mac because the macOS kernel isn’t compatible (i.e., BSD vs Linux). Docker is actually running in a virtual machine using HyperKit.

And the Docker.raw you listed above is the virtual disk of this virtual machine.

All the docker image is stored inside the virtual machine (in the Docker.raw file), so you can not see them on the Mac filesystem.

Upvotes: 19

Related Questions