Lab : Docker Storage & Volume Q2

hi @Ayman / @mmumshad

This query is wrt to Q2 of Lab : Docker Storage & Volume .

I am not able to find the required directory name matching under path /var/lib/docker/container
Can you please guide ?

==========================================================================

What folder under /var/lib/docker are the files related to the container alpine-3 image stored?

6fa415a7d24c669c661597853b5ef4f375c86761a2c5d12bfa2550a3a48ed95e
643b9cf496c099293d77cf530ed627c815321d2c22def65ef21cc29071d80a4a
9efacbdbef6e23eac792a6598c510c60af37cff974ec30c416a9ae695063507d

  • info_outline Hint

The directory name is the same as the container id

===============================================================

Terminal Output

$ whoami
root
$
$ pwd
/var/lib/docker
$
$ date
Wed 17 Jun 15:43:06 UTC 2020
$
$ ls -al
total 60
drwx–x–x 15 root root 4096 Jun 17 15:34 .
drwxr-xr-x 44 root root 4096 Sep 3 2019 …
drwx------ 2 root root 4096 Sep 3 2019 builder
drwx------ 4 root root 4096 Sep 3 2019 buildkit
drwx------ 5 root root 4096 Jun 17 15:36 containers
drwx------ 4 root root 4096 Sep 3 2019 image
drwxr-x— 3 root root 4096 Sep 3 2019 network
drwx------ 36 root root 4096 Jun 17 15:36 overlay
drwx------ 3 root root 4096 Sep 3 2019 overlay2
drwx------ 4 root root 4096 Sep 3 2019 plugins
drwx------ 2 root root 4096 Jun 17 15:34 runtimes
drwx------ 2 root root 4096 Sep 3 2019 swarm
drwx------ 2 root root 4096 Jun 17 15:34 tmp
drwx------ 2 root root 4096 Sep 3 2019 trust
drwx------ 2 root root 4096 Sep 3 2019 volumes

$ cd containers/

$ ls
4da4d45f12adfee65748cb17903cb22529db5ea1140e498696c4138a16044b17 9efacbdbef6e23eac792a6598c510c60af37cff974ec30c416a9ae695063507d
938b8f725ac8e3ad21617a8c2c5847e8449072f666b8e45a08f525071bbafe15

$ ls -al
total 20
drwx------ 5 root root 4096 Jun 17 15:36 .
drwx–x–x 15 root root 4096 Jun 17 15:34 …
drwx------ 4 root root 4096 Jun 17 15:35 4da4d45f12adfee65748cb17903cb22529db5ea1140e498696c4138a16044b17
drwx------ 4 root root 4096 Jun 17 15:36 938b8f725ac8e3ad21617a8c2c5847e8449072f666b8e45a08f525071bbafe15
drwx------ 4 root root 4096 Jun 17 15:36 9efacbdbef6e23eac792a6598c510c60af37cff974ec30c416a9ae695063507d
$

======================================================================

Have you did docker inspect ?

Which storage driver supports? docker info?

Hi @ppnehe

For more clarification check the solution below :

docker

hi @Ayman

Thank you for your output .

I tried this lab today and I am getting desired output and checks are passing.

This time I can see when I do the $docker container ls -a I can really see atleast one container_ID starting with 6786.

Can you please identify and help me understand what was my mistake earlier attempt ?
When I did $docker container ls -a why I was not able to find atleast one right answer “container_id” one of the answers to choose from ?

======================================================

skip_next

What folder under /var/lib/docker are the files related to the container alpine-3 image stored?

6fa415a7d24c669c661597853b5ef4f375c86761a2c5d12bfa2550a3a48ed95e
643b9cf496c099293d77cf530ed627c815321d2c22def65ef21cc29071d80a4a
67863d05fa0847d861ca33918dbedb462fc081207ce72d545367f0b31c801eed

  • info_outline Hint

The directory name is the same as the container id

$ pwd
/var/lib/docker/containers
$

$ ls -al
total 20
drwx------ 5 root root 4096 Jun 22 12:56 .
drwx–x–x 15 root root 4096 Jun 22 12:56 …
drwx------ 4 root root 4096 Jun 22 12:56 67863d05fa0847d861ca33918dbedb462fc081207ce72d545367f0b31c801eed
drwx------ 4 root root 4096 Jun 22 12:56 6dc4620c264a6375b3a779dd0e8247c6d24efa9e87c7b048ec943df33c6c578e
drwx------ 4 root root 4096 Jun 22 12:56 f811afc1a4b9084ff6c97595472b4fb67be20f84940b3bd728e43f1e35453ac4
$
$

$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest 2ca708c1c9cc 9 months ago 64.2MB
redis latest 63130206b0fa 9 months ago 98.2MB
alpine latest 961769676411 10 months ago 5.58MB
weaveworks/scope 1.11.4 a082d48f0b39 10 months ago 78.5MB
quay.io/ansible/molecule 2.20 1171569d6ba4 15 months ago 704MB
$
$

$ docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
67863d05fa08 alpine “/bin/sh” About a minute ago Exited (0) About a minute ago alpine-3
f811afc1a4b9 alpine “/bin/sh” About a minute ago Exited (0) About a minute ago alpine-2
6dc4620c264a alpine “/bin/sh” About a minute ago Exited (0) About a minute ago alpine-1
$

$ whoami
root
$
$ date

Mon 22 Jun 13:01:14 UTC 2020
$
$