Skip to content

Commit 2ab8330

Browse files
authored
Add ability to pass extra docker run parameters. (#248)
Signed-off-by: IGordynskyi <yuriy.gordynskyy@gmail.com>
1 parent 07e3c75 commit 2ab8330

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

run.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,23 @@ while [[ $# -gt 0 ]]; do
9090
BASE_OS="$2"
9191
shift
9292
;;
93+
*)
94+
# Starting from the first unknown parameter,
95+
# pass all parameters as a docker run options.
96+
while [[ $# -gt 0 ]]; do
97+
if [ -z "${OPTS}" ]; then
98+
OPTS=${1}
99+
elif [[ ${1} = *" "* ]]; then
100+
# parameter contains spaces
101+
# E.g., docker run ... --shm-size=256m -v /some/path/:/some/path/:rw
102+
OPTS="${OPTS} \"${1}\""
103+
else
104+
OPTS="${OPTS} ${1}"
105+
fi
106+
shift
107+
done
108+
break
109+
;;
93110
esac
94111
shift
95112
done

0 commit comments

Comments
 (0)