Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[master] deb, rpm: add /etc/docker directory #841

Merged
merged 1 commit into from Feb 7, 2023

Conversation

thaJeztah
Copy link
Member

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.

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

@thaJeztah
Copy link
Member Author

cherry-pick in #842

rumpl
rumpl previously approved these changes Feb 7, 2023
@neersighted
Copy link
Member

I'm fine with this, I also don't think that this should necessarily be a known issue on 23.0.0. Users should not count on these folders being present, especially as other install methods (aka not the packages) exist.

That being said, seems harmless to bring in, and we can give it a line item in the next patches on the 23.0 branch.

neersighted
neersighted previously approved these changes Feb 7, 2023
@neersighted
Copy link
Member

tianon
tianon previously approved these changes Feb 7, 2023
Copy link
Contributor

@tianon tianon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (although I also agree 100% that anyone scripting anything with this should start with sudo mkdir -p /etc/docker)

@thaJeztah
Copy link
Member Author

sigh.. looks like CentOS 7 rpms don't like it (could be a RPM version issue, or possibly RPMs need a different directive to create it);

Processing files: docker-ce-0.0.0~20230206134438.f42e1ad-0.el7.aarch64
error: Directory not found: /root/rpmbuild/BUILDROOT/docker-ce-0.0.0~20230206134438.f42e1ad-0.el7.aarch64/etc/docker
    Directory not found: /root/rpmbuild/BUILDROOT/docker-ce-0.0.0~20230206134438.f42e1ad-0.el7.aarch64/etc/docker

@thaJeztah
Copy link
Member Author

okay; all rpms don't like it..

back to reading docs / specs 😞

@neersighted
Copy link
Member

okay; all rpms don't like it..

back to reading docs / specs 😞

You still need to create the folder with mkdir, %files is a manifest but does not imply creating anything.

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 <github@gone.nl>
Comment on lines +99 to +101
# create the config directory
mkdir -p ${RPM_BUILD_ROOT}/etc/docker

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like just mkdir -p in the %install section is the way to go, but if others know a more idiomatic approach, let me know 😅

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the correct idiom, and how you customize ownership/permissions 👍

@thaJeztah
Copy link
Member Author

although I also agree 100% that anyone scripting anything with this should start with sudo mkdir -p /etc/docker

Agreed; I added a line to the commit message as well on that

@thaJeztah
Copy link
Member Author

Nice! CI gods are happy now 👍

@thaJeztah thaJeztah merged commit ef137ac into docker:master Feb 7, 2023
@thaJeztah thaJeztah deleted the add_etc_docker branch February 7, 2023 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants