aboutsummaryrefslogtreecommitdiffstats
path: root/vnfmarket-be/deployment/docker/docker-refrepo/src/main/docker/Dockerfile
blob: 612aecd0437e07f66410ca1ba991b745f6e89500 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#
# This file was auto-generated by gen-all-dockerfiles.sh; do not modify manually.
#
# vnf-sdk-marketplace/target/Dockerfile
#

# 10-basebuild.txt

FROM ubuntu:16.04
#RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
RUN apt-get install -y
RUN apt-get update --fix-missing -y
RUN apt-get install wget -y

WORKDIR /service



ENV JAVA_VERSION_MAJOR=8 \
    JAVA_VERSION_MINOR=111 \
    JAVA_HOME=/usr/lib/jvm/default-jvm \
    PATH=${PATH}:/usr/lib/jvm/default-jvm/bin/

RUN DEBIAN_FRONTEND=noninteractive apt-get -y dist-upgrade
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install python-software-properties
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install software-properties-common sudo

RUN add-apt-repository ppa:openjdk-r/ppa -y && \
    # update data from repositories
    apt-get update --fix-missing -y && \
    # upgrade OS
    apt-get -y dist-upgrade && \
    # Make info file about this build
    printf "Build of java:openjdk-8-jre-headless, date: %s\n"  `date -u +"%Y-%m-%dT%H:%M:%SZ"` > /service/java && \
    # install application
    apt-get install -y --no-install-recommends openjdk-8-jre-headless && \
    # fix default setting
    ln -s java-8-openjdk-amd64  /usr/lib/jvm/default-jvm && \
    # remove apt cache from image
    apt-get clean all

# Set up tomcat
RUN 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
RUN echo 'export CATALINA_OPTS="$CATALINA_OPTS -Xms64m -Xmx256m -XX:MaxPermSize=64m"' > /service/bin/setenv.sh
ENV CATALINA_HOME /service


# Set up microservice
#ADD ./STAGE  /service
#RUN apt-get install -y g++ make &&  curl -sL https://rpm.nodesource.com/setup_6.x |  bash -
#RUN apt-get install -y nodejs
#RUN apt-get install -y npm
#RUN cd /service/webapps/onapui/vnfmarket &&  npm install phantomjs-prebuilt@2.1.14 --ignore-scripts &&  npm install



RUN add-apt-repository -y ppa:nginx/stable && \
  apt-get update && \
  apt-get install -y nginx && \
  rm -rf /var/lib/apt/lists/* && \
  echo "\ndaemon off;" >> /etc/nginx/nginx.conf && \
  chown -R www-data:www-data /var/lib/nginx

# Define mountable directories.
VOLUME ["/etc/nginx/sites-enabled", "/etc/nginx/certs", "/etc/nginx/conf.d", "/var/log/nginx", "/var/www/html"]

# Define working directory.
WORKDIR /etc/nginx

#CMD ["nginx"]


EXPOSE 8702
EXPOSE 8703

WORKDIR /service

RUN  mkdir -p /etc/nginx/ssl
COPY nginx.conf /etc/nginx/nginx.conf
COPY certgen.sh /service
RUN  chmod +x /service/certgen.sh
RUN  /service/certgen.sh



RUN apt-get update && apt-get install nano -y
RUN apt-get install curl -y


#RUN apt-get install vim -y


COPY instance-config.sh .
COPY instance-init.sh .
COPY instance-run.sh .
COPY instance-workaround.sh .
COPY docker-entrypoint.sh .
COPY install-vtp.sh .
COPY vtp-tc.sh .


# Set up microservice
ADD ./STAGE  /service
RUN apt-get install -y g++ make &&  curl -sL https://rpm.nodesource.com/setup_6.x
RUN apt-get install -y nodejs
RUN apt-get install -y npm
RUN apt-get -qq update && apt-get -qq -y install bzip2
RUN chmod +x /service/bin/*.sh
RUN service nginx start &
RUN cd /service/webapps/onapui/vnfmarket && npm install phantomjs-prebuilt@2.1.14 --ignore-scripts && npm install

#VTP setup
RUN chmod a+x /service/install-vtp.sh
RUN chmod a+x /service/vtp-tc.sh
RUN /service/install-vtp.sh
EXPOSE 50051

RUN groupadd -r vnfadmin && useradd -m --no-log-init -r -g vnfadmin vnfadmin && \
    usermod -aG sudo vnfadmin && echo "vnfadmin ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
    chmod -R 777 /usr/local/

USER vnfadmin

RUN RUN umask 000 && sudo chmod +x /service/bin/*.sh /service/*.sh && \
    mkdir -p /service/logs && mkdir -p /var/log/nginx/ && \
    sudo chown -R vnfadmin:vnfadmin /var/log/nginx/ && \
    sudo chown -R vnfadmin:vnfadmin /service/ /opt/vtp /var/log && \
    sudo chmod -R +w /service/ /opt/vtp /var/log && \
    sudo touch /run/nginx.pid && sudo chown -R vnfadmin:vnfadmin /run/nginx.pid && \
    chmod +w /run/nginx.pid  && sudo chown -R vnfadmin:vnfadmin /var/log/nginx/ && \
    sudo usermod -aG www-data vnfadmin && sudo chmod -R a+w /var/lib/nginx


#ENTRYPOINT /service/docker-entrypoint.sh
ENTRYPOINT ["/service/docker-entrypoint.sh"]



COPY LICENSE ./ONAP_LICENSE