Make sure that mkimage-debootstrap.sh does not try to do an interactive
authorWard Vandewege <ward@curoverse.com>
Fri, 10 Jul 2015 02:20:44 +0000 (22:20 -0400)
committerWard Vandewege <ward@curoverse.com>
Fri, 10 Jul 2015 02:20:44 +0000 (22:20 -0400)
docker run when there's no tty.

refs #6528

docker/mkimage-debootstrap.sh

index 319104ac003a742d74d70c8198c69d97f25d074b..0e99ec6f9b12df1669c371656221dc5ad7271ace 100755 (executable)
@@ -201,7 +201,8 @@ else
        sudo tar --numeric-owner -c . | $docker import - $repo:$suite
        
        # test the image
-       $docker run -i -t $repo:$suite echo success
+       [[ "$(/usr/bin/tty || true)" != "not a tty" ]] && RUN_OPTS="-i -t"
+       $docker run $RUN_OPS $repo:$suite echo success
        
        if [ -z "$skipDetection" ]; then
                case "$lsbDist" in