forked from OSC/ood-images
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ood-container
executable file
·52 lines (41 loc) · 965 Bytes
/
ood-container
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh -x
function show_help(){
echo "Helper script to run Open OnDemand Conainters."
echo ""
echo " -h|--help show this message"
echo " -d|--dev to run an interactive dev envrionment without the OOD rpm installed"
echo " -p|--port specify the port you want to bind to"
}
IMG="ood-${USER}:latest"
PORT="8080"
for arg in "$@"
do
case $arg in
-h|--help)
show_help
exit 0
;;
-d|--dev)
IMG="ood-dev:latest"
ARGS="-it"
ENTRY="/bin/bash"
shift
;;
-p|--port)
PORT=$2
shift
shift
;;
esac
done
if [ -z $OOD_APP_DEV_DIR ]; then
OOD_APP_DEV_DIR=$HOME
fi
# load extra stuff if you want
EXTRAS_FILE="$HOME/.local/etc/ood-container.config"
if [ -f "$EXTRAS_FILE" ]; then
. $EXTRAS_FILE
fi
ARGS="${ARGS} --rm=true --security-opt label=disable -v $OOD_APP_DEV_DIR:$HOME/ondemand/dev"
ARGS="${ARGS} --userns=keep-id ${EXTRA_ARGS} -p ${PORT}:80"
podman run ${ARGS} ${IMG} ${ENTRY}