Skip to content

recursive read-only (RRO) mount: support the Docker v25 form #2651

Closed

Description

@AkihiroSuda

nerdctl/README.md

Lines 211 to 215 in 4299deb

## Features implemented in `nerdctl` ahead of Docker
- Recursive read-only (RRO) bind-mount: `nerdctl run -v /mnt:/mnt:rro` (make children such as `/mnt/usb` to be read-only, too).
Requires kernel >= 5.12.
The same feature was later introduced in Docker v25 with a different syntax. nerdctl will support Docker v25 syntax too in the future.

Docker v25 attempts to apply RRO by default for read-only mounts with runc >= v1.1, kernel >= v5.12.
The behavior is customizable with bind-recursive option for --mount (not for -v).

See:

Activity

  1. AkihiroSuda commented on Nov 21, 2023

    @AkihiroSuda
    MemberAuthor
  2. thaJeztah commented on Nov 22, 2023

    @thaJeztah
    Member

    Hope I didn't make life hard on you, removing the boolean format ❤️ (I was looking at it again, and thought "now" is the moment to still change it; and it's easier to add back later, than to ship it and remove later).

  3. AkihiroSuda commented on Jul 1, 2026

    @AkihiroSuda
    MemberAuthor

    case "bind-recursive":
    // bind-recursive is the Docker option that supersedes bind-nonrecursive.
    valS := value
    // Allow boolean as an alias to "enabled" or "disabled"
    if b, err := strconv.ParseBool(valS); err == nil {
    if b {
    valS = "enabled"
    } else {
    valS = "disabled"
    }
    }
    switch valS {
    case "enabled":
    bindNonRecursive = false
    case "disabled":
    bindNonRecursive = true
    default:
    // TODO: support "writable", "readonly"
    return nil, fmt.Errorf("invalid value for %s: %s (must be \"enabled\" or \"disabled\")", key, value)
    }

    It also has to support bind-recursive=(readonly|writeonly)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions