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

Support readonly root filesystem #2078

Open
viceice opened this issue Jan 30, 2024 · 8 comments
Open

Support readonly root filesystem #2078

viceice opened this issue Jan 30, 2024 · 8 comments
Labels
breaking Breaking change, requires major version bump priority-2-important User-visible bugs or very important features status:in-progress Someone is working on implementation type:feature Feature (new functionality)
Milestone

Comments

@viceice
Copy link
Member

viceice commented Jan 30, 2024

general

  • /usr/local/bin is symlinked to /opt/containerbase/bin
  • /usr/local/lib is symlinked to /opt/containerbase/lib
  • tool prepare state is stored at /var/lib/containerbase
  • all cache files are stored at /tmp/containerbase
  • files and folders in user home are symlinked to /tmp/containerbase/cache (eg .cache, .npmrc, .npm)

binarySource=global

  • needs /tmp writable

binarySource=install

  • needs /tmp writable
  • needs /opt/containerbase writable

related issues

@viceice viceice added type:feature Feature (new functionality) priority-2-important User-visible bugs or very important features status:ready Ready to start implementation breaking Breaking change, requires major version bump status:in-progress Someone is working on implementation and removed status:ready Ready to start implementation labels Jan 30, 2024
@viceice
Copy link
Member Author

viceice commented Feb 13, 2024

@rarkins There is one more issue! npm always tries to write to ~/.npm/_logs.

@rarkins
Copy link
Member

rarkins commented Feb 13, 2024

It cannot be stopped??

@viceice
Copy link
Member Author

viceice commented Feb 13, 2024

not i'm aware of. i'm now redirecting home to /opt/containerbase/home, see linked PR.

We need to think about the existing data at /opt/containerbase when mounting a volume which will hide all existing. 🤔

@viceice
Copy link
Member Author

viceice commented Feb 14, 2024

I think we need to split installs again.

So when running as root and it's a docker build, then install tools to some other persistent path.
Otherwise all files and prepare information are gone when mounting a volume to /opt/containerbase 🤔

I would add a new containerbase-cli restore command, which recreates all missing folders and files.
It then symlinks the root installed files there, so the layout looks like now.

containerbase-cli restore will be called automatically by the entrypoint script and should be called by custom images with their own entrypoint.

@rarkins WDYT? Can you follow me?

@rarkins
Copy link
Member

rarkins commented Feb 14, 2024

I'm not sure I fully follow, but I guess you mean that when the user mounts a volume to /opt/containerbase then anything we've put there prior is lost. So you're planning to put it in another location and symlink it over whenever the container runs?

@viceice
Copy link
Member Author

viceice commented Feb 14, 2024

Yes, that's the core idea.

When later running install-tool as user it will simply install to /opt/containerbase as now.
I can propably also check and run the containerbase-cli restore command implicit from install-tool when something is missing inside /opt/containerbase.

@rarkins
Copy link
Member

rarkins commented Feb 14, 2024

Would it be a viable alternative to allow the user to configure the containerbase rw location via env variable? If configured then the restore happens from /opt/containerbase otherwise /opt/containerbase is used? Or is it too hard to set up PATH etc?

@viceice
Copy link
Member Author

viceice commented Feb 14, 2024

we can't ensure path then. a user would need to explicit set it 😞

@viceice viceice added this to the v12 milestone May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Breaking change, requires major version bump priority-2-important User-visible bugs or very important features status:in-progress Someone is working on implementation type:feature Feature (new functionality)
Projects
None yet
Development

No branches or pull requests

2 participants