On-demand activation of Docker containers with systemd

One of the features of systemd is its ability to defer the start-up of networked applications until their services are actually requested, a process referred to as socket activation. This isn't really a new an idea; systemd borrowed the idea from launchd which has been in OS X since Tiger's release in 2005, and the venerable Unix inetd has implemented a simpler version of it since the 1980s. Socket activation has a number of advantages over scripted or event-based start-up systems; in particular it decouples the application start-up order from the service description, and can even resolve circular application dependencies. Docker containers (and other types such as systemd's nspawn or LXC) are almost exclusively network processes, so it would be useful to extend socket activation to them.


Complete story