dotcloud/docker — pull request #5593 by alexlarsson (2014-05-05 13:50:11+00:00)
Title: Support unix domain socket paths as exposed port for linking

If you expose a port of the "unix" protocol that like this:

docker run --expose /some/dir/socket_file/unix image

Then the port (/some/dir/socket_file in the above) will be mounted into any container that links to the container. If the socket file does not exist or is not a socket the linked container will fail to start.

This is interesting as it allows containerized version of local services like dbus, nscd, sssd, etc to be used by
other containers with a simple --link option.

Here is an example of using this:
docker run -d --name test --expose /socket/unix fedora dbus-daemon --session --address unix:path=/socket
docker run -t -i --link test:test fedora dbus-monitor --address unix:path=/socket