[systemd-devel] Creating containers from local .raw or tar images

Lennart Poettering lennart at poettering.net
Tue Mar 3 02:43:42 PST 2015


On Mon, 02.03.15 23:50, Erik Johnson (erik at saltstack.com) wrote:

> On Mon, Mar 02, 2015 at 06:03:42PM -0500, Daurnimator wrote:
> >AFAIK, all the pull-* commands do is download into /var/lib/machines.
> >You could easily enough just copy things into there yourself.
> >
> >Or even less work: don't copy them in there at all, and pass your image
> >directly to systemd-nspawn (which is what machinectl uses)
> >See: http://www.freedesktop.org/software/systemd/man/systemd-nspawn.html
> >
> 
> I've done that before, but I am writing nspawn support for SaltStack
> (http://saltstack.com) and I need to start and stop them unattended.

BTW, pretty much everything "machinectl" does is just invoke a couple
of bus calls. If you hack support for nspawn into some software you
can thus call the bus calls directly. More specifically, machinectl is
primarily just a frontend for some calls from machined, others from
importd and finally others from PID 1. Unfortunateky through we
currently have no docs for importd's APIs (it's really new), and
machined's are slightly incomplete (the newer bits are missing). 

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list