Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

function of docker directory structure in /var/lib/docker/

Tags:

docker

when I start a fresh docker daemon, the docker directory is as this:

/var/lib/docker/
├── aufs
│   ├── diff
│   ├── layers
│   └── mnt
├── containers
├── graph
├── init
│   └── dockerinit-0.7.3
├── linkgraph.db
├── lxc-start-unconfined -> /usr/bin/lxc-start
├── repositories-aufs
└── volumes

as the title say, what is the function of every directory in this structure?

like image 956
xdays Avatar asked Jan 09 '14 09:01

xdays


People also ask

What are the 3 different directories in var lib Docker aufs?

The /var/lib/docker/aufs directory points to three other directories: diff, layers and mnt. Image layers and their contents are stored in the diff directory.

What is the structure of Docker?

Docker architecture. Docker uses a client-server architecture. The Docker client talks to the Docker daemon, which does the heavy lifting of building, running, and distributing your Docker containers. The Docker client and daemon can run on the same system, or you can connect a Docker client to a remote Docker daemon.

What is Docker working directory?

The WORKDIR command is used to define the working directory of a Docker container at any given time. The command is specified in the Dockerfile. Any RUN , CMD , ADD , COPY , or ENTRYPOINT command will be executed in the specified working directory.

What does var lib Docker contain?

Docker data architecture and persistent storage On a linux system, docker stores data pertaining to images, containers, volumes, etc under /var/lib/docker. When we run the docker build command, docker builds one layer for each instruction in the dockerfile. These image layers are read-only layers.


1 Answers

I don't know the exact role of all files, so I'll start with this, and let others add their own contribution, or refine mine:

/var/lib/docker/
├── aufs                                       # Storage area for AUFS driver
│   ├── diff                                   # Branch directory of layer
│   ├── layers                                 # Infomation about docker layer
│   └── mnt                                    # Mount point of aufs, root of containers
├── containers                                 # Container configurations
│                                                (both LXC and Docker-specific)
├── graph                                      # Storage for the images
├── init
│   └── dockerinit-0.7.3                       # Used as /sbin/init in containers
├── linkgraph.db                               # SQLite database storing links
│                                                and names.
├── lxc-start-unconfined -> /usr/bin/lxc-start # When starting a privileged
│                                                container, this is used in
│                                                lieu of lxc-start, to evade
│                                                AppArmor confinement (which
│                                                matches by exact path).
├── repositories-aufs                          # repository infomation
└── volumes                                    # Storage for "anonymous" volumes
                                                 (those which are not bind-mounts)
like image 178
3 revs, 2 users 92% Avatar answered Oct 26 '22 14:10

3 revs, 2 users 92%