Add support for reloading daemon configuration through systemd #22446
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
- What I did
Updated the systemd unit file to allow reloading the daemon configuration;
This adds support for reloading the docker daemon
(SIGHIUP) so that changes in '/etc/docker/daemon.json'
can be loaded at runtime by reloading the service
through systemd ('systemctl reload docker')
Before this change, systemd would output an error
that "reloading" is not supported for the docker
service;
After this change, the docker daemon can be reloaded
through 'systemctl reload docker', which reloads
the configuration;
- How I did it
By adding an
ExecReloadline to the unit file- How to verify it
on a host with docker installed and running systemd:
install docker on a system that uses systemd
update
/lib/systemd/system/docker.servicewith the changes in this PRreload the unit file;
systemctl daemon-reloadcheck the output of
docker infothere should be no "labels"
create
/etc/docker/daemon.json, and edit it to look like this:reload the daemon;
systemctl reload dockercheck the output of
docker infothe labels are set on the daemon, and visible as part of
docker info;- Description for the changelog
Add support for reloading the daemon configuration file (daemon.json) through systemd
- A picture of a cute animal (not mandatory but encouraged)