Skip to content

rootless: support Bottlerocket OS (probably by porting moby/daemon.getUnprivilegedMountFlags()) #3098

@AkihiroSuda

Description

@AkihiroSuda

On Bottlerocket OS, an emptyDir is still mounted with nosuid, nodev, so BuildKit fails to create bind mounts: Options:[rbind ro]}]: operation not permitted.

#3097 (comment)

Probably this can be fixed by porting moby/daemon.getUnprivilegedMountFlags() to containerd/mounts.Mount().

https://github.com/moby/moby/blob/v20.10.17/daemon/oci_linux.go#L420-L470

// Get the set of mount flags that are set on the mount that contains the given
// path and are locked by CL_UNPRIVILEGED. This is necessary to ensure that
// bind-mounting "with options" will not fail with user namespaces, due to
// kernel restrictions that require user namespace mounts to preserve
// CL_UNPRIVILEGED locked flags.
func getUnprivilegedMountFlags(path string) ([]string, error) {

#3097 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions