else
RUN_COMMAND="${@}"
fi
-EXTRA_DOCKER_ARGS=""
-if [ ${ALLOCATE_TTY} -ne 0 ]; then
- EXTRA_DOCKER_ARGS="${EXTRA_DOCKER_ARGS} -t"
-fi
which docker &>/dev/null || die "docker must be on the PATH."
die "failed to find a docker image named ${DOCKER_IMAGE_NAME}"
fi
-docker exec -i ${EXTRA_DOCKER_ARGS} "${DOCKER_IMAGE_ID}" ${RUN_COMMAND}
+if [ ${ALLOCATE_TTY} == 1 ]; then
+ docker exec -it "${DOCKER_IMAGE_ID}" ${RUN_COMMAND}
+else
+ docker exec -i "${DOCKER_IMAGE_ID}" ${RUN_COMMAND} &
+ wait
+fi