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
nspawn: overlayfs cannot be the root file system right now #3847
Comments
Hi all, The workaround i found is to use several overlays. My setup is a base fedora image mounted read-only and additional file hierarchy for running the Caddy webserver: /usr/bin/caddy and /etc/Caddyfile.
It works pretty well even if I would really enjoy more help from systemd to share data across images. I see Lennart renamed the bug removing the .nspawn part of it which is the one that interest me the most in this case. I have opened #4634 for this purpose. Cheers, |
Docs says I can do it in this way:
However, I always get this:
On the other hand, If I use I do think this is a bug... |
Note that if you mount/umount the overlay manually as root filesystem and start the container there it works fine (of course - that's a work around until this works in systemd-nspawn) |
Just my 2¢, I'm using systemd-230 and overlays to build multiple containers on top of base OS image. Base image and containers live in
At the same time,
The only remaining option was to mount overlays manually. Since my
or via
Of course this should be repeated for each remaining machine. I hope one day |
Fix in #11243 |
Sorry if I misinterpreted this, but is this 100% fixed? From the docs changes: |
@shuhaowu have you found an answer to this? I still can't do |
Moving Lines 3469 to 3479 in a0b7f19
Before Lines 3399 to 3407 in a0b7f19
enables succesfully mounting with a root overlay (currently
Can you give me any pointers on a good way to fix this? I'm assuming moving the We could simply special case custom mounts to root and have them happen before marking everything as |
I finally figured this out completely: When working with directories, the root directory is always bind-mounted first before handling all the other mount stuff. The current difference between After overmounting all Simply marking the underlying mount |
Is this actually fixed though @poettering? I know this is old, but not sure if you/someone-involved would see this, and I'm not sure it would warrant opening a new issue. Over the past week, I've done some testing with overlay buildouts (just started getting into containers over the past week), and while I could use it fine using the Overlay Structure:
With that, I could:
and that would work fine (as far as I can tell so far). But now using the
Using As mentioned earlier in the thread, I could just manually mount the overlays and have an |
the great feature of
--overlay=
overlay fs supporthttps://www.freedesktop.org/software/systemd/man/systemd-nspawn.html
somehow does not allow to utilize generated overlay stack as container root fs mount
(we tried many different things, nothing works for us)
additionally overlay fs support is missing from
machine.nspawn
https://www.freedesktop.org/software/systemd/man/systemd.nspawn.html
so the request is to 2-fold
a) support overlay as root fs
b) control overlay settings from *.nspawn
The text was updated successfully, but these errors were encountered: