d6da54c7ee
docker ps does not receive any more arguments and we have to filter by image ourselves
11 lines
387 B
Bash
Executable File
11 lines
387 B
Bash
Executable File
#!/bin/bash -e
|
|
|
|
image_name=${1:-$KICKSTART_DOCKER_IMAGE}
|
|
image_name=${image_name:-moul/sshd}
|
|
|
|
runnig_sshd=$(docker ps --format='{{.ID}}\t{{.Image}}' | grep "$image_name" | cut -f 1)
|
|
[ -z "$runnig_sshd" ] && echo "Docker container not created. Run \`kickstart docker-create\` to get one" && exit 1
|
|
|
|
port=$(docker port "$runnig_sshd" 22 | cut -f 2 -d :)
|
|
exec ssh -p "$port" root@localhost
|