Docker 0.9: introducing execution drivers and libcontainer
blog.docker.io
blog.docker.io
idea implementation tools/libs (userspace)
----------- -----------
database mysql
postgres
linux containers LXC (LinuX Containers)
libvert
libcontainer
lmctfy
ps. personally, I think Docker is headed in the right direction by developing libcontainer. Docker will have much more control over their own destiny, by using their own library, which implements the linux containers idea.[1] http://en.wikipedia.org/wiki/Operating_system%E2%80%93level_...
Updated: s/theory/idea/
There is no "theory" of Linux containers. It's bound to the implementation of Linux. FreeBSD jails are another, earlier, completely separate implementation of the same idea.
Your analogy conflates the separate issues of abstraction vs implementation and kernel vs user space, which just confuses matters.
> There is no "theory" of Linux containers. It's bound to the implementation of Linux. FreeBSD jails are another, earlier, completely separate implementation of the same idea.
I think you have just hit upon my point re: FreeBSD jails are another, earlier, completely separate implementation of the same idea.
libcontainer is a native golang library for accessing all of the linux namespace and cgroup features of the linux kernel.
lxc is a project that bundles the namespace and cgroup isolation features of the linux kernel into a simple set of command line utilities.
Both are not "implementations of an idea". They are abstractions ontop of the kernel features.
Edit:
For the parent, s/Libvert/libvirt/. It is a virtualization abstraction library written by Dan Berrange and the Redhat crew.
The word I used is 'goal' or 'requirement'. Virtualisation is not an end in itself.
The point of virtualisation is isolation. It is not totally successful in that and it is certainly not the only way to get some isolation.
I've been meaning to put together a list of various approaches in a heirarchy of levels.
It would look something like
* threads
* processes
* users
* 'virtual' ips
* chroot
* jails
* namespaces (same kernel)
* kernels (same machine)
* hardware (same data centre)
These are not linear or orthogonal of course.This reeks of bad choices. If they really think libcontainer is the way to go, IMO they should commit to it fully and make it a 1.0. I don't see a reason that docker needs to support multiple paths to a handful of syscalls, especially at this fairly-immature point in its evolution.
Adoption.
The priorities of Docker 1.0 are production quality and first class support of all major operating systems. Today, that means first-class support of lxc (because lots of Ubuntu users depend on specific lxc configurations) and first-class support of either systemd or libvirt (because lots of Red Hat users depend on specific systemd or libvirt configurations).
From the strict point of view of surface area and reliability, you're right, it would be better if we exposed a tiny core with no possible customization. But then nobody would use Docker in the first place and there would be no Docker ecosystem, making its quality irrelevant.
The way we resolve this is by 1) exposing lots of APIs to allow better customization, while 2) shrinking the core and making it more reliable. Over time this allows us to converge towards higher quality, without sacrificing adoption. It's a delicate balance, but a necessary one and ultimately I think everybody is better off.
Now, Docker is no longer LXC only. I guess the use of SSH - as a means to login to the container for one-off debugging, inspection and administrative work - is still justified.
That should offer a robust alternative to ssh.
While we're at it we will also fix the "pid 1" problem described in the phusion blog post (I would argue it's the most useful and constructive contribution in that blog post).
Specifically, when a process runs as pid=1, it can't be killed by SIGKILL. It can only be affected by signals it explicitly chooses to handle. This is enforced by the kernel to prevent /sbin/init from being accidentally killed. And it is enforced in all namespaces, so that /sbin/init can be run inside a container and behave the usual way. Unfortunately this means that the same rules apply to a regular app (say, a python script) when it runs as pid 1, even though it is not programmed to handle these rules.
In short, regular applications don't expect to be pid 1, and generally speaking they shouldn't. The future version of the libcontainer and lxc drivers should both fix that.
This can be used for docker, lxc, libvirt-lxc or nspawn.
Like shykes said, this functionality should make it into docker soon.
Any plans on making that into a separate repo? I thought that would be more community friendly and easier to envolve.
In addition, dokcer/pkg/netlink [0] seems to be a package that others can use as well. Also, any plans on adding IPv6 support to that [1] or is pull requests for that welcomed?
[0] https://github.com/dotcloud/docker/tree/master/pkg/netlink
[1] https://github.com/dotcloud/docker/blob/master/pkg/netlink/n...
You can most certainly use netlink in the same way and we'd love a PR for IPv6 support for it!
import "github.com/dotcloud/docker/pkg/libcontainer" import "github.com/dotcloud/docker/pkg/netlink"
My feeling was since LXC is already 1.0 and almost production ready, it would have been better to integrate its features in docker to make it production ready with one of the major enhancement of unpriviledged containers.
Now libcontainer as it is re-inventing the wheels, what's being done by LXC, will require a long path towards stability similar to LXC 1.0.
Moreover docker team should have spend more time building other drivers similar to LXC for OpenVZ or Solaris and BSD zones. Anyways I am not doing any code contribution so do not know the priority of the docker team. But this seem more sensible to me. Just my two cents.
> Docker out of the box can now manipulate namespaces, control groups, capabilities, apparmor profiles, network interfaces and firewalling rules – all in a consistent and predictable way, and without depending on LXC or any other userland package. This drastically reduces the number of moving parts, and insulates Docker from the side-effects introduced across versions and distributions of LXC.
Does this mean Docker is no longer tied to Ubuntu, merely to any sufficiently modern Linux kernel? The install instructions still recommend Ubuntu.
Obviously it's a lot heavier than a container-like system though.
[1] http://www.techrepublic.com/blog/windows-and-office/get-star...
Nice job on the container work though, that will be really useful.
I agree 0.10 might be confusing to people... But we had a discussion about it on #docker-dev and the conclusion was that in doubt, following the model set by Linux couldn't be that bad. The most important thing, I think, is to be consistent and stay the course over many releases. That should do more to reassure people than any particular choice of versioning scheme, I think.
Am I correct in thinking that lib container is not root safe (where LXC 1.0 was)? If so, could you tell me when you think root safety will be re-introduced?
I realise that I can use LXC, however I'm interested in libcontainer.
This is really an issue abandoning a production quality LXC 1.0 code and re-writing it from scratch. This is NIH syndrome.