Prepare for public release
This commit is contained in:
Executable
+17
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
# this command helper depends on key-based (passwordless) SSH access by the current user to each of the docker swarm nodes.
|
||||
NODE_HOST=$1; shift;
|
||||
|
||||
nc -zvw3 $NODE_HOST 22 &> /dev/null;
|
||||
PING_RESULT=$?
|
||||
|
||||
if [ $PING_RESULT != 0 ]; then
|
||||
echo
|
||||
echo "Host '$NODE_HOST' not reachable."
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# connect to the docker host through SSH
|
||||
export DOCKER_HOST="ssh://$(whoami)@$NODE_HOST.$(hostname -d)"
|
||||
# execute the command
|
||||
docker $@
|
||||
Reference in New Issue
Block a user