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

Improvements to the mount handling and the child process env #3

Open
DavideCanton opened this issue Jan 12, 2025 · 0 comments
Open

Comments

@DavideCanton
Copy link

Hi, thanks for your great tutorial.

I have some suggestions (already implemented in my version of the code, that you can find here).

The child process env is not initialized (PATH, HOME and TERM are missing, for example). Setting PATH allows the basic commands to be executed if /usr, /lib and /lib64 are mounted. This also removes the need of copying commands in the mount point, it's enough to pass the full path to the command in the command (/usr/bin/bash for example) and mounting the three folders mentioned.

I also added two separate switches for mounting readonly and readwrite mount points differently.

Regarding clearing the mount point, I added an identifier field for the container, that is used when creating the temporary mount point, in a way that the parent container can clean itself on exit.

Last, I added some code for chowning the mount points so that the user that runs internally the container is the owner of the root and the additional rw mount points. This may be improved by leaving 0 as the owner of the root and creating the home folder for the user, but I had not much time to add that feature too.

HTH :)

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

1 participant