1 # Copyright 2020 Huawei Technologies Co., Ltd.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 # vnf-sdk-marketplace/target/Dockerfile
22 ARG DEBIAN_FRONTEND=noninteractive
24 ENV JAVA_VERSION_MAJOR=11 \
25 JAVA_VERSION_MINOR=08 \
26 JAVA_HOME=/usr/lib/jvm/default-jvm \
27 PATH=${PATH}:/usr/lib/jvm/default-jvm/bin/ \
28 CATALINA_HOME=/service
30 # Install required libraries
31 RUN apt-get update && apt-get install -y \
39 software-properties-common \
43 && rm -rf /var/lib/apt/lists/*
47 RUN add-apt-repository ppa:openjdk-r/ppa -y && \
48 # update data from repositories
50 # Make info file about this build
51 printf "Build of java:openjdk-11-jre-headless, date: %s\n" `date -u +"%Y-%m-%dT%H:%M:%SZ"` > /service/java && \
53 apt-get install -y --no-install-recommends openjdk-11-jre-headless && \
55 ln -s java-11-openjdk-amd64 /usr/lib/jvm/default-jvm && \
56 # remove apt cache from image
57 apt-get clean all && \
58 rm -rf /var/lib/apt/lists/*
60 # Download and set up Tomcat
62 RUN wget -q https://archive.apache.org/dist/tomcat/tomcat-8/v8.5.30/bin/apache-tomcat-8.5.30.tar.gz && \
63 tar --strip-components=1 -xf apache-tomcat-8.5.30.tar.gz && \
64 rm -f apache-tomcat-8.5.30.tar.gz && rm -rf webapps && mkdir -p webapps/ROOT && \
65 echo 'export CATALINA_OPTS="$CATALINA_OPTS -Xms64m -Xmx256m -XX:MaxPermSize=64m"' > /service/bin/setenv.sh
69 COPY nginx.conf /etc/nginx/nginx.conf
70 COPY certgen.sh /service
71 COPY instance-config.sh .
72 COPY instance-init.sh .
73 COPY instance-run.sh .
74 COPY instance-workaround.sh .
75 COPY docker-entrypoint.sh .
78 COPY LICENSE ./ONAP_LICENSE
81 RUN mkdir -p /etc/nginx/ssl && \
82 chown -R www-data:www-data /var/lib/nginx
84 # Generate certificates
85 RUN chmod +x /service/certgen.sh && \
90 RUN chmod +x /service/bin/*.sh && \
91 cd /service/webapps/onapui/vnfmarket && \
92 npm install phantomjs-prebuilt@2.1.14 --ignore-scripts && \
96 RUN chmod a+x /service/install-vtp.sh && \
97 chmod a+x /service/vtp-tc.sh && \
98 /service/install-vtp.sh
100 # Create group and user
101 RUN groupadd -r vnfadmin && useradd -m --no-log-init -r -g vnfadmin vnfadmin && \
102 usermod -aG sudo vnfadmin && echo "vnfadmin ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
103 chmod -R 777 /usr/local/
107 # Define mountable directories.
108 VOLUME ["/etc/nginx/sites-enabled", "/etc/nginx/certs", "/etc/nginx/conf.d", "/var/log/nginx", "/var/www/html"]
114 ENTRYPOINT ["/service/docker-entrypoint.sh"]