We want to be compatible with whatever docker the user has; `weave run` is the only command that passes on arbitrary args to docker (i.e., that doesn't have a fixed set of docker features that it needs). To make this workable we still need to do some things on the remote host: the IP attachment and figuring out the DNS settings (since those may depend on the bridge IP).
23 lines
646 B
Bash
Executable File
23 lines
646 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
if ! [ -f "./assert.sh" ]; then
|
|
echo Fetching assert script
|
|
curl -sS https://raw.githubusercontent.com/lehmannro/assert.sh/master/assert.sh > ./assert.sh
|
|
fi
|
|
|
|
. ./config.sh
|
|
|
|
echo Copying weave images and script to hosts
|
|
for HOST in $HOSTS; do
|
|
docker_on $HOST load -i ../weave.tar
|
|
docker_on $HOST load -i ../weavedns.tar
|
|
docker_on $HOST load -i ../weaveexec.tar
|
|
run_on $HOST mkdir -p bin
|
|
cat ../bin/docker-ns | run_on $HOST sh -c "cat > $DOCKER_NS"
|
|
cat ../weave | run_on $HOST sh -c "cat > ./weave"
|
|
run_on $HOST chmod a+x $DOCKER_NS ./weave
|
|
run_on $HOST sudo service docker restart
|
|
done
|