Browse code

Allow fd:// like unix:// and tcp://

Somthing like 20605eb310f0b57bd06eea80ec63c5022fc83bde

Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)

Brandon Philips authored on 2014/01/04 11:07:43
Showing 3 changed files
... ...
@@ -5,7 +5,7 @@ After=network.target
5 5
 
6 6
 [Service]
7 7
 ExecStartPre=/bin/mount --make-rprivate /
8
-ExecStart=/usr/bin/docker -d -H fd://*
8
+ExecStart=/usr/bin/docker -d -H fd://
9 9
 
10 10
 [Install]
11 11
 WantedBy=multi-user.target
... ...
@@ -63,8 +63,8 @@ the ``-H`` flag for the client.
63 63
         # both are equal
64 64
 
65 65
 
66
-To run the daemon with `systemd socket activation <http://0pointer.de/blog/projects/socket-activation.html>`, use ``docker -d -H fd://*``.
67
-Using ``fd://*`` will work perfectly for most setups but you can also specify individual sockets too ``docker -d -H fd://3``.
66
+To run the daemon with `systemd socket activation <http://0pointer.de/blog/projects/socket-activation.html>`, use ``docker -d -H fd://``.
67
+Using ``fd://`` will work perfectly for most setups but you can also specify individual sockets too ``docker -d -H fd://3``.
68 68
 If the specified socket activated files aren't found then docker will exit.
69 69
 You can find examples of using systemd socket activation with docker and systemd in the `docker source tree <https://github.com/dotcloud/docker/blob/master/contrib/init/systemd/socket-activation/>`.
70 70
 
... ...
@@ -17,6 +17,11 @@ func ListenFD(addr string) ([]net.Listener, error) {
17 17
 		return nil, errors.New("No sockets found")
18 18
 	}
19 19
 
20
+	// default to all fds just like unix:// and tcp://
21
+	if addr == "" {
22
+		addr = "*"
23
+	}
24
+
20 25
 	fdNum, _ := strconv.Atoi(addr)
21 26
 	fdOffset := fdNum - 3
22 27
 	if (addr != "*") && (len(files) < int(fdOffset)+1) {