Commit Graph

538 Commits

Author SHA1 Message Date
David Sheets
799c4f242e Merge pull request #99 from dsheets/transfused-logging
transfused: make sure to flush the logging socket when we die
2016-04-16 18:59:22 +01:00
David Sheets
a2ffa99c25 transfused: make sure to flush the logging socket when we die
Signed-off-by: David Sheets <dsheets@docker.com>
2016-04-16 18:54:48 +01:00
David Sheets
e261a27917 Merge pull request #98 from dsheets/transfused-logging
transfused: push log messages over control channel if available
2016-04-16 18:12:22 +01:00
Dave Scott
bfeffb3d47 Merge pull request #94 from djs55/diagnostics-vsock
diagnostics: bind also on a vsock port
2016-04-16 13:44:39 +01:00
Dave Scott
864ce3b06c Merge pull request #89 from djs55/proxy-vsock
Switch the port forwarding docker-proxy replacement to vsock
2016-04-16 13:44:28 +01:00
David Scott
04c75c6c38 proxy: vendor github.com/djs55/vsock
Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-15 17:43:10 +01:00
David Scott
9e64166554 proxy: move vendor/libproxy to ./libproxy
vendor should be used for things with fully-qualified names,

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-15 17:29:23 +01:00
David Scott
0338d97d94 proxy: calling Close() on the Accept()ing fd won't cause it to return
This seems to be a difference between the AF_VSOCK and AF_INET
implementations. We work around it by exiting the proxy process
immediately, which will clean up resources anyway.

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-15 17:24:56 +01:00
David Scott
c24687e2e1 proxy: fix up the vsock interface
- don't try to create a `FileConn` because the Go library sees through
  the scam and rejects it
- explicitly keep a reference to the `ctl` file just in case the GC
  decides its dead and should be closed.

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-15 17:24:56 +01:00
David Scott
a321da38e5 proxy: tell the /port server the real external IP address
Before this we accidentally told it the vsock address, which obviously
isn't much good.

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-15 17:24:56 +01:00
David Scott
df65441dec proxy: we don't need to explicitly unexposePort any more
The port will be automatically removed when the fd/fid is closed by
a process exit/crash, or by a hypervisor crash.

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-15 17:24:56 +01:00
David Scott
f269d6289b proxy: request a vsock connection rather than a TCP/IP one
Note this means we don't need to figure out our local IP address.

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-15 17:24:56 +01:00
David Scott
e1b0f99b60 proxy: libproxy: add a case for VsockAddr types
The `NewProxy` function already knows how to deal with `net.UDPAddr`
and `net.TCPAddr`, this patch adds similar support for `vsock.VsockAddr`.

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-15 17:24:56 +01:00
David Scott
f7dfb85f57 proxy: vsock connections support CloseRead and CloseWrite
This patch adds a wrapper around the `net.Conn` to include the
`CloseRead` and `CloseWrite` implementations. This patch also
exposes the `VsockAddr` type, which is similar to `TCPAddr` and
`UDPAddr`.

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-15 17:24:56 +01:00
David Scott
ff63efdb1c proxy: remove assumption that frontend is a TCPListener
We require the frontend to be a `net.Listener` and the `net.Conn`
connection which are established must be type-switched to
`Conn` to support the `CloseRead` and `CloseWrite` methods.

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-15 17:24:56 +01:00
David Scott
a3ca812d97 proxy: TCPProxy connects to TCP but can read from other things
The TCPProxy can proxy from anything which satisfies this interface:

type Conn interface {
  	io.Reader
	io.Writer
	io.Closer
	CloseRead() error
	CloseWrite() error
}

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-15 17:24:56 +01:00
David Scott
2ea68b0b3e proxy: add a vsock package based on vsudd
This package supports a more normal Go interface, in particular it has:

  // Listen returns a net.Listener which can accept connections on the given
  // vhan port.
  func Listen(port uint) (net.Listener, error)

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-15 17:24:56 +01:00
David Scott
74be577a0f proxy: simply the Dockerfile by shuffling code under vendor/
Note there is a slight name clash between the final binary 'proxy'
and the library formerly known as 'proxy'. Resolve this by calling
the library 'libproxy'.

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-15 17:24:56 +01:00
Justin Cormack
c52429abbe need not needs
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-04-15 17:24:53 +01:00
David Sheets
6f76ac9627 transfused: push log messages over control channel if available
Also, remove self-logging and triggers.

Signed-off-by: David Sheets <dsheets@docker.com>
2016-04-15 17:11:38 +01:00
David Scott
78c14c5161 diagnostics: listen on both TCP/IP and vsock ports
The TCP/IP port will be used by Windows, while Mac can use the vsock
one.

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-15 17:07:52 +01:00
David Scott
0619d947dd diagnostics: vendor the vsock package
Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-15 17:07:22 +01:00
Justin Cormack
bd5922da5c fix #91 util-linux switch_root errors out, force use of busybox
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-04-15 16:43:36 +01:00
Justin Cormack
91d2e09405 Merge pull request #93 from rneugeba/winupstream
hvtools: Enable CIFS mount/unmount via KVP writes
2016-04-15 16:37:41 +01:00
Rolf Neugebauer
046639c532 hvtools: Enable CIFS mount/unmount via KVP writes
- Trigger a CIFS mount by writing to the "cifsmount" key.
- The value has the format: <mountpoint>;<alias mountpoint>;<options>
  with <options> containing username, password and optional domain
- The key is not stored in the KV store (aka the 'registry')

