From 9cc6f9121e12cd56686302cd6c6429e709fdcb1b Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Thu, 23 Oct 2014 17:55:23 +0100 Subject: [PATCH 1/2] add 'weave start' --- README.md | 6 ++++-- weave | 8 ++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 22b3fc85..c0560220 100644 --- a/README.md +++ b/README.md @@ -62,11 +62,13 @@ The first line starts the weave router, in a container. This needs to be done once on each host. We tell weave that its IP address should be 10.0.0.1, and that the weave network is on 10.0.0.0/16. -The second line starts our application container. We give it an IP +The second line runs our application container. We give it an IP address and network (a subnet of the weave network). `weave run` invokes `docker run -d` with all the parameters following the IP address and network. So we could be launching any container this way; -here we just take a stock ubuntu container and launch a shell in it. +here we just take a stock ubuntu container and launch a shell in +it. There's also a `weave start` command, which invokes `docker start` +for starting existing containers. If our application consists of more than one container on this host we simply launch them with a variation on that second line. diff --git a/weave b/weave index e83d11e4..48b7632a 100755 --- a/weave +++ b/weave @@ -302,6 +302,14 @@ case "$COMMAND" in with_container_netns attach $CONTAINER $IPADDR $CONTAINER_IFNAME echo $CONTAINER ;; + start) + [ $# -gt 1 ] || usage + IPADDR=$1 + create_bridge + CONTAINER=$(docker start $2) + with_container_netns attach $CONTAINER $IPADDR $CONTAINER_IFNAME + echo $CONTAINER + ;; attach) [ $# -gt 1 ] || usage create_bridge From 070ec0c0e93fa313f4bada73651bb7a67ab34d47 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Thu, 23 Oct 2014 18:00:29 +0100 Subject: [PATCH 2/2] add usage --- weave | 1 + 1 file changed, 1 insertion(+) diff --git a/weave b/weave index 48b7632a..ea6d9a9f 100755 --- a/weave +++ b/weave @@ -5,6 +5,7 @@ usage() { echo "Usage:" echo "weave launch [-password ] ..." echo "weave run ..." + echo "weave start " echo "weave attach " echo "weave detach " echo "weave expose "