Commit Graph
10 Commits
Author SHA1 Message Date
Matthias Radestock fc9475592d shorten proxy entrypoint
...so that the default output of the likes of `docker ps` shows some
of the real entrypoint/command.

Closes #768.
2015-05-28 06:35:10 +01:00
Paul Bellamy 55d17ba3bf separate proxy package into weaveproxy and proxy 2015-05-19 10:34:46 +01:00
Paul Bellamy 96a69d2303 Add dns support for the proxy
In the proxy, I swapped the 'flag' library for
'code.google.com/p/getopt', which uses double-dash flags.

proxy lets 'weave attach' do dns registration on container start

proxy needs to set DNSSearch if not specified
2015-05-19 10:34:45 +01:00
Paul Bellamy 444b1482fa add weavewait
binocarlos/wait-for-weave is Apache2 licensed, so attribution/etc applies. Thus, we
re-invent the wheel here.
2015-05-19 10:34:45 +01:00
Michael Bridgen 6d7de3ddff Proxy implementation
This adds a docker remote API proxy to the weaveexec image. The proxy
has hooks for (post-) container start and (pre-) container create; the
former attaches a weave interface to a container given a WEAVE_CIDR
environment entry, and the latter adjusts the entrypoint of a container
to wait for the ethwe interface.

Notes:

None of the hooks need to inspect/change large bodies. In order to avoid
a crash when handling images larger than memory we need to ensure that
the entire request body is never loaded into memory (i.e. No
ioutils.ReadAll).

When proxying a raw-stream response, we can't use http.WriteHeader. It
sets the Transfer-Encoding to chunked, which will throw off the clients.
Instead we have to hijack the socket, and write out http status code
manually.

For chunked transfer-encodings, clients (docker-py) depend on each http
chunk containing exactly one JSON object. Therefore, we cannot re-chunk
the body, and have to pass it across verbatim.

Proxy needs to pass multi-cidrs separately when calling weave. Otherwise
they get smashed together on the command line, and the call fails.

When creating the image, if no entrypoint is specified on the container,
it should use the entrypoint of the image. Code for this is based on
powerstrip-weave.

We handle WEAVE_CIDR='' by acting like it is not set. The reason being,
that because WEAVE_CIDR is inherited from images (along with env vars),
setting it to blank is equivalent to unsetting it.
2015-05-19 09:48:12 +01:00
Pradeep Chhetri 91bb28b47b Merged two run commands into one in Dockerfile 2015-05-15 18:04:20 +05:30
Adam Harrison 8b9a2142c9 Include util-linux package in weaveexec container 2015-04-21 15:19:56 +01:00
Adam Harrison 338d577fb7 Implement weaveexec signal proxy 2015-04-11 11:50:42 +01:00
Michael Bridgen 520c54f8da Use a fixed (and old) version of the docker client
As noted in #388 comment 76958961, we need the docker client to be as
old as possible while supporting what weave needs to do. At the minute
that means version 1.3.1.

The `apk` package index does not have old versions of docker, so the
most direct way of getting a docker executable is to download the
specific version from https://get.docker.com.
2015-03-20 14:37:24 +00:00
Michael Bridgen 795d0edc73 weavetools -> weaveexec
This is to make a visible break with previous releases, such that a
newly downloaded weave script will definitely work.

Without this change in name, an existing weavetools image that doesn't
include the script might be invoked, resulting in a confusing message
for the user.
2015-03-18 12:29:20 +00:00