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
21 FROM openjdk:11-jre-slim
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 \
41 && rm -rf /var/lib/apt/lists/* \
42 && sudo mkdir -p /usr/lib/jvm/default-jvm \
43 && sudo ln -s /usr/local/openjdk-11/* /usr/lib/jvm/default-jvm
46 ENV NVM_DIR /usr/local/nvm
47 ENV NODE_VERSION 14.16.0
48 SHELL ["/bin/bash", "--login", "-i", "-c"]
49 RUN mkdir -p $NVM_DIR && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | NVM_DIR=$NVM_DIR bash
50 RUN source /root/.bashrc && nvm install $NODE_VERSION
51 SHELL ["/bin/bash", "--login", "-c"]
52 ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
53 ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
55 # Download and set up Tomcat
57 RUN wget -q https://archive.apache.org/dist/tomcat/tomcat-8/v8.5.30/bin/apache-tomcat-8.5.30.tar.gz && \
58 tar --strip-components=1 -xf apache-tomcat-8.5.30.tar.gz && \
59 rm -f apache-tomcat-8.5.30.tar.gz && rm -rf webapps && mkdir -p webapps/ROOT && \
60 echo 'export CATALINA_OPTS="$CATALINA_OPTS -Xms64m -Xmx256m -XX:MaxPermSize=64m"' > /service/bin/setenv.sh
64 COPY nginx.conf /etc/nginx/nginx.conf
65 COPY certgen.sh /service
66 COPY instance-config.sh .
67 COPY instance-init.sh .
68 COPY instance-run.sh .
69 COPY instance-workaround.sh .
70 COPY docker-entrypoint.sh .
73 COPY LICENSE ./ONAP_LICENSE
76 RUN mkdir -p /etc/nginx/ssl && \
77 chown -R www-data:www-data /var/lib/nginx
79 # Generate certificates
80 RUN chmod +x /service/certgen.sh && \
85 RUN chmod +x /service/bin/*.sh && \
86 cd /service/webapps/onapui/vnfmarket && \
87 npm install phantomjs-prebuilt@2.1.14 --ignore-scripts && \
91 RUN chmod a+x /service/install-vtp.sh && \
92 chmod a+x /service/vtp-tc.sh && \
93 /service/install-vtp.sh
95 # Create group and user
96 RUN groupadd -r vnfadmin && useradd -m --no-log-init -r -g vnfadmin vnfadmin && \
97 usermod -aG sudo vnfadmin && echo "vnfadmin ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
98 chmod -R 777 /usr/local/
102 # Define mountable directories.
103 VOLUME ["/etc/nginx/sites-enabled", "/etc/nginx/certs", "/etc/nginx/conf.d", "/var/log/nginx", "/var/www/html"]
109 ENTRYPOINT ["/service/docker-entrypoint.sh"]