18.11.2017

Docker-CE: initial configuration

After installing docker to a ubuntu server i was keen what kind of processes and files are there.
# ps x|grep docker
 5852 ?        Ssl    0:05 /usr/bin/dockerd -H fd://
 5867 ?        Ssl    0:04 docker-containerd --config /var/run/docker/containerd/containerd.toml
So the inital configuration is not stored in /etc.

The configuration file looks like this:
# cat /var/run/docker/containerd/containerd.toml
root = "/var/lib/docker/containerd/daemon"
state = "/var/run/docker/containerd/daemon"
subreaper = false
oom_score = -500

[grpc]
  address = "/var/run/docker/containerd/docker-containerd.sock"
  uid = 0
  gid = 0

[debug]
  address = "/var/run/docker/containerd/docker-containerd-debug.sock"
  uid = 0
  gid = 0
  level = "info"

[metrics]
  address = ""

[cgroup]
  path = ""

[plugins]
  [plugins.linux]
    shim = "docker-containerd-shim"
    runtime = "docker-runc"
    runtime_root = "/var/lib/docker/runc"
    no_shim = false
    shim_debug = false
    shim_no_newns = false
The directory /var/run/docker/containerd/daemon seems to be important, so let's take a look:
# find /var/run/docker/containerd/daemon
/var/run/docker/containerd/daemon
/var/run/docker/containerd/daemon/io.containerd.runtime.v1.linux
/var/run/docker/containerd/daemon/io.containerd.runtime.v1.linux/moby
But theese entries are only directories...

So what about /var/lib? Here we go:
# find /var/lib/docker/ -maxdepth 1
/var/lib/docker/
/var/lib/docker/overlay2
/var/lib/docker/swarm
/var/lib/docker/image
/var/lib/docker/tmp
/var/lib/docker/runtimes
/var/lib/docker/trust
/var/lib/docker/plugins
/var/lib/docker/containerd
/var/lib/docker/containers
/var/lib/docker/builder
/var/lib/docker/volumes
/var/lib/docker/network
Within the directory containers you can find information about the containers which run / ran on your docker system:

# ls -l
insgesamt 12
drwx------ 4 root root 4096 Nov 16 22:12 0c7567bb965449f5f2f3dfadfc38f0226bdb42cc6d46daa4641042090e0405c7
drwx------ 4 root root 4096 Nov 16 22:57 28b7f70147aabc94bd174ce7ad7f5d48ed5610ffaa21733d3549ee6e998ee7c3
drwx------ 4 root root 4096 Nov 16 21:59 2db1c3ed1dafc85369536c382e02b6a23e5d134d2ba3d56a738f3441fb624b04
 The first characters of the directories match the container-id:
# docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                  PORTS               NAMES
28b7f70147aa        hello-world         "/hello"            2 days ago          Exited (0) 2 days ago                       trusting_bartik
0c7567bb9654        hello-world         "/hello"            2 days ago          Exited (0) 2 days ago                       festive_wozniak
2db1c3ed1daf        hello-world         "/hello"            2 days ago          Exited (0) 2 days ago                       epic_tesla


Related posts:

Keine Kommentare:

Kommentar veröffentlichen