Comment 5 for bug 1594849

Revision history for this message
Olaf Dietsche (olaf.dietsche) wrote :

It seems, you're right with the final path component in --overlay. This is the absolute path *inside* the container. I looked into nspawn's source code and the options is interpreted as follows

    --overlay=lo1:lo2:up:dest

lo1 and lo2 are lower directories, up is the upper directory in overlayfs terms, and all are absolute host directory paths. dest is the where the overlayfs is mounted inside the container's root directory.

In order to use --overlay, I have to say

    --overlay=/path/to/xenial/usr:/path/to/apache/usr:/path/to/container/usr:/usr

and repeat this for /etc, /bin, /sbin, /lib, /lib64, /var.

So --overlay seems to work, sort of.

Anyway, thank you for pushing me into the right direction. I think, I'll stay with my workaround, overlay mounting the base directories upfront, and then nspawning the container on the resulting root directory.