Fix database start error in multi-nodes k8s env
[vfc/nfvo/driver/vnfm/gvnfm.git] / juju / juju-vnfmadapter / Juju-vnfmadapterService / docker / Dockerfile
1 FROM centos:7
2
3 RUN sed -i 's/enabled=1/enabled=0/' /etc/yum/pluginconf.d/fastestmirror.conf
4 RUN sed -i 's|#baseurl=http://mirror.centos.org/centos|baseurl=http://mirrors.ocf.berkeley.edu/centos|' /etc/yum.repos.d/*.repo
5 RUN yum update -y
6
7 RUN yum install -y wget unzip socat java-1.8.0-openjdk-headless
8 RUN sed -i 's|#networkaddress.cache.ttl=-1|networkaddress.cache.ttl=10|' /usr/lib/jvm/jre/lib/security/java.security
9 ENV JAVA_HOME /usr/lib/jvm/jre
10
11 WORKDIR /service
12
13 # Set up mysql
14 RUN wget -q http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm && rpm -ivh mysql-community-release-el7-5.noarch.rpm && rm -f mysql-community-release-el7-5.noarch.rpm
15 RUN yum -y update
16 RUN yum -y install -y mysql-server
17 RUN mysql_install_db --user=mysql --datadir=/var/lib/mysql
18
19 VOLUME /var/lib/mysql
20
21 COPY init-mysql.sh .
22
23 # 30-tomcat.txt - AUTOGENERATED, DO NOT MODIFY MANUALLY
24 # Set up tomcat
25 RUN wget -q http://mirrors.ocf.berkeley.edu/apache/tomcat/tomcat-8/v8.5.30/bin/apache-tomcat-8.5.30.tar.gz && tar --strip-components=1 -xf apache-tomcat-8.5.30.tar.gz && rm -f apache-tomcat-8.5.30.tar.gz && rm -rf webapps && mkdir -p webapps/ROOT
26 RUN echo 'export CATALINA_OPTS="$CATALINA_OPTS -Xms64m -Xmx256m -XX:MaxPermSize=64m"' > /service/bin/setenv.sh
27 ENV CATALINA_HOME /service
28
29 # Set up microservice
30 RUN wget -q -O vfc-gvnfm-jujudriver.zip "https://nexus.onap.org/service/local/artifact/maven/redirect?r=snapshots&g=org.onap.vfc.nfvo.driver.vnfm.gvnfm&a=juju-vnfmadapterservice-deployment&v=LATEST&e=zip" && unzip -q -o -B vfc-gvnfm-jujudriver.zip && rm -f vfc-gvnfm-jujudriver.zip
31 # Set permissions
32 RUN find . -type d -exec chmod o-w {} \;
33 RUN find . -name "*.sh" -exec chmod +x {} \;
34 EXPOSE 8483
35
36 # 90-entrypoint.txt
37 RUN yum clean all
38
39 COPY instance-config.sh .
40 COPY instance-init.sh .
41 COPY instance-run.sh .
42 COPY instance-workaround.sh .
43 COPY docker-entrypoint.sh .
44 ENTRYPOINT /service/docker-entrypoint.sh
45
46 COPY LICENSE ./ONAP_LICENSE