Fixes container lookup not being able to find a container running for specific image.
docker ps does not receive any more arguments and we have to filter by image ourselves
This commit is contained in:
parent
b09cdfc3e4
commit
d6da54c7ee
@ -8,7 +8,7 @@ pull_sshd_image() {
|
||||
}
|
||||
|
||||
remove_running_sshd() {
|
||||
runnig_sshd=$(docker ps -q "$image_name")
|
||||
runnig_sshd=$(docker ps --format='{{.ID}}\t{{.Image}}' | grep "$image_name" | cut -f 1)
|
||||
[ "$runnig_sshd" ] && docker kill "$runnig_sshd" && docker rm "$runnig_sshd"
|
||||
true
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
image_name=${1:-$KICKSTART_DOCKER_IMAGE}
|
||||
image_name=${image_name:-moul/sshd}
|
||||
|
||||
runnig_sshd=$(docker ps -q "$image_name")
|
||||
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 :)
|
||||
|
Loading…
Reference in New Issue
Block a user