5 export NEXUS_DOCKER_REPO=$(cat /opt/config/nexus_docker_repo.txt)
7 # do not change this, it is already matched with the git repo file structure
8 DOCKER_FILE_DIR='./docker_files'
10 # commands to run docker and docker-compose
11 DOCKER_COMPOSE_EXE='/opt/docker/docker-compose'
13 cd "${DOCKER_FILE_DIR}"
15 while ! ifconfig |grep "docker0" > /dev/null;
17 echo 'waiting for docker operational'
20 echo "prep any files with local configurations"
21 if ls __* 1> /dev/null 2>&1; then
22 IP_DOCKER0=$(ifconfig docker0 |grep "inet addr" | cut -d: -f2 |cut -d" " -f1)
23 TEMPLATES=$(ls -1 __*)
24 for TEMPLATE in $TEMPLATES
26 FILENAME=${TEMPLATE//_}
27 if [ ! -z "${IP_DOCKER0}" ]; then
28 sed -e "s/{{ ip.docker0 }}/${IP_DOCKER0}/" "$TEMPLATE" > "$FILENAME"
33 if [ -z "$MTU" ]; then
34 export MTU=$(ifconfig docker0 |grep MTU |sed -e 's/.*MTU://' -e 's/\s.*$//')
37 echo "starting docker operations"
38 ${DOCKER_COMPOSE_EXE} up -d --build