docker.service 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. [Unit]
  2. Description=Docker Application Container Engine
  3. Documentation=https://docs.docker.com
  4. After=network-online.target docker.socket firewalld.service containerd.service time-set.target
  5. Wants=network-online.target containerd.service
  6. Requires=docker.socket
  7. [Service]
  8. Type=notify
  9. # the default is not to use systemd for cgroups because the delegate issues still
  10. # exists and systemd currently does not support the cgroup feature set required
  11. # for containers run by docker
  12. ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
  13. ExecReload=/bin/kill -s HUP $MAINPID
  14. TimeoutStartSec=0
  15. RestartSec=2
  16. Restart=always
  17. # Note that StartLimit* options were moved from "Service" to "Unit" in systemd 229.
  18. # Both the old, and new location are accepted by systemd 229 and up, so using the old location
  19. # to make them work for either version of systemd.
  20. StartLimitBurst=3
  21. # Note that StartLimitInterval was renamed to StartLimitIntervalSec in systemd 230.
  22. # Both the old, and new name are accepted by systemd 230 and up, so using the old name to make
  23. # this option work for either version of systemd.
  24. StartLimitInterval=60s
  25. # Having non-zero Limit*s causes performance problems due to accounting overhead
  26. # in the kernel. We recommend using cgroups to do container-local accounting.
  27. LimitNPROC=infinity
  28. LimitCORE=infinity
  29. # Comment TasksMax if your systemd version does not support it.
  30. # Only systemd 226 and above support this option.
  31. TasksMax=infinity
  32. # set delegate yes so that systemd does not reset the cgroups of docker containers
  33. Delegate=yes
  34. # kill only the docker process, not all processes in the cgroup
  35. KillMode=process
  36. OOMScoreAdjust=-500
  37. [Install]
  38. WantedBy=multi-user.target