-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
RFE: supporting adding new bind mounts on existing containers #1320
Comments
I think temporary mounts would be doable - temporarily mount a new directory into a container. Permanent is more troublesome - everything in libpod is built on the assumption that the core configuration of a container is immutable. |
@jlebon So you want a mount point to suddenly appear inside of the container image? podman bind-mount my-running-container /var/lib/foobar:/var/lib/foobar:Z,ro,rshared Would nsenter -m into the continers mount namespace and bind mount the host directory on top of the containers directory? Relabel /var/lib/foobar to work with the SELinux label |
I think restricting this to temporary mounts is totally reasonable. My workflow right now is that I have a helper script that spawns a new pet container if it doesn't already exist, or just resumes it if it does. So permanent modifications means modifying that launch script for the next time I recreate the container. The
Yes, exactly! |
@mheon Any more thoughts on implementing this? |
I think we'd want to do this as part of |
@jlebon Do you still need this or is the nsenter suggestion good enough? |
The |
While the original RFE still holds, let me describe the hack that Toolbox uses to somewhat ameliorate this. It lets older containers pick up newer bind mounts added in successive Toolbox releases. (The original idea comes from Colin Walters.) There are two main things: First, Toolbox uses Second, when creating a container, Toolbox places itself as the entry-point:
The However, the illusion will be shattered if we need to bind mount something that's not already present in |
E.g. something like
podman bind-mount my-running-container /host/path:/cnt/path
. This is really useful if you've got a pet container with a lot of state and would rather not rebuild it.I've been able to do this in the past with docker containers using
nsenter
as described here though it'd be great if there was a built-in command to handle this.The text was updated successfully, but these errors were encountered: