Hi Suresh,
As discussed, I am attaching the docker files and related shell scripts for
airavata pga and servers.
respective docker files' name needs to be changed to "Dockerfile" and
placed in the root of the respective airavata source code. Respective shell
scripts needs to be placed in the same path as shown in the below screen
shots.
[image: Inline image 2]
[image: Inline image 4]
*How to run the docker files:*
After placing docker files and having a successfully running airavata
environment in place we need to run the docker build command from inside
the directory where Dockerfile is placed.
> docker build -t <image name> .
This command will create a docker image out of developers own environment.
*Here is an example how to run the docker for airavata:*
docker run -i -d --name server --env RABBITMQ_HOST=172.17.1.82
-t airavata_server:latest
docker run -i -d --name pga --env SERVER_HOST=172.17.1.84 --env
SERVER_PORT=8930 -p 8787:80 -t airavata_pga:latest
Thanks
Pankaj
line=$(head -n 1 /etc/hosts)
localip=$(echo $line |awk '{print $1}' )
sed -i 's/.*apiserver.server.host.*/apiserver.server.host='"$localip"'/'
airavata-server.properties
if [ -n "$RABBITMQ_HOST" ]; then
sed -i
's/.*rabbitmq.broker.url.*/rabbitmq.broker.url=amqp:\/\/'"$RABBITMQ_HOST"':5672/'
airavata-server.properties
sed -i 's/.*default.registry.gateway.*/default.registry.gateway=default/'
airavata-server.properties
fi
./airavata-server.sh
FROM ubuntu:latest
#---------- file Author / Maintainer
MAINTAINER Apache Airavata Community
#---------- update the repository sources list
RUN apt-get update && apt-get install -y \
apache2 \
curl \
openssl \
php5 \
php5-mcrypt \
unzip
#--------- installing composer
RUN curl -sS https://getcomposer.org/installer | php
RUN mv composer.phar /usr/local/bin/composer
RUN a2enmod rewrite
#--------- modifying the 000default file
COPY ./ /var/www/airavata-php-gateway
WORKDIR /etc/apache2/sites-available/
RUN sed -i 's/<\/VirtualHost>/<Directory "\/var\/www"> \n AllowOverride All \n
<\/Directory> \n <\/VirtualHost>/g' 000-default.conf
RUN sed -i 's/DocumentRoot \/var\/www\/html/DocumentRoot \/var\/www/g'
000-default.conf
WORKDIR /etc/php5/mods-available/
RUN sed -i
's/extension=mcrypt.so/extension=\/usr\/lib\/php5\/20121212\/mcrypt.so/g'
mcrypt.ini
WORKDIR /var/www/airavata-php-gateway/
RUN php5enmod mcrypt
#--------- making storage folder writable
RUN chmod -R 777 /var/www/airavata-php-gateway/app/storage
#--------- forward request and error logs to docker log collector
RUN ln -sf /dev/stdout /var/log/apache2/access.log
RUN ln -sf /dev/stderr /var/log/apache2/error.log
#-------- starting command
CMD ["sh", "-c", "sh pga-setup.sh"]
#--------- exposing apache to default port
EXPOSE 80
#---------- set the base image to Ubuntu
FROM ubuntu
#---------- file Author / Maintainer
MAINTAINER Apache Airavata Community
#---------- update the repository sources list
RUN apt-get update
#---------- installing jdk8
RUN apt-get install wget -y
RUN wget --header "Cookie: oraclelicense=accept-securebackup-cookie"
http://download.oracle.com/otn-pub/java/jdk/8u5-b13/jdk-8u5-linux-x64.tar.gz
RUN mkdir opt/jdk
RUN tar -zxf jdk-8u5-linux-x64.tar.gz -C opt/jdk
RUN update-alternatives --install /usr/bin/java java
/opt/jdk/jdk1.8.0_05/bin/java 100
RUN update-alternatives --install /usr/bin/javac javac
/opt/jdk/jdk1.8.0_05/bin/javac 100
#-------- adding server executable code
COPY ./modules/distribution/server/target/apache-airavata-server-0.15-SNAPSHOT
/apache-airavata-server-0.15-SNAPSHOT
COPY server-setup.sh /apache-airavata-server-0.15-SNAPSHOT/bin/
WORKDIR /apache-airavata-server-0.15-SNAPSHOT/bin
#--------- starting the airavata service
CMD ["sh", "-c", "sh server-setup.sh ; /bin/bash"]
#--------- exposing port
EXPOSE 8930
if [ -n "$SERVER_HOST" ]; then
sed -i 's/.*airavata-server.*/'"'"'airavata-server'"'"'
=>'"'"''"$SERVER_HOST"''"'",'/' ./app/config/pga_config.php
sed -i 's/.*airavata-port.*/'"'"'airavata-port'"'"' =>
'"'"''"$SERVER_PORT"''"'",'/' ./app/config/pga_config.php
fi
service apache2 restart
while true
do
echo "Press [CTRL+C] to stop.."
sleep 999999
done