mirror of
https://github.com/docker/compose.git
synced 2025-07-26 15:14:04 +02:00
Don't mount pwd if it is /
Signed-off-by: Chia-liang Kao <clkao@clkao.org>
This commit is contained in:
parent
e1d67ad68a
commit
dd55415d4f
@ -31,7 +31,9 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
# Setup volume mounts for compose config and context
|
# Setup volume mounts for compose config and context
|
||||||
|
if [ "$(pwd)" != '/' ]; then
|
||||||
VOLUMES="-v $(pwd):$(pwd)"
|
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 $@
|
||||||
|
Loading…
x
Reference in New Issue
Block a user