github.com/Prakhar-Agarwal-byte/moby@v0.0.0-20231027092010-a14e3e8ab87e/contrib/init/systemd/docker.service (about)

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