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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[25.0 backport] plugin: fix mounting /etc/hosts when running in UserNS #47588

Merged
merged 2 commits into from Mar 19, 2024

Commits on Mar 19, 2024

  1. plugin: fix mounting /etc/hosts when running in UserNS

    Fix `error mounting "/etc/hosts" to rootfs at "/etc/hosts": mount
    /etc/hosts:/etc/hosts (via /proc/self/fd/6), flags: 0x5021: operation
    not permitted`.
    
    This error was introduced in 7d08d84
    (`dockerd-rootless.sh: set rootlesskit --state-dir=DIR`) that changed
    the filesystem of the state dir from /tmp to /run (in a typical setup).
    
    Fix issue 47248
    
    Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
    (cherry picked from commit 762ec4b)
    Signed-off-by: Pawe艂 Gronowski <pawel.gronowski@docker.com>
    AkihiroSuda authored and vvoland committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    7ed7e6c View commit details
    Browse the repository at this point in the history
  2. daemon: move getUnprivilegedMountFlags to internal package

    This code is currently only used in the daemon, but is also needed in other
    places. We should consider moving this code to github.com/moby/sys, so that
    BuildKit can also use the same implementation instead of maintaining a fork;
    moving it to internal allows us to reuse this code inside the repository, but
    does not allow external consumers to depend on it (which we don't want as
    it's not a permanent location).
    
    As our code only uses this in linux files, I did not add a stub for other
    platforms (but we may decide to do that in the moby/sys repository).
    
    Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
    (cherry picked from commit 7b414f5)
    Signed-off-by: Pawe艂 Gronowski <pawel.gronowski@docker.com>
    thaJeztah authored and vvoland committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    4be9723 View commit details
    Browse the repository at this point in the history