Skip to content

Bind mount of the top binary directory cause hardlinking to fail #9

Closed
@flx42

Description

@flx42

NVIDIA/nvidia-docker#562

Easiest repro:

$ docker run --runtime=runc -ti nvidia/cuda:9.0-base ln /usr/bin/find /usr/myfind
$ docker run --runtime=nvidia -ti nvidia/cuda:9.0-base ln /usr/bin/find /usr/myfind
ln: failed to create hard link '/usr/myfind' => '/usr/bin/find': Invalid cross-device link

Comes from this code:

/* Bind mount the top directory and every files under it with read-only permissions. */
if (xmount(err, path, path, NULL, MS_BIND, NULL) < 0)
goto fail;

I feel this call should be better documented, I know there was a good reason for doing that, but I don't remember it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions