Ubuntu 16.04 LTS is now available. After having made the switch from 14.04 without really looking at the changes except for the kernel number (4.x), I was pleasantly surprised by the fact that it now uses systemd. Actually I don't remember why I made it. Seems I was trying to setup docker daemon on a cloud instance, and this was a memo of the config inside Container Optimized Machine of Google Cloud. The files located in /usr/lib/systemd/system or /lib/systemd/system contain the default options and should not be edited. Runtime directory and storage driver. You may want to control the disk space used for Docker images, containers and volumes by moving it to a separate partition.
docker.service
[Unit] |
Description=Docker Application Container Engine |
Documentation=https://docs.docker.com |
After=network-online.target firewalld.service |
Wants=network-online.target |
[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 --graph=/var/lib/docker/docker |
ExecReload=/bin/kill -s HUP $MAINPID |
# 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 |
# Uncomment TasksMax if your systemd version supports it. |
# Only systemd 226 and above support this version. |
#TasksMax=infinity |
TimeoutStartSec=0 |
# 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 |
# restart the docker process if it exits prematurely |
Restart=on-failure |
StartLimitBurst=3 |
StartLimitInterval=60s |
[Install] |
WantedBy=multi-user.target |
Vi /usr/lib/systemd/system/docker.service
Docker /usr/lib/systemd Software
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment