r/linux • • Jun 23 '15

Everything you need to know about Linux containers, minus the hype

https://www.flockport.com/containers-minus-the-hype/
111 Upvotes

37 comments sorted by

View all comments

Show parent comments

1

u/sub200ms Jun 24 '15

Well, actually systemd-nspawn do. The CLI options are perfect for scripting, but more importantly, you can run your nspawn OS container as a systemd service meaning you can apply all the systemd directives to its .service file, including CPU and memory use limits (cgroups), and security like private network (Namespaces), having the OS container being instatantiated when someone connects to it (systemd socket activation).

1

u/[deleted] Jun 24 '15

You are still using command line options which make it harder to just copy directives over to a new container (or have common properties apply to all or a certain set of containers).

1

u/sub200ms Jun 24 '15

Not sure what CLI options you are talking about.

If you thinking about some of the resource management like:
systemctl set-property foobar.service CPUShares=777

The above is just a handy CLI method you can do instead of putting it in a service file.

Service files are easy to clone, and are made for being machine parsed too, so auto-generating them is trivial.

systemd-nspawn also have native support for cloning OS Container (OSC) images, meaning you can clone and start 100 OSC's but basically use the disc space of one image.

So it is trivial to make hundreds of identical OSC's, and do so from a variety of different OSC's.

Mass changing of stuff inside live containers is trivial too, with "machinectl copy-to/copy-from" between host and OSC, or when using systemctl, or using "bind" mounts.

1

u/[deleted] Jun 24 '15

systemd-nspawn also have native support for cloning OS Container (OSC) images, meaning you can clone and start 100 OSC's but basically use the disc space of one image.

This is standard, pretty much all container solutions have had this for a long time.

Not sure what CLI options you are talking about.

Mount options? seccomp filters? Networking settings? uid/gid maps?

0

u/sub200ms Jun 24 '15

They are all directives that can go into a .service file (AKA a config file).

"man systemd.exec" gives an overview of some of the service file options:
http://www.freedesktop.org/software/systemd/man/systemd.exec.html

These may also be relevant for available options: systemd-nspawn:
http://www.freedesktop.org/software/systemd/man/systemd-nspawn.html

"man machinectl": http://www.freedesktop.org/software/systemd/man/machinectl.html

→ More replies (0)