Add support for using different docker images

The part of trying out scripts involve creating a docker container with
ssh and running some projects and functions on it.

This change allows to define the docker image name to be used with the
docker-* functions.
This commit is contained in:
Bruno Tavares
2014-03-02 20:09:25 -03:00
parent 56bf615b34
commit c9633bb7b9
3 changed files with 22 additions and 6 deletions

View File

@ -1,6 +1,9 @@
#!/bin/bash -e
runnig_sshd=$(docker ps -q moul/sshd)
image_name=${1:-$KICKSTART_DOCKER_IMAGE}
image_name=${image_name:-moul/sshd}
runnig_sshd=$(docker ps -q $image_name)
[ -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 :`