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

feature request: pass through switches to nspawn [to allow mounting of directories] #12

Open
tobwen opened this issue May 21, 2020 · 2 comments

Comments

@tobwen
Copy link

tobwen commented May 21, 2020

tl;dr

Would it be possible to allow passing through of nspawn's switches to debspawn?

background

debspawn login allows interaction with the container, f.e. administrative stuff using the --persistent switch. But login doesn't allow to mount a directory from the host. Also, I wasn't able to store any data to the host. Writing to /srv/build inside the container didn't create a file anywhere on the host.

workaround

A hack would be to use debspawn run --build-dir=/opt/here buster /usr/bin/env bash.

benefits

The user could even mount a directory as read-only if it shouldn't be modified during the session.

@ximion
Copy link
Member

ximion commented Aug 8, 2020

I could imagine adding a switch to mount arbitrary directory from outside the container into the container to the login command and possibly run command only. When something is built using build I want the built to be affected by the least amount of parameters from the outside that is possible - when something is built with debspawn, the result should be the same no matter where it was built.
Allowing arbitrary nspawn commands to be forwarded falls into the same category. When adding something, I'd much rather add features selectively.
That being said, I think adding an option to mount arbitrary stuff for login and run is fine, patches welcome! (I'll get to implementing it eventually as time permits, but a dedicated PR is always faster)

@eichin
Copy link

eichin commented Jan 7, 2023

Another use case for external mounts in particular: I was attempting to be clever and use --extra-source-lines to point to a local repo, not realizing that it would (obviously) be interpreting the file:/// path from inside the container.

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

3 participants