5 # do not change this, it is already matched with the git repo file structure
6 DOCKER_FILE_DIR='./docker_files'
8 KAFKA_VERSION='0.8.1.1'
10 wget -q "http://www.namesdir.com/mirrors/apache/kafka/${KAFKA_VERSION}/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz" \
11 -O "./docker_files/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz"
13 # commands to run docker and docker-compose
14 DOCKER_COMPOSE_EXE='/opt/docker/docker-compose'
16 cd "${DOCKER_FILE_DIR}"
18 while ! ifconfig |grep "docker0" > /dev/null;
20 echo 'waiting for docker operational'
23 echo "prep any files with local configurations"
24 if ls __* 1> /dev/null 2>&1; then
25 IP_DOCKER0=$(ifconfig docker0 |grep "inet addr" | cut -d: -f2 |cut -d" " -f1)
26 TEMPLATES=$(ls -1 __*)
27 for TEMPLATE in $TEMPLATES
29 FILENAME=${TEMPLATE//_}
30 if [ ! -z "${IP_DOCKER0}" ]; then
31 sed -e "s/{{ ip.docker0 }}/${IP_DOCKER0}/" "$TEMPLATE" > "$FILENAME"
36 echo "starting docker operations"
37 ${DOCKER_COMPOSE_EXE} up -d