systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: inactive (dead)
TriggeredBy: ● docker.socket
Docs: https://docs.docker.com
.
.
cat /lib/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service containerd.service
Wants=network-online.target
Requires=docker.socket
Wants=containerd.service
[Service]
Type=notify
$ the default is not to use systemd for cgroups because the delegate issues still
$ exists and systemd currently does not support the cgroup feature set required
$ for containers run by docker
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutSec=0
RestartSec=2
Restart=always
$ Note that StartLimit* options were moved from “Service” to “Unit” in systemd 229.
$ Both the old, and new location are accepted by systemd 229 and up, so using the old location
$ to make them work for either version of systemd.
StartLimitBurst=3
$ Note that StartLimitInterval was renamed to StartLimitIntervalSec in systemd 230.
$ Both the old, and new name are accepted by systemd 230 and up, so using the old name to make
$ this option work for either version of systemd.
StartLimitInterval=60s
$ Having non-zero Limit*s causes performance problems due to accounting overhead
$ in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
$ Comment TasksMax if your systemd version does not support it.
$ Only systemd 226 and above support this option.
TasksMax=infinity
$ set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
$ kill only the docker process, not all processes in the cgroup
KillMode=process
OOMScoreAdjust=-500
[Install]
WantedBy=multi-user.target
.
.
.
.
After 3-4 minutes
.
.
systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2024-02-26 13:09:11 UTC; 8s ago
TriggeredBy: ● docker.socket
Docs: https://docs.docker.com
Main PID: 1981 (dockerd)
Tasks: 15
Memory: 105.8M
CGroup: /system.slice/docker.service
└─1981 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
Feb 26 13:09:09 dcs dockerd[1981]: time=“2024-02-26T13:09:09.175038215Z” level=info msg="Removing stale sandbox 5ab530eb3fd387ed0d79c9c455c38aa1f180df4f0c8aab16fb36e72c0e8c70a7 (20a5a62c88269fcd4c4a870daf0>
Feb 26 13:09:09 dcs dockerd[1981]: time=“2024-02-26T13:09:09.185577663Z” level=warning msg="Error (Unable to complete atomic operation, key modified) deleting object [endpoint 4b4dcd194907162f0f4998d95e3f4>
Feb 26 13:09:09 dcs dockerd[1981]: time=“2024-02-26T13:09:09.210214040Z” level=info msg="Removing stale sandbox ff3766f94fb4ad55ad7e17ab76a5711f854e7bdfd49e057c2911bbbc74d144b9 (1e76ad364e19b35d5ccc005d6e1>
Feb 26 13:09:09 dcs dockerd[1981]: time=“2024-02-26T13:09:09.215685768Z” level=warning msg="Error (Unable to complete atomic operation, key modified) deleting object [endpoint 4b4dcd194907162f0f4998d95e3f4>
Feb 26 13:09:09 dcs dockerd[1981]: time=“2024-02-26T13:09:09.341047506Z” level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a pref>
Feb 26 13:09:11 dcs dockerd[1981]: time=“2024-02-26T13:09:11.674037594Z” level=info msg=“Loading containers: done.”
Feb 26 13:09:11 dcs dockerd[1981]: time=“2024-02-26T13:09:11.738783528Z” level=info msg=“Docker daemon” commit=“24.0.5-0ubuntu1~20.04.1” graphdriver=overlay2 version=24.0.5
Feb 26 13:09:11 dcs dockerd[1981]: time=“2024-02-26T13:09:11.741402743Z” level=info msg=“Daemon has completed initialization”
Feb 26 13:09:11 dcs systemd[1]: Started Docker Application Container Engine.
Feb 26 13:09:11 dcs dockerd[1981]: time=“2024-02-26T13:09:11.871651329Z” level=info msg=“API listen on /run/docker.sock”