File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ available options:
3333 run VoxBox with -e SPEC=spec/classes/supermodule_spec.rb
3434 --volume vol : specify an additional volume to put into the container
3535 see podman man page how to specify 'vol'. (no path magic is done ;))
36+ --runcmd : this lets you change the program used to start the container
37+ if not set explicit it looks for podman, orbstack and finally docker.
3638
3739available command:
3840 help : print this help message and exit
4547
4648run_container () {
4749 P=$( get_path $PWD )
48- command=" podman run -it --rm $( sed " s|=${P} /|=|g" <<< " ${PODENV}" ) -v ${P} :/repo:Z ${PODOPTIONS} ${PODIMAGE} ${VOXBOXCOMMAND} "
50+ command=" ${RUNCMD} run -it --rm $( sed " s|=${P} /|=|g" <<< " ${PODENV}" ) -v ${P} :/repo:Z ${PODOPTIONS} ${PODIMAGE} ${VOXBOXCOMMAND} "
4951 if [ ${NOOP} -eq 0 ] ; then
5052 ${command}
5153 else
@@ -55,6 +57,7 @@ run_container () {
5557 fi
5658}
5759
60+
5861# get options
5962NOOP=0
6063PODOPTIONS=' '
@@ -71,6 +74,11 @@ while [[ $# -gt 0 ]]; do
7174 NOOP=1
7275 shift
7376 ;;
77+ --runcmd)
78+ shift
79+ RUNCMD=${1}
80+ shift
81+ ;;
7482 --entrypoint)
7583 shift
7684 PODOPTIONS=" --entrypoint ${1} ${PODOPTIONS} "
@@ -98,4 +106,18 @@ while [[ $# -gt 0 ]]; do
98106 esac
99107done
100108
109+ # lets see what we have as default runcmd:
110+ if [ -n " ${RUNCMD} " ] ; then
111+ true
112+ elif [ -n $( which podman) ] ; then
113+ RUNCMD=' podman'
114+ elif [ -n $( which orbstack) ] ; then
115+ RUNCMD=' orbstack'
116+ elif [ -n $( which docker) ] ; then
117+ RUNCMD=' docker'
118+ else
119+ echo " ERROR: could not find podman/orbstack or docker to start container" >&2
120+ exit 200
121+ fi
122+
101123run_container
You can’t perform that action at this time.
0 commit comments