2014-02-20 15:49:57 +00:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
2014-03-02 23:09:25 +00:00
|
|
|
image_name=${1:-$KICKSTART_DOCKER_IMAGE}
|
|
|
|
image_name=${image_name:-moul/sshd}
|
|
|
|
|
2015-09-26 03:35:09 +00:00
|
|
|
runnig_sshd=$(docker ps --format='{{.ID}}\t{{.Image}}' | grep "$image_name" | cut -f 1)
|
2014-02-20 15:49:57 +00:00
|
|
|
[ -z "$runnig_sshd" ] && echo "Docker container not created. Run \`kickstart docker-create\` to get one" && exit 1
|
|
|
|
|
2015-05-20 20:16:16 +00:00
|
|
|
port=$(docker port "$runnig_sshd" 22 | cut -f 2 -d :)
|
|
|
|
exec ssh -p "$port" root@localhost
|