Docker: Respect --workdir passed to docker run

This avoids

    docker run ... kasproject/kas sh -c "cd /somepath; kas build ..."

and rather allows for

    docker run ... --workdir=/somepath kasproject/kas build ...

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Jan Kiszka 2018-07-17 21:56:14 +02:00 committed by Daniel Wagner
parent 7bca825059
commit 6f51c33be2

View File

@ -27,7 +27,10 @@ else
GOSU="gosu builder"
fi
cd /builder
if [ "$PWD" = / ]; then
cd /builder
fi
if [ -n "$1" ]; then
case "$1" in
build|shell|-*)