config/bash/docker-remote.sh

12 lines
295 B
Bash

# Convenience tool for setting DOCKER_HOST for remote docker operations over ssh.
#
# Enable: dcontrol <somehost.com>
# Disable: dcontrol off
function dcontrol() {
if [ -z $1 ] || [ $1 == "off" ]; then
unset DOCKER_HOST
return
fi
export DOCKER_HOST=ssh://root@$1
}