瀏覽代碼

Don't mount pwd if it is /

Signed-off-by: Chia-liang Kao <[email protected]>
Chia-liang Kao 9 年之前
父節點
當前提交
ed5fedf516
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      script/run.sh

+ 4 - 2
script/run.sh

@@ -31,7 +31,9 @@ fi
 
 
 
 
 # Setup volume mounts for compose config and context
 # Setup volume mounts for compose config and context
-VOLUMES="-v $(pwd):$(pwd)"
+if [ "$(pwd)" != '/' ]; then
+    VOLUMES="-v $(pwd):$(pwd)"
+fi
 if [ -n "$COMPOSE_FILE" ]; then
 if [ -n "$COMPOSE_FILE" ]; then
     compose_dir=$(dirname $COMPOSE_FILE)
     compose_dir=$(dirname $COMPOSE_FILE)
 fi
 fi
@@ -50,4 +52,4 @@ else
     DOCKER_RUN_OPTIONS="-i"
     DOCKER_RUN_OPTIONS="-i"
 fi
 fi
 
 
-exec docker run --rm $DOCKER_RUN_OPTIONS $DOCKER_ADDR $COMPOSE_OPTIONS $VOLUMES -w $(pwd) $IMAGE $@
+exec docker run --rm $DOCKER_RUN_OPTIONS $DOCKER_ADDR $COMPOSE_OPTIONS $VOLUMES -w "$(pwd)" $IMAGE $@