From: Colin P. Mccabe Date: Tue, 29 Nov 2016 18:01:02 +0000 (-0800) Subject: Add dssh: get a login for a docker container X-Git-Url: http://club.cc.cmu.edu/~cmccabe/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94e79ad8c88e8f089c828b358e568cd39894c4de;p=cmccabe-bin Add dssh: get a login for a docker container --- diff --git a/dssh b/dssh new file mode 100755 index 0000000..c67976e --- /dev/null +++ b/dssh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +# +# Get a login for a docker container. +# + +die() { + echo $@ + exit 1 +} + +CONTAINER=${1} +[ "x${CONTAINER}" == "x" ] && die "You must supply a container name as the first argument." +shift +docker exec -it "${CONTAINER}" bash "${@}"