Skip to content

Commit

Permalink
Add ability to pass extra docker run parameters. (#248)
Browse files Browse the repository at this point in the history
Signed-off-by: IGordynskyi <[email protected]>
  • Loading branch information
IGordynskyi authored Jan 27, 2025
1 parent 07e3c75 commit 2ab8330
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,23 @@ while [[ $# -gt 0 ]]; do
BASE_OS="$2"
shift
;;
*)
# Starting from the first unknown parameter,
# pass all parameters as a docker run options.
while [[ $# -gt 0 ]]; do
if [ -z "${OPTS}" ]; then
OPTS=${1}
elif [[ ${1} = *" "* ]]; then
# parameter contains spaces
# E.g., docker run ... --shm-size=256m -v /some/path/:/some/path/:rw
OPTS="${OPTS} \"${1}\""
else
OPTS="${OPTS} ${1}"
fi
shift
done
break
;;
esac
shift
done
Expand Down

0 comments on commit 2ab8330

Please sign in to comment.