Last active
December 15, 2015 19:59
-
-
Save dstrctrng/5315149 to your computer and use it in GitHub Desktop.
Running a docker with runsvdir, ssh in, then destroy it
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function d { | |
did=$(docker run -d precise runsvdir /etc/service) | |
ip=$(docker inspect $did | grep IpAddress | cut -d'"' -f4) | |
nc -z $ip 22 && ssh -oStrictHostKeyChecking=no root@$ip | |
docker kill $did | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment