diff options
-rw-r--r-- | juju/juju-vnfmadapter/Juju-vnfmadapterService/docker/Dockerfile | 3 | ||||
-rw-r--r-- | juju/juju-vnfmadapter/Juju-vnfmadapterService/docker/docker-env-config.sh | 77 |
2 files changed, 40 insertions, 40 deletions
diff --git a/juju/juju-vnfmadapter/Juju-vnfmadapterService/docker/Dockerfile b/juju/juju-vnfmadapter/Juju-vnfmadapterService/docker/Dockerfile index cc683c8..9a12cf3 100644 --- a/juju/juju-vnfmadapter/Juju-vnfmadapterService/docker/Dockerfile +++ b/juju/juju-vnfmadapter/Juju-vnfmadapterService/docker/Dockerfile @@ -3,10 +3,11 @@ ENV JAVA_HOME /usr/lib/jvm/jre ENV CATALINA_HOME /service ADD . /service WORKDIR /service -RUN bash docker-env-config.sh +RUN bash docker-env-config.sh VOLUME /var/lib/mysql EXPOSE 8483 USER onap WORKDIR /service ENTRYPOINT /service/docker-entrypoint.sh + diff --git a/juju/juju-vnfmadapter/Juju-vnfmadapterService/docker/docker-env-config.sh b/juju/juju-vnfmadapter/Juju-vnfmadapterService/docker/docker-env-config.sh index 8b6b4f7..1cd99b0 100644 --- a/juju/juju-vnfmadapter/Juju-vnfmadapterService/docker/docker-env-config.sh +++ b/juju/juju-vnfmadapter/Juju-vnfmadapterService/docker/docker-env-config.sh @@ -1,52 +1,51 @@ #!/bin/bash install_sf(){ - sed -i 's/enabled=1/enabled=0/' /etc/yum/pluginconf.d/fastestmirror.conf - sed -i 's|#baseurl=http://mirror.centos.org/centos|baseurl=http://mirrors.ocf.berkeley.edu/centos|' /etc/yum.repos.d/*.repo - yum update -y - - yum install -y wget unzip socat java-1.8.0-openjdk-headless - sed -i 's|#networkaddress.cache.ttl=-1|networkaddress.cache.ttl=10|' /usr/lib/jvm/jre/lib/security/java.security - - # Set up mysql - 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 - yum -y update - yum -y install mysql-server - mysql_install_db --user=mysql --datadir=/var/lib/mysql - - # Set up tomcat - wget -q https://archive.apache.org/dist/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 - echo 'export CATALINA_OPTS="$CATALINA_OPTS -Xms64m -Xmx256m -XX:MaxPermSize=64m"' > /service/bin/setenv.sh - - # Set up microservice - 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=juj -u-vnfmadapterservice-deployment&v=LATEST&e=zip" && \ - unzip -q -o -B vfc-gvnfm-jujudriver.zip && \ - rm -f vfc-gvnfm-jujudriver.zip - # Set permissions - find . -type d -exec chmod o-w {} \; - find . -name "*.sh" -exec chmod +x {} \; + sed -i 's/enabled=1/enabled=0/' /etc/yum/pluginconf.d/fastestmirror.conf + sed -i 's|#baseurl=http://mirror.centos.org/centos|baseurl=http://mirrors.ocf.berkeley.edu/centos|' /etc/yum.repos.d/*.repo + yum update -y + + yum install -y wget unzip socat java-1.8.0-openjdk-headless + sed -i 's|#networkaddress.cache.ttl=-1|networkaddress.cache.ttl=10|' /usr/lib/jvm/jre/lib/security/java.security + + # Set up mysql + 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 + yum -y update + yum -y install mysql-server + mysql_install_db --user=mysql --datadir=/var/lib/mysql + + # Set up tomcat + wget -q https://archive.apache.org/dist/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 + echo 'export CATALINA_OPTS="$CATALINA_OPTS -Xms64m -Xmx256m -XX:MaxPermSize=64m"' > /service/bin/setenv.sh + + # Set up microservice + 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 + # Set permissions + find . -type d -exec chmod o-w {} \; + find . -name "*.sh" -exec chmod +x {} \; } add_user(){ - useradd onap - yum -y install sudo - chmod u+x /etc/sudoers - sed -i '/Same thing without a password/a\onap ALL=(ALL:ALL) NOPASSWD:ALL' /etc/sudoers - chmod u-x /etc/sudoers - chown onap:onap -R /service + useradd onap + yum -y install sudo + chmod u+x /etc/sudoers + sed -i '/Same thing without a password/a\onap ALL=(ALL:ALL) NOPASSWD:ALL' /etc/sudoers + chmod u-x /etc/sudoers + chown onap:onap -R /service } clean_sf_cache(){ - - yum clean all + + yum clean all } install_sf |