Re: Running OSTree disk images in systemd-nspawn



On Tue, 2017-02-07 at 15:32 +0000, Philip Withnall wrote:
I’ve been working recently on some changes to systemd-nspawn to get
OSTree disk images running as containers. This hasn’t previously
worked
with images which use the recommended dracut integration (ostree-
prepare-root and sysroot.mount) as systemd-nspawn doesn’t pivot the
user’s chosen OSTree deployment to / in the container’s file system
namespace.

https://github.com/systemd/systemd/pull/5258

I’ve added a --pivot-sysroot option to systemd-nspawn which does the
pivot root operation from ostree-prepare-root, so that systemd-nspawn
effectively acts as the initramfs for such a disk image.

What do people think?

It’s been merged to systemd master as --pivot-root, and you now have to
specify the /sysroot, i.e.:

sudo systemd-nspawn -i ~/image.raw \
   --bind +/sysroot/ostree/deploy/$os/var:/var \
   --pivot-root /ostree/deploy/$os/deploy/$checksum.0:/sysroot

Commit:

https://github.com/systemd/systemd/commit/b53ede699cdc5

Feedback still welcome, as this hasn’t appeared in a systemd release
yet.

Philip

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]