- Trigger an unmount by writing to the cifsumount" key.
- The value has the format: <mountpoint>;<alias mountpoint>

- The 'registry' is also wiped on reboot

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-04-15 16:32:32 +01:00
Justin Cormack
4cd3d08bdf Merge pull request #92 from djs55/go-diagnostics
moby: rewrite diagnostics server in Go
2016-04-15 16:17:08 +01:00
David Scott
578c037e81 moby: rewrite diagnostics server in Go
This will make it easier to add a vsock interface as well as a regular
TCP/IP one.

As a side-effect, the server is now able to handle more than one concurrent
request!

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-15 16:09:54 +01:00
Justin Cormack
64e2acdab6 Merge pull request #90 from rneugeba/winupstream
Winupstream
2016-04-15 15:49:24 +01:00
Rolf Neugebauer
63908372e2 license: extract hvtools/llmnrd source code from the initrd
Also add modified chronyd init script

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-04-15 15:10:29 +01:00
Rolf Neugebauer
14677a220f alpine: create source tarballs for hvtools and llmnrd
Add them to the initrd under /usr/share/src

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-04-15 15:10:29 +01:00
Rolf Neugebauer
c7f74d54b7 iso: use ubuntu instead of debian to reduce the number of base images
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-04-15 15:10:28 +01:00
Rolf Neugebauer
242a505bc1 shutdown: use poweroff -f instead of halt -f
This is makes fast shutdown work on Hyper-V

While at it, also clean up whitespaces. The file was mixed
tabs and spaces. Now it uses spaces.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-04-15 15:10:28 +01:00
Rolf Neugebauer
5dba8e6584 mdns: re-enable mDNS when running on Hyper-V
If bonjour is installed on the host, e.g. via iTunes or some other
program, a lookup for `docker.local` works just like on the Mac.

Just like with LLMNR there seems to be a 4-5 second delay before
Windows decides to do a multicast namelook up, though

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-04-15 15:10:28 +01:00
Rolf Neugebauer
d4b1dbbf98 chronyd: don't start it when running on Hyper-V
This is a bit ugly as we copied and then modified the chronyd init.d
script as shipped in the package.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-04-15 15:10:28 +01:00
Rolf Neugebauer
c37f276edd hvtools: Fix setting the DNS server when the host reconfigures network
Busybox ifup does not modify /etc/resolv.conf

Update the hv_set_ifconfig script to overwrite /etc/resolv.conf

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-04-15 15:10:28 +01:00
Rolf Neugebauer
87dae50faf hvtools: tweak startup sequence
- Don't start hv_fcopy_daemon. It seems to exit and we are not
  using it anyway. Also, remove it from the initrd

- Move hv_kvp_daemon and hv_vss_daemon to start earlier
  (before networking and docker being started)

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-04-15 15:10:28 +01:00
Rolf Neugebauer
e4cff4a1e1 kernel,initrd: add CIFS to the kernel and cifs-utils to the initrd
Needed to enable SMB/CIFS mounts on Windows hosts

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-04-15 14:51:27 +01:00
Rolf Neugebauer
5f55666718 llmnrd: Add a LLMNR Daemon
LLMNR is the Windows equivalent of mDNS.

Import the LLMNR daemon from https://github.com/tklauser/llmnrd
It needed some small modification to compile cleanly on Moby

LLMNRD is only started when running inside a Hyper-V VM

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-04-15 14:51:10 +01:00
Justin Cormack
ec97879a02 Merge pull request #87 from dave-tucker/util-linux
Add util-linux for K8's
2016-04-15 13:06:32 +01:00
Justin Cormack
5218c65f63 Merge pull request #88 from dsheets/hostsettings-etc-sysctl.conf
hostsettings: correctly install multiline /etc/sysctl.conf files
2016-04-15 10:58:49 +01:00
David Sheets
1082da6d85 hostsettings: correctly install multiline /etc/sysctl.conf files
echo will destroy newlines in arguments.

Signed-off-by: David Sheets <dsheets@docker.com>
2016-04-15 10:57:32 +01:00
Dave Tucker
f7e374a717 Add util-linux for K8's
Signed-off-by: Dave Tucker <dt@docker.com>
2016-04-14 18:27:00 +01:00
David Sheets
bed7341992 Merge pull request #86 from dsheets/transfused-event-stream
transfused: update the event protocol for streaming vsock
2016-04-14 15:07:02 +01:00
David Sheets
8b8bf30eb7 transfused: update the event protocol for streaming vsock
Signed-off-by: David Sheets <dsheets@docker.com>
2016-04-14 14:57:06 +01:00
Dave Scott
f23342b5ce Merge pull request #85 from djs55/docker.1.11.0
Bump docker to 1.11.0 final
2016-04-13 22:52:07 +01:00
David Scott
29146734e5 docker: switch the branch to djs55/moby temporarily
Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-13 22:50:40 +01:00
David Scott
4685b8af9e Bump docker to 1.11.0 final
Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-13 21:43:17 +01:00
Justin Cormack
3ab88ca363 Merge pull request #81 from dsheets/transfused-vsock
transfused: use vsock transport instead of 9p
2016-04-13 14:53:34 +01:00
Justin Cormack
0204af5064 Merge pull request #83 from ijc25/hyperv-sockets
hyperv-socks: Backport patches.
2016-04-13 14:53:01 +01:00
Justin Cormack
dca29bd197 add more dockerignores
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-04-13 11:24:31 +01:00