Skip to content
Snippets Groups Projects
Commit 317590c4 authored by Thomas Juerges's avatar Thomas Juerges
Browse files

Add more helper stuff to make the start-jive script work

Still not there because docker-compose appears to do some
things behind closed doors and I cannot figure them out yet.
parent 58bedea4
No related branches found
No related tags found
No related merge requests found
OS=$(uname)
case ${OS} in
Linux)
display=""
XTRA_OPTIONS="-u $(id -u ${USER}):$(id -g ${USER}) -v /etc/passwd:/etc/passwd:ro -v /etc/groups:/etc/groups:ro"
;;
Darwin)
display="$(scutil --nwi | grep 'address' | cut -d':' -f2 | tr -d ' ' | head -n1):0"
XTRA_OPTIONS=""
;;
esac
display=${display:-${DISPLAY}}
OPTIONS="-e HOME=/hosthome -e DISPLAY=${display} -e XAUTHORITY=/hosthome/.Xauthority -e TANGO_HOST=databaseds:10000 -v ${HOME}:/hosthome -v /tmp/.X11-unix:/tmp/.X11-unix"
if [ ! -z ${XTRA_OPTIONS} ]; then
OPTIONS="${OPTIONS} ${XTRA_OPTIONS}"
fi
if [ ${#} -eq 1 ]; then
command=${1}
shift
else
command=/usr/local/bin/jive
fi
#docker run --rm -it --network host ${OPTIONS} nexus.engageska-portugal.pt/ska-docker/tango-java:latest ${command} ${@}
container_name=nexus.engageska-portugal.pt/ska-docker/tango-java:latest
container=$(docker ps | egrep ${container_name} | cut -d' ' -f1)
if [ ! -z ${container} ]; then
docker exec -it ${container} ${command} ${@}
else
echo "Container \"${container_name}\" is not running."
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment