-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdocker-entrypoint.sh
executable file
·29 lines (24 loc) · 1.22 KB
/
docker-entrypoint.sh
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
#!/bin/bash
set -e
printenv
export JAVA_HOME=${JAVA_HOME:-"/usr/java"}
export JAVACMD=${JAVA_HOME}/bin/java
export EXE_COMMAND=${1:-"echo Hello"}
#### ------------------------------------------------------------------------
#### ---- Extra line added in the script to run all command line arguments
#### ---- To keep the docker process staying alive if needed.
#### ------------------------------------------------------------------------
if [ $# -lt 1 ]; then
echo "Starting docker process daemon ... {PRODUCT_FULL_PATH_EXE}"
#### ------------------------------------------------------------------------
#### ---- You need to set PRODUCT_EXE as the full-path executable binary ----
#### ------------------------------------------------------------------------
#sudo -E /bin/bash -c "(JAVA_HOME=${JAVA_HOME:-/usr/java}; JAVACMD=${JAVA_HOME}/bin/java; ${EXE_COMMAND:-echo Hello})"
#cd ${PRODUCT_HOME}; /bin/bash -c "${PRODUCT_HOME}/bin/${PRODUCT_EXE}"
(cd ${PRODUCT_HOME}; /bin/bash -c "${PRODUCT_FULL_PATH_EXE}")
#exec "/bin/bash";
else
echo "Starting docker process daemon ... ${PRODUCT_FULL_PATH_EXE} with arguments $@"
(cd ${PRODUCT_HOME}; /bin/bash -c "${PRODUCT_FULL_PATH_EXE} $@")
#exec "$@";
fi