introduce 'weave expose'

which simplifies access to containers from the host, as well as
external access.
This commit is contained in:
Matthias Radestock committed 2014-08-30 15:40:50 +01:00
1 parent b9be18c386
commit 731454a406
2 files changed
+51 -20

No files matched your search

+10 -2
View File
@@ -5,6 +5,7 @@ usage() {
echo "Usage:"
echo "weave launch <ipaddr>/<subnet> [-passwd <passwd>] <peer_host> ..."
echo "weave run <ipaddr>/<subnet> <docker run args> ..."
echo "weave expose <ipaddr>/<subnet>"
exit 1
}
@@ -59,13 +60,22 @@ case "$COMMAND" in
# restarts.
MACADDR=`cat /sys/class/net/$BRIDGE/address`
CONTAINER=$(docker run --privileged -d --name=weave -p 6783:6783/tcp -p 6783:6783/udp $WEAVE_DOCKER_ARGS zettio/weave -name $MACADDR "$@")
echo $CONTAINER
IFACE=eth0
;;
run)
create_bridge
CONTAINER=$(docker run -d "$@")
echo $CONTAINER
IFACE=$CONTAINER_IFNAME
;;
expose)
if ! ip addr list dev $BRIDGE | grep -qF $IPADDR
then
ip addr add dev $BRIDGE $IPADDR
fi
exit 0
;;
*)
echo "Unknown weave command '$COMMAND'"
usage
@@ -108,5 +118,3 @@ else
fi
[ -f /var/run/netns/$NSPID ] && rm -f /var/run/netns/$NSPID
echo $CONTAINER