summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main/docker/backend/Dockerfile
diff options
context:
space:
mode:
authorsebdet <sebastien.determe@intl.att.com>2020-09-17 15:07:23 +0200
committerSébastien Determe <sebastien.determe@intl.att.com>2020-09-18 12:59:54 +0000
commit591810df468a8e2c59569e701f514bff61203940 (patch)
tree9cd9b03ef59319a229bc784d66c02538c3785ec2 /catalog-be/src/main/docker/backend/Dockerfile
parent0e825177c8f6c5304d9b529cd9831f30d401efaa (diff)
Introduce a new docker for be plugins
Introduce a new docker image containing the etsi plugin and potentially others + simplify the process to build backend image + cleaning of unused files Issue-ID: SDC-3289 Signed-off-by: sebdet <sebastien.determe@intl.att.com> Change-Id: I82c770b391d169bef3bcc5f5af66e2a24dffb1b4 Signed-off-by: sebdet <sebastien.determe@intl.att.com>
Diffstat (limited to 'catalog-be/src/main/docker/backend/Dockerfile')
-rw-r--r--catalog-be/src/main/docker/backend/Dockerfile55
1 files changed, 55 insertions, 0 deletions
diff --git a/catalog-be/src/main/docker/backend/Dockerfile b/catalog-be/src/main/docker/backend/Dockerfile
new file mode 100644
index 0000000000..2772e62f99
--- /dev/null
+++ b/catalog-be/src/main/docker/backend/Dockerfile
@@ -0,0 +1,55 @@
+FROM jetty:9.4.31-jre11-slim
+
+USER root
+
+# Install Chef
+RUN set -ex && \
+ apt-get update -y && \
+ apt-get install -y \
+ jq \
+ curl \
+ curl \
+ vim \
+ make \
+ gcc \
+ ruby \
+ ruby-dev \
+ libffi-dev \
+ libxml2-dev && \
+ gem install \
+ chef:13.8.5 \
+ berkshelf:6.3.1 \
+ io-console:0.4.6 \
+ etc webrick \
+ --no-document && \
+ gem cleanup && \
+ apt-get update -y && \
+ apt-get install -y binutils jq && \
+ apt-get clean
+
+# Replace Jetty user ID
+ENV USER_JETTY="jetty"
+ENV GROUP_JETTY="jetty"
+ENV UID_JETTY="352070"
+ENV GID_JETTY="35953"
+
+# Remove user:
+RUN deluser ${USER_JETTY}
+#RUN delgroup ${GROUP_JETTY}
+RUN echo "${USER_JETTY}:x:${UID_JETTY}:${GID_JETTY}::/home/${USER_JETTY}:Linux User,,,:/home/jetty:/bin/false" >> /etc/passwd
+RUN echo "${GROUP_JETTY}:x:${GID_JETTY}:${USER_JETTY}" >> /etc/group
+RUN echo "${USER_JETTY}:!:17501:0:99999:7:::" >> /etc/shadow
+RUN mkdir /home/${USER_JETTY} && chown ${USER_JETTY}:${GROUP_JETTY} /home/${USER_JETTY}
+RUN chown -R jetty:jetty ${JETTY_BASE}/webapps /var/lib/jetty
+
+USER jetty
+
+COPY --chown=jetty:jetty chef-solo ${JETTY_BASE}/chef-solo/
+COPY --chown=jetty:jetty chef-repo/cookbooks ${JETTY_BASE}/chef-solo/cookbooks/
+COPY --chown=jetty:jetty onap-sdc-backend/catalog-be.war ${JETTY_BASE}/webappwar/
+COPY --chown=jetty:jetty context.xml ${JETTY_BASE}/webapps/
+COPY --chown=jetty:jetty startup.sh ${JETTY_BASE}/
+
+RUN chmod 770 ${JETTY_BASE}/startup.sh
+
+ENTRYPOINT [ "sh", "-c", "${JETTY_BASE}/startup.sh"] \ No newline at end of file