1
0
mirror of https://github.com/docker/docs.git synced 2026-11-05 00:14:17 +03:00

Don't mount pwd if it is /

Signed-off-by: Chia-liang Kao <clkao@clkao.org>
This commit is contained in:
Chia-liang Kao
2016-02-14 01:42:51 +08:00
committed by Daniel Nephin
parent 654b3710f7
commit ed5fedf516

View File

@@ -31,7 +31,9 @@ fi
# 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
compose_dir=$(dirname $COMPOSE_FILE)
fi
@@ -50,4 +52,4 @@ else
DOCKER_RUN_OPTIONS="-i"
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 $@