Better docker config.
This commit is contained in:
parent
bc9ac748d3
commit
e85be32a76
2 changed files with 12 additions and 27 deletions
|
@ -1,13 +1,12 @@
|
|||
# A simple aliasing tool for performing remote docker operations over ssh
|
||||
# Usage: dcontrol <somehost.com>
|
||||
# Assumes you have key-based root login
|
||||
# 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
|
||||
unalias docker 2> /dev/null
|
||||
unset DOCKER_HOST
|
||||
return
|
||||
fi
|
||||
export DOCKER_HOST=$1
|
||||
alias docker="docker -H ssh://root@${DOCKER_HOST}"
|
||||
export DOCKER_HOST=ssh://root@$1
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue