-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
podman run --rootfs link/to//read/only/dir does not work #5895
Comments
@giuseppe , very sorry for bothering you on this one. Do you know with who is appropriate to discuss this use case? Should we just try to submit a PR? |
hi @siscia. I have already reported the issue for runc some time ago: opencontainers/runc#586 Could you workaround it with a bind mount as suggested in the issue I've linked above? |
Hi @giuseppe :) yes, for my specific use case I can do it. However it would be quite hard to drive adoption if people are forced to create mount points. For us, the problem lies mostly on the read-only limitation, than on the symlink one. I don't know what is the strategy of podman here, but if podman could detect that the filesystem we are trying to use is read-only, it could create an overlay filesystem, and in that one execute runc. This would solve both problems. Do you think that a PR that follow these lines would get accepted? |
that is a good feature for Podman, I agree. I am just not sure about the CLI for exposing it. We could either add a new flag
And one of those arguments could be |
Does this work with crun? |
I see how a smart handle of the Also, the use of a different runtime, might be simpler to sell than teach the correct use of the Thanks for the feedback! |
yes, a symlink in the rootfs path is accepted by crun |
Then I would prefer to switch the OCI Runtime, or get the fix into runc. Don't really want to make podman handle this. |
that is only one part of the issue. The part to handle in podman would be a read only rootfs where we create the overlay on top of it. That is also very useful for using exploded images that can come from any source (really interesting with network file systems) and that we can still use as a base for multiple containers. |
Need to be careful there, since some people might do a And then attempt to run containers on the overlay mounted rootfs. |
Hi @rhatdan I am not sure I understand the concern here. There would be security implication? I mean, I can always figure out where the container filesystem is with the right permission. Are you afraid that people will change the underline filesystem while a container is running? Cheers, |
No security issue, this is more about breakage. Since overlay on Overlay is not supported, Someone doing a podman mount as a readonly mount and then doing --rootfs on it, will fail. |
A friendly reminder that this issue had no activity for 30 days. |
Is there any update on this? |
what issue are you having with rootfs? The same issue as in the original post? |
Yes. I have flat singularity images stored on a cvmfs repo and it cannot start the container with that directory as |
Do you know what inodes is it complaining about. You could add an overlay mount on the rootfs to allow podman to write to it. |
yes the way to work on a read-only file system is through an overlay mount. We are currently working on a better integration between cvmfs and podman so that you won't need to set it up manually (cvmfs/cvmfs#2582). |
@giuseppe We really need to document what inodes need to be present to run a podman on a read/only rootfs. I believe we should be able to work, as long as the necessary inodes are present, even without an overlay. |
the easiest way to make sure all the needed directories/files are present is to run once a container in writeable mode:
The command above will create all the missing directories needed to run the container. After that, it can be used in read only mode, by multiple containers at the same time:
|
Should we document this in the man page on --rootfs? Or elsewhere? |
I am not sure, it looks like a hack to me. |
I don't see it one way or another, I just think we document it and allow people to use --rootfs the way they want. |
Opened docs PR to be able to close this issue. |
Add entry to troubleshooting to document how to setup a read-only rootfs to use with Podman. Fixes: containers#5895 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Many many thanks! |
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind feature
Description
It seems not possible to run a container using the
--rootfs
option when the exploded filesystem is in a read-only directory.I found a couple of issues trying to run a container directly from an exploded (unpacked) filesystem directory.
I believe it is interesting for us to have them sorted, but I would like your feedback first.
The first issues is:
Try to run an unpacked container from a symlink generate an error. The check is implemented in
runc
I am not sure the reasoning why this check was implemented. But it does not seems something too difficult to go around.The error is generate here: https://github.com/opencontainers/runc/blob/4769cdf607b0d1cbd73e5407d9655da7511fe193/libcontainer/configs/validate/validator.go#L75
It would be interesting to understand why this happens and why the check was put in place, however it seems something that we can get around it in podman but passing the real path to runc instead of what we read from the input.
The second error seems more complex:
This issue seems a little more complex and I didn't manage yet to figure out the complete backtrace, but it seems that comes from runc as well. It seems like that the container cannot run if the roofs is in a read-only filesystem.
Is there a reason for this? Can we detect if we are try to run from a read-only filesystem and if we are, mount the filesystem like overlay so to make it writable?
Maybe this is an issue to open agains runc and not podman but after all I am interested that this use case works in podman.
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):The text was updated successfully, but these errors were encountered: