Instantly share code, notes, and snippets.

Embed
What would you like to do?
+ set -e
+ SCRIPT_VERSION=0.8.0
+ id -u
+ [ 0 = 0 ]
+ [ 1 -gt 0 ]
+ [ 0.8.0 = (unreleased version) ]
+ IMAGE_VERSION=0.8.0
+ IMAGE_VERSION=0.8.0
+ BASE_IMAGE=zettio/weave
+ BASE_DNS_IMAGE=zettio/weavedns
+ BASE_TOOLS_IMAGE=zettio/weavetools
+ IMAGE=zettio/weave:0.8.0
+ DNS_IMAGE=zettio/weavedns:0.8.0
+ TOOLS_IMAGE=zettio/weavetools:0.8.0
+ CONTAINER_NAME=weave
+ DNS_CONTAINER_NAME=weavedns
+ BRIDGE=weave
+ CONTAINER_IFNAME=ethwe
+ MTU=65535
+ PORT=6783
+ HTTP_PORT=6784
+ DNS_HTTP_PORT=6785
+ DOCKER_BRIDGE=docker0
+ COMMAND=launch
+ shift 1
+ + sed -n s|^\([^ ]*\) \([0-9]\+\)\.\([0-9]\+\).*|\1 \2 \3|p
uname -s -r
+ read sys maj min
+ [ Linux != Linux ]
+ [ ( 3 -eq 3 -a 16 -ge 5 ) -o 3 -gt 3 ]
+ command_exists ip
+ command -v ip
+ ip netns list
+ docker -v
+ sed -n s|^Docker version \([0-9]\+\.[0-9]\+.[0-9]\+\).*|\1|p
+ DOCKER_VERSION=1.4.1
+ [ -z 1.4.1 ]
+ [ 1.4.1 = 1.3.0 ]
+ echo 1.4.1
+ cut -d. -f 1
+ DOCKER_VERSION_MAJOR=1
+ + cut -d. -f 2
echo 1.4.1
+ DOCKER_VERSION_MINOR=4
+ + echo 1.4.1
cut -d. -f 3
+ DOCKER_VERSION_PATCH=1
+ check_not_running weave zettio/weave
+ docker inspect --format={{ .State.Running }} {{ .Config.Image }} weave
+ create_bridge
+ [ ! -d /sys/class/net/weave ]
+ ip link add name weave type bridge
+ tail -c+2
+ tr :
+ od -txC -An -N5 /dev/urandom
+ ip link set dev weave address 7a:3c:81:72:a0:70
+ ip link add name vethwedu mtu 65535 type dummy
+ ip link set dev vethwedu master weave
+ ip link del dev vethwedu
+ run_tool host ethtool -K weave tx off
+ TOOL_NET=host
+ TOOL_COMMAND=ethtool
+ shift 2
+ docker run --rm --privileged --net=host zettio/weavetools:0.8.0 /bin/ethtool -K weave tx off
+ add_iptables_rule filter FORWARD -i weave -o weave -j ACCEPT
+ IPTABLES_TABLE=filter
+ shift 1
+ run_iptables -t filter -C FORWARD -i weave -o weave -j ACCEPT
+ run_iptables -t filter -A FORWARD -i weave -o weave -j ACCEPT
+ [ -z 1 ]
+ iptables -w -t filter -A FORWARD -i weave -o weave -j ACCEPT
+ run_iptables -t nat -N WEAVE
+ add_iptables_rule nat POSTROUTING -j WEAVE
+ IPTABLES_TABLE=nat
+ shift 1
+ run_iptables -t nat -C POSTROUTING -j WEAVE
+ run_iptables -t nat -A POSTROUTING -j WEAVE
+ [ -z 1 ]
+ iptables -w -t nat -A POSTROUTING -j WEAVE
+ ip link set dev weave up
+ cat /sys/class/net/weave/address
+ MACADDR=7a:3c:81:72:a0:70
+ is_cidr
+ echo
+ grep -E ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/[0-9]{1,2}$
+ [ = -password ]
+ [ = -passwordfile ]
+ docker run --privileged -d --name=weave -p 6783:6783/tcp -p 6783:6783/udp zettio/weave:0.8.0 -name 7a:3c:81:72:a0:70 -iface ethwe
+ CONTAINER=1114e81dcd5c0455ff13f0151804d11ad7189e9b75e6984fa6fb9e8e6ccd6324
+ with_container_netns 1114e81dcd5c0455ff13f0151804d11ad7189e9b75e6984fa6fb9e8e6ccd6324 launch
+ CONTAINER=1114e81dcd5c0455ff13f0151804d11ad7189e9b75e6984fa6fb9e8e6ccd6324
+ docker inspect --format={{ .State.Pid }} 1114e81dcd5c0455ff13f0151804d11ad7189e9b75e6984fa6fb9e8e6ccd6324
+ CONTAINER_PID=10475
+ [ 10475 = 0 ]
+ [ 10475 = <no value> ]
+ NETNS=10475
+ [ ! -d /var/run/netns ]
+ rm -f /var/run/netns/10475
+ ln -s /proc/10475/ns/net /var/run/netns/10475
+ LOCAL_IFNAME=vethwepl10475
+ GUEST_IFNAME=vethwepg10475
+ IP_TMPOUT=/tmp/weave_ip_out_10296
+ IP_TMPERR=/tmp/weave_ip_err_10296
+ rm -f /tmp/weave_ip_out_10296 /tmp/weave_ip_err_10296
+ STATUS=0
+ shift 1
+ launch
+ STATUS=1
+ docker inspect --format={{ .State.Pid }} 1114e81dcd5c0455ff13f0151804d11ad7189e9b75e6984fa6fb9e8e6ccd6324
+ [ 0 != 10475 ]
+ cat /tmp/weave_ip_err_10296
+ ip netns exec 10475 ip link show eth0
+ connect_container_to_bridge
+ readlink /proc/10475/ns/net
+ readlink /proc/10296/ns/net
+ [ net:[4026532122] = net:[4026531956] ]
+ ip link add name vethwepl10475 mtu 65535 type veth peer name vethwepg10475 mtu 65535
+ run_tool host ethtool -K vethwepg10475 tx off
+ TOOL_NET=host
+ TOOL_COMMAND=ethtool
+ shift 2
+ docker run --rm --privileged --net=host zettio/weavetools:0.8.0 /bin/ethtool -K vethwepg10475 tx off
+ ip link set vethwepl10475 master weave
+ ip link set vethwepl10475 up
+ ip link set vethwepg10475 netns 10475
RTNETLINK answers: No such process
+ ip link del vethwepl10475 type veth
+ return 1
+ echo Container 1114e81dcd5c0455ff13f0151804d11ad7189e9b75e6984fa6fb9e8e6ccd6324 died
Container 1114e81dcd5c0455ff13f0151804d11ad7189e9b75e6984fa6fb9e8e6ccd6324 died
+ rm -f /tmp/weave_ip_out_10296 /tmp/weave_ip_err_10296 /var/run/netns/10475
+ return 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment