skip to content

Which daemon.json changes take effect on a Docker daemon reload, and which need a restart?

level: middleimportance: must knowfreq 60%

answer

  1. Two ways to re-read the config, not one
  2. SIGHUP versus a fresh daemon process
  3. Foundations are fixed at start-up
  4. Registry and debug settings are cheap to change
  5. Restart is container-visible without live-restore

basics

~20 s

A SIGHUP reload re-reads only part of daemon.json — registry mirrors, insecure registries, debug level, labels, live-restore, concurrency limits and runtimes. Structural settings such as storage-driver, data-root and the daemon's listen addresses are read only at start-up and need a full restart.

solid answer

~40 s

`systemctl reload docker` sends `dockerd` a SIGHUP; the daemon re-reads `/etc/docker/daemon.json` and applies the keys that support live reloading — `debug`/`log-level`, `labels`, `registry-mirrors`, `insecure-registries`, `live-restore`, `max-concurrent-downloads`/`max-concurrent-uploads`, `runtimes`/`default-runtime`, `shutdown-timeout` — while leaving every running container alone. Keys that shape the daemon's own foundations are read only at process start: `storage-driver`, `data-root`, the `hosts` it listens on, and the bridge networking options. Changing those means `systemctl restart docker`, which stops running containers unless `live-restore` is enabled; containers with a restart policy come back afterwards. A reload is also not retroactive over containers: a changed default is applied to containers created later, not to ones that already exist. Confirm what actually took effect with `docker info`, and read the daemon's journal — a reload logs what it applied and what it rejected.

code

bash · 4 lines
bash
sudo dockerd --validate
sudo systemctl reload docker
journalctl -u docker --since '2 min ago' --no-pager
docker info --format '{{.RegistryConfig.Mirrors}} {{.LiveRestoreEnabled}}'

go deeper

for a junior

Know that reload and restart are different operations, that reload sends SIGHUP and leaves containers running, and that a restart of the daemon interrupts them. Being able to say which command does which is the bar here.

for a middle

Explain the split by principle: settings handed to new work can be swapped live, settings that define the daemon's storage, sockets and networking cannot. Name a few keys on each side and describe what a reload does not touch.

for a senior

Demonstrate that you verify rather than assume — docker info and the daemon journal as evidence — and that you know a restart is a container-visible event, plus what live-restore does and does not cover.

for a principal

Own when a fleet takes a daemon restart at all: whether hosts are drained first, whether live-restore is standard, and how engine upgrades are sequenced so no service loses every replica at once.

## Two different operations There are two ways to make `dockerd` look at `/etc/docker/daemon.json` again, and they differ in both scope and blast radius. **Reload** is `systemctl reload docker`, which sends the daemon a SIGHUP (you can send it directly with `kill -HUP $(pidof dockerd)`). The daemon stays up, re-reads the configuration file, and applies the subset of settings that it knows how to change in a live process. No container is touched: the engine keeps serving the API throughout and the workloads never notice. **Restart** is `systemctl restart docker`, which stops the daemon process and starts a new one. Everything in the file is read fresh, because the new process is configuring itself from scratch. That is the expensive option: without `live-restore`, stopping the daemon stops the containers it supervises, and when it comes back it starts the ones whose restart policy is `always` or `unless-stopped`. Containers created with `--restart no` stay stopped until someone starts them. ## What reloads The reloadable set is deliberately small — it is the settings the daemon can swap out without rebuilding its own state. In practice it covers: - `debug` and `log-level` — turning daemon debugging on during an incident and off afterwards is the classic use of a reload. - `registry-mirrors` and `insecure-registries` — the daemon's registry client configuration is re-created. - `live-restore` — you can enable it on a live daemon, which matters because it is the setting that makes the *next* restart cheap. - `labels` — engine labels that a scheduler may select on. - `max-concurrent-downloads` and `max-concurrent-uploads` — pull/push parallelism. - `runtimes` and `default-runtime` — registering an alternative OCI runtime. - `shutdown-timeout` — how long the daemon waits for containers on the way down. ## What does not Anything the daemon builds its world on top of is start-up only: - `storage-driver` — the driver is initialised once, against `data-root`, when the daemon starts. - `data-root` — the entire on-disk layout is opened at start-up. - `hosts` — the sockets and addresses the API listens on are bound at start-up. - The bridge networking options (`bip`, the default bridge's address, `iptables`) — the daemon programs the host's networking as it comes up. A reload does not fail loudly on these; the daemon simply keeps running with what it has. That is a classic trap: someone edits `data-root`, runs `systemctl reload docker`, sees no error, and concludes the change is live. `docker info` still prints the old Docker Root Dir, which is the honest answer. ## Reload is not retroactive over containers Even for a key that reloads, the effect is on the daemon, not on containers that already exist. A container's effective configuration — its logging setup, its resource limits, its network attachments — is fixed when it is created. So changing a host-wide default and reloading changes the defaults handed to containers created from that point on. Existing containers must be recreated to pick it up. Restarting a container does not recreate it. ## live-restore, and why it belongs in this conversation `"live-restore": true` tells the daemon to leave running containers alive when it exits, and to re-attach to them when it starts again. It is what turns a daemon restart from an outage into a blip, and it is why an engine upgrade on a busy host is survivable. It has real limits: it does not apply to a host that has joined a swarm, it is intended for patch-level engine upgrades rather than arbitrary version jumps, and while the daemon is down nobody is reading the containers' output — once the buffer between a container and the absent daemon fills, the container's writes block until the daemon returns. `docker logs`, `docker events` and health-check evaluation are also unavailable for the duration. Enabling live-restore is itself reloadable, but it only protects restarts that happen *after* it is on. ## How to check what happened Three habits make this concrete. First, `dockerd --validate` before you apply anything, so a syntax error never reaches a live daemon. Second, `docker info` afterwards, because it prints what the daemon actually adopted rather than what you wrote. Third, the daemon's journal — `journalctl -u docker --since '5 min ago'` — which records the reload and any setting it refused. If you cannot tell from those three whether a change is live, assume it is not. ## The interview shape The question is usually posed as "you changed X, is a restart needed?", and the answer they are listening for is not a memorised list but the principle: settings that the daemon can hand to new work reload, settings that define the daemon's own storage, sockets and networking do not — and a restart is a container-visible event unless live-restore is on.

  • What actually happens to running containers when you restart dockerd without live-restore?
    They are stopped along with the daemon. When the new daemon starts, it restarts containers whose policy is `always` or `unless-stopped` and leaves the rest stopped, so anything created with the default `--restart no` needs a manual start. Applications see a real outage, and any in-flight work is lost, which is why a restart is planned rather than casual.
  • Why does enabling live-restore not protect the very restart during which you enable it?
    Because the setting governs how the *outgoing* daemon shuts down. A daemon that starts without it kills its containers when it exits; the file on disk saying otherwise is irrelevant until a daemon that has read it is the one shutting down. Enabling live-restore is reloadable, so applying it with a SIGHUP first, then restarting later, is the safe order.
  • How do you confirm that a reload actually applied a change rather than silently ignoring it?
    Compare `docker info` before and after — it prints the daemon's effective values, including Registry Mirrors, Insecure Registries, Debug Mode, Storage Driver and Docker Root Dir. Back that with the daemon journal for the reload window, which records what it applied. Never treat the file's contents as evidence that the daemon agreed with it.

saying these in an interview costs you the question

  • Claims every daemon.json key can be applied with a reload
  • Thinks a reload restarts or recreates running containers
  • Expects a storage-driver or data-root change to reload
  • Believes a new default retroactively changes existing containers
  • Restarts the daemon casually on a busy production host
  • Assumes live-restore protects the restart that enables it

context