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

"root": { "readonly": true } not fully honoured #1670

Open
olifre opened this issue Dec 8, 2017 · 1 comment
Open

"root": { "readonly": true } not fully honoured #1670

olifre opened this issue Dec 8, 2017 · 1 comment

Comments

@olifre
Copy link

olifre commented Dec 8, 2017

Running a rootless container and specifying a mounts section with a destination which does not yet exist in the rootfs, an mkdir of the missing bind mount point is performed.

Example for a read-only FS:

$ runc --root /tmp/runc run somefun
container_linux.go:262: starting container process caused "process_linux.go:339: container init caused \"rootfs_linux.go:57: mounting \\\"/var/tmp/olifre\\\" to rootfs \\\"/home/olifre/singularity/ubuntu_ro\\\" at \\\"/home/olifre/singularity/ubuntu_ro/beegfs\\\" caused \\\"mkdir /home/olifre/singularity/ubuntu_ro/beegfs: read-only file system\\\"\""

If the FS was not really read-only, a directory would be created (and never cleaned up).

@cyphar
Copy link
Member

cyphar commented Dec 8, 2017

Note there would be an error in either case then (just the error would happen when runc noticed that the bind-mount is to a non-existent path). In addition, "readonly": true refers to the final setup of the container, not the context in which it was started.

But we have previously made changes to work better with containers started on a read-only root filesystem (such as #1125).

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

No branches or pull requests

2 participants