blob: 6dfdfa3d1b1251902720c438b8b45989d3a53dae [file] [log] [blame]
FROM openecomp/wildfly:1.0
### File Author / Maintainer
MAINTAINER "The ONAP Team"
LABEL Description="This image contains the ONAP SO base for arquillian" Version="1.0"
ENV CHEF_REPO_NAME="chef-repo"
ENV CHEF_CONFIG_NAME="mso-config"
### Downloading dependencies
USER root
RUN apt-get install -y curl && curl -LO https://packages.chef.io/stable/ubuntu/12.04/chefdk_0.17.17-1_amd64.deb && curl -LO http://central.maven.org/maven2/org/mariadb/jdbc/mariadb-java-client/1.5.4/mariadb-java-client-1.5.4.jar && curl -LO http://search.maven.org/remotecontent?filepath=org/jacoco/jacoco/0.7.7.201606060606/jacoco-0.7.7.201606060606.zip && apt-get remove --purge -y curl && apt-get autoremove -y
RUN apt-get install -y unzip && unzip jacoco-0.7.7.201606060606.zip -d /tmp/jacoco && apt-get remove --purge -y unzip && apt-get autoremove -y
RUN chown -R jboss:jboss /tmp/jacoco
### Install Chef
RUN dpkg -i chefdk_0.17.17-1_amd64.deb
COPY scripts/start-jboss-server.sh /opt/mso/scripts/start-jboss-server.sh
RUN chown jboss:jboss /opt/mso/scripts/*
RUN chmod u+rx /opt/mso/scripts/*
RUN mkdir /etc/chef
RUN chown jboss:jboss /etc/chef
RUN chmod u+xrw /etc/chef
RUN mkdir -p /etc/mso
RUN chown -R jboss:jboss /etc/mso
RUN chmod u+xrw /etc/mso
# Setup shared folder
RUN mkdir /shared
RUN chown jboss:jboss /shared
# Setup chef folders
RUN mkdir -p /var/chef/nodes
RUN chown jboss:jboss /var/chef/nodes
RUN mkdir /var/berks-cookbooks
RUN chown jboss:jboss /var/berks-cookbooks
RUN mkdir -p /home/jboss/.chef/nodes
RUN chown jboss:jboss /home/jboss/.chef/nodes
COPY chef-configs/${CHEF_REPO_NAME} /var/berks-cookbooks/${CHEF_REPO_NAME}
COPY chef-configs/${CHEF_CONFIG_NAME} /var/berks-cookbooks/${CHEF_CONFIG_NAME}
COPY chef-configs/solo.rb /var/berks-cookbooks/${CHEF_REPO_NAME}/solo.rb
# Start Chef config
RUN sed "s/CHEF_REPO_NAME_TO_REPLACE/${CHEF_REPO_NAME}/g" -i /var/berks-cookbooks/${CHEF_REPO_NAME}/solo.rb
RUN chef-solo -c /var/berks-cookbooks/${CHEF_REPO_NAME}/solo.rb -o recipe[mso-config::apih],recipe[mso-config::bpmn],recipe[mso-config::jra]
RUN mv /var/berks-cookbooks/${CHEF_REPO_NAME}/environments/mso-docker.json /var/berks-cookbooks/${CHEF_REPO_NAME}/environments/mso-docker-init.json
RUN echo "" > /shared/mso-docker.json
RUN ln -s /shared/mso-docker.json /var/berks-cookbooks/${CHEF_REPO_NAME}/environments/mso-docker.json
# Jacoco config
RUN echo "" > /shared/jacoco-it.exec
RUN ls -latr /
RUN ls -latr /shared
RUN chown jboss:jboss /shared/jacoco-it.exec
## Create the log folder for MSO
RUN mkdir -p /var/log/ecomp/MSO/
RUN chown jboss:jboss /var/log/ecomp/MSO
### Configure Jboss WildFly
RUN mkdir -p $JBOSS_HOME/modules/mariadb/main
RUN cp mariadb-java-client-1.5.4.jar $JBOSS_HOME/modules/mariadb/main
COPY jboss-configs/modules/mariadb/main/module.xml $JBOSS_HOME/modules/mariadb/main
COPY jboss-configs/configuration/standalone-full-ha.xml $JBOSS_HOME/standalone/configuration/standalone-full-ha-mso.xml
COPY jboss-configs/configuration/mgmt-users.properties $JBOSS_HOME/standalone/configuration/mgmt-users.properties
COPY jboss-configs/configuration/mgmt-groups.properties $JBOSS_HOME/standalone/configuration/mgmt-groups.properties
COPY jboss-configs/configuration/application-users.properties $JBOSS_HOME/standalone/configuration/application-users.properties
COPY jboss-configs/configuration/application-roles.properties $JBOSS_HOME/standalone/configuration/application-roles.properties
RUN echo "JAVA_OPTS=\"\$JAVA_OPTS -Xms64m -Xmx4g -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=1g -Djboss.bind.address=0.0.0.0 -Djboss.bind.address.management=0.0.0.0 -Dmso.db=MARIADB -Dmso.config.path=/etc/mso/config.d/ -javaagent:/tmp/jacoco/lib/jacocoagent.jar=destfile=/shared/jacoco-it.exec,dumponexit=true,append=false,includes=com.att.*:org.openecomp.*\"" >> $JBOSS_HOME/bin/standalone.conf
RUN echo "LAUNCH_JBOSS_IN_BACKGROUND=true" >> $JBOSS_HOME/bin/standalone.conf
RUN mkdir -p /etc/mso/config.d/ASDC && chown -R jboss:jboss /etc/mso/config.d/ASDC && chmod u+xrw /etc/mso/config.d/ASDC
### Open Ports
EXPOSE 8080 9990
VOLUME /shared
### Start EAP
USER root
CMD ["/opt/mso/scripts/start-jboss-server.sh"]