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] recommend fuse-overlayfs for Debian too #572

Closed

Conversation

AkihiroSuda
Copy link
Contributor

Debian kernel has a non-upstream modprobe option permit_mounts_in_userns=1 for kernel-mode overlayfs, but seems unstable: moby/moby#42302

So we should recommend fuse-overlayfs for Debian (until the release of Debian 12, which will support genuine kernel-mode overlayfs with kernel >= 5.11).

@AkihiroSuda AkihiroSuda force-pushed the recommend-fuse-overlayfs branch 2 times, most recently from 72715a8 to bf951a1 Compare August 28, 2021 17:41
@AkihiroSuda

This comment has been minimized.

Debian kernel has a non-upstream modprobe option `permit_mounts_in_userns=1`
for kernel-mode overlayfs, but seems unstable: moby/moby issue 42302

So we should recommend fuse-overlayfs for Debian (until the release of
Debian 12, which will support genuine kernel-mode overlayfs with kernel
>= 5.11).

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
@thaJeztah thaJeztah changed the title recommend fuse-overlayfs for Debian too [master] recommend fuse-overlayfs for Debian too Sep 15, 2021
# because Debian (since 10) and Ubuntu support the kernel-mode rootless overlayfs.
# fuse-overlayfs is recommended for Debian 10 and 11 (kernel < 5.11). Not needed for Ubuntu.
Recommends: slirp4netns (>= 0.4.0),
fuse-overlayfs (>= 0.7.0)
Copy link
Member

Choose a reason for hiding this comment

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

This control file is used for both Debian an Ubuntu; can we make this somehow conditional for Debian only? I recall we had some conditional rule for AppArmor on Debian that I removed in #487 - perhaps a similar rule would work for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Modifying the file with echo ... >> control doesn't look robust. So I'd prefer to recommend fuse-overlayfs unconditionally.

Copy link
Member

Choose a reason for hiding this comment

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

It's creating a .substvars file (not modifying the control file)

@thaJeztah
Copy link
Member

@tianon PTAL; perhaps you have suggestions on how to make this conditional for Debian (but not Ubuntu) in a clean way?

@tianon
Copy link
Contributor

tianon commented Jun 16, 2022

Indeed - the approach that was removed in #487 (override_dh_gencontrol writing into debian/docker-ce-rootless-extras.substvars) is definitely "correct".

Something like this: (untested 😇)

diff --git a/deb/common/control b/deb/common/control
index 0b5ed4a..34de085 100644
--- a/deb/common/control
+++ b/deb/common/control
@@ -94,9 +94,8 @@ Conflicts: rootlesskit
 Replaces: rootlesskit
 Breaks: rootlesskit
 # slirp4netns (>= 0.4.0) is available in Debian since 11 and Ubuntu since 19.10
-Recommends: slirp4netns (>= 0.4.0)
-# Unlike RPM, DEB packages do not contain "Recommends: fuse-overlayfs (>= 0.7.0)" here,
-# because Debian (since 10) and Ubuntu support the kernel-mode rootless overlayfs.
+# fuse-overlayfs is recommended for Debian 10 and 11 (kernel < 5.11). Not needed for Ubuntu.
+Recommends: slirp4netns (>= 0.4.0~), ${fuse-overlayfs:Recommends}
 Description: Rootless support for Docker.
   Use dockerd-rootless.sh to run the daemon.
   Use dockerd-rootless-setuptool.sh to setup systemd for dockerd-rootless.sh .
diff --git a/deb/common/rules b/deb/common/rules
index 9b495e9..50a95da 100755
--- a/deb/common/rules
+++ b/deb/common/rules
@@ -3,6 +3,11 @@
 VERSION ?= $(shell cat engine/VERSION)
 TARGET_ARCH = $(shell dpkg-architecture -qDEB_TARGET_ARCH)
 
+override_dh_gencontrol:
+	# if we're not on Ubuntu, we need to Recommends: fuse-overlayfs in docker-ce-rootless-extras
+	echo 'fuse-overlayfs:Recommends=$(shell dpkg-vendor --is Ubuntu || echo 'fuse-overlayfs (>= 0.7.0~)')' >> debian/docker-ce-rootless-extras.substvars
+	dh_gencontrol
+
 # force packages to be built with xz compression, as Ubuntu 21.10 and up use
 # zstd compression, which is non-standard, and breaks 'dpkg-sig --verify'
 override_dh_builddeb:

(The trailing ~ on the version numbers allows them to be satisfied by backports if necessary too 👍)

@thaJeztah
Copy link
Member

@AkihiroSuda could you have a look at Tianon's suggestion?

@AkihiroSuda
Copy link
Contributor Author

@AkihiroSuda could you have a look at Tianon's suggestion?

Thanks, SGTM, but I haven't tested it

@AkihiroSuda
Copy link
Contributor Author

Debian 12 is shipped with kernel 6.1, so I'm closing this

@AkihiroSuda AkihiroSuda closed this Aug 3, 2023
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

3 participants