Whats the difference between running docker in daemon mode vs systemctl start docker?

Viewed 742

What is the difference between starting the docker daemon using dockerd and systemctl start docker. When would you use one over the other?

1 Answers

A list that is probably not comprehensive:

  • You can configure systemd to run docker when your system boots (systemctl enable docker).
  • If you start the service using systemd, you can ask systemd whether or not it's running (systemctl status docker), and the answer is authoritative (compared to running something like ps | grep dockerd, which can return false positives).
  • If you start the service using systemd, systemd can automatically restart it if it fails.
  • When running the service under systemd, output to stdout/stderr is gathered in the system journal so you can find it via journalctl -u docker.
  • The systemd unit may apply resource limits that improve the behavior of dockerd (e.g., removing the limits on number of files, number of processes, etc)
Related