Merge pull request #150 from rade/126_weave_start

LGTM.  Closes #126, also referenced from #148
This commit is contained in:
Bryan Boreham committed 2014-10-24 09:30:07 +01:00
commit 988f555a68
2 files changed
+13 -2

No files matched your search

+4 -2
View File
@@ -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.
+9
View File
@@ -5,6 +5,7 @@ usage() {
echo "Usage:"
echo "weave launch <cidr> [-password <password>] <peer_host> ..."
echo "weave run <cidr> <docker run args> ..."
echo "weave start <cidr> <container_id>"
echo "weave attach <cidr> <container_id>"
echo "weave detach <cidr> <container_id>"
echo "weave expose <cidr>"
@@ -302,6 +303,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