From 3d09b7ca4074c30ed109fc97f265d1b7db5fc9e0 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 7 Feb 2023 22:33:51 +0100 Subject: [PATCH] deb, rpm: add /etc/docker directory Previous versions of the engine created this directory as a side-effect of the (legacy) "key.json" file. With the removal of libtrust (and the key.json) file, that directory is no longer created. While the precence of this directory is not needed for the daemon to function, users may expect it to be there, so it there should be no harm in creating it. For scripting purposes, users are still recommended to check if the directory exists or to create it (mkdir -p). This patch adds a .dirs file to create the directory on installation for .deb; https://www.debian.org/doc/manuals/maint-guide/dother.en.html#dirs And adds a %dirs directive for .rpm packages: http://ftp.rpm.org/max-rpm/s1-rpm-inside-files-list-directives.html#S3-RPM-INSIDE-DIR-DIRECTIVE Signed-off-by: Sebastiaan van Stijn (cherry picked from commit bfab8ec65250e162c518b32de8182cbba85f3a16) Signed-off-by: Sebastiaan van Stijn --- deb/common/docker-ce.dirs | 1 + rpm/SPECS/docker-ce.spec | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 deb/common/docker-ce.dirs diff --git a/deb/common/docker-ce.dirs b/deb/common/docker-ce.dirs new file mode 100644 index 0000000000..cf12594fd2 --- /dev/null +++ b/deb/common/docker-ce.dirs @@ -0,0 +1 @@ +/etc/docker diff --git a/rpm/SPECS/docker-ce.spec b/rpm/SPECS/docker-ce.spec index 51dbeb663c..21b7e8a2b8 100644 --- a/rpm/SPECS/docker-ce.spec +++ b/rpm/SPECS/docker-ce.spec @@ -96,12 +96,16 @@ install -D -p -m 0755 /usr/local/bin/docker-init ${RPM_BUILD_ROOT}%{_bindir}/doc install -D -m 0644 engine/contrib/init/systemd/docker.service ${RPM_BUILD_ROOT}%{_unitdir}/docker.service install -D -m 0644 engine/contrib/init/systemd/docker.socket ${RPM_BUILD_ROOT}%{_unitdir}/docker.socket +# create the config directory +mkdir -p ${RPM_BUILD_ROOT}/etc/docker + %files %{_bindir}/dockerd %{_bindir}/docker-proxy %{_bindir}/docker-init %{_unitdir}/docker.service %{_unitdir}/docker.socket +%dir /etc/docker %post %systemd_post docker.service