Daemon configuration and validation
Worked example
This is an offline lesson. Data are fictional and Docker commands are unexecuted. Any optional execution requires an authorized disposable VM, a verified context, synthetic data, restricted access and no external transmission. Do not collect secrets or private output. Treat the worksheet as evidence to analyze, not a script to paste. Before any authorized observation confirm the actual endpoint, object identity, time window and output budget. Do not repair, restart or delete resources during this offline exercise.
Candidate JSON (do not install):{"log-driver":"local","log-opts":{"max-size":"10m","max-file":"3"}}Scenario A: service starts with --log-driver=json-fileScenario B: service has no corresponding flagStaged validation for supported Engine:dockerd --validate --config-file=./candidate.jsonRootful Linux commonly reads /etc/docker/daemon.json; rootless installations and Desktop use different configuration locations or interfaces. First preserve the current configuration and startup options. In A, the same option is supplied in both places, which can prevent the daemon from starting even when the JSON parses. In B, the particular conflict is absent, but other options may still be invalid. The candidate sets defaults for new containers, not a retroactive change to every existing container. dockerd --validate checks the candidate without starting a daemon; a separate review of actual service flags, version support and operational consequences is still required. Plan an approved activation, service health checks and a tested recovery path; reload support is option-specific. Do not copy the candidate over the real configuration in this lab. The supplied model checks duplicate JSON keys and overlap with already-normalized synthetic flag names only. It is not dockerd validation. Run the staged validation command only from the verified fixture directory on a supported authorized Engine; a passing validation does not establish a conflict-free service invocation or safe reload.
Common mistake
Valid JSON does not mean valid Engine settings or a safe restart.
Manual practice
Compare A and B. Use the supplied candidate and local config-review model; identify what the model cannot validate.
Worksheet: lab-fixtures/docker-engine-administration/02-daemon-config/scenario.txt.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Daemon configuration and validation — Knowledge check
Interpret synthetic administration evidence and choose safe maintenance decisions.
A startup flag duplicates a daemon JSON option. What startup risk remains even if JSON parses?
What does dockerd --validate do?
Will a new daemon log-driver default change existing containers automatically?