aboutsummaryrefslogtreecommitdiffstats
path: root/utils/webseal-simulator
diff options
context:
space:
mode:
Diffstat (limited to 'utils/webseal-simulator')
-rw-r--r--utils/webseal-simulator/sdc-simulator/Dockerfile52
-rw-r--r--utils/webseal-simulator/sdc-simulator/startup.sh7
2 files changed, 51 insertions, 8 deletions
diff --git a/utils/webseal-simulator/sdc-simulator/Dockerfile b/utils/webseal-simulator/sdc-simulator/Dockerfile
index d217d5aabf..24a7dd1943 100644
--- a/utils/webseal-simulator/sdc-simulator/Dockerfile
+++ b/utils/webseal-simulator/sdc-simulator/Dockerfile
@@ -1,4 +1,48 @@
-FROM onap/base_sdc-jetty:1.7.0
+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 chef-solo /root/chef-solo/
@@ -10,8 +54,8 @@ USER root
RUN chown -R jetty:jetty ${JETTY_BASE}/webapps
-COPY startup.sh /root/
+COPY startup.sh ${JETTY_BASE}/
-RUN chmod 777 /root/startup.sh
+RUN chmod 777 ${JETTY_BASE}/startup.sh
-ENTRYPOINT [ "/root/startup.sh" ]
+ENTRYPOINT [ "sh", "-c", "${JETTY_BASE}/startup.sh"]
diff --git a/utils/webseal-simulator/sdc-simulator/startup.sh b/utils/webseal-simulator/sdc-simulator/startup.sh
index 66add3a75e..3f6e2a02b5 100644
--- a/utils/webseal-simulator/sdc-simulator/startup.sh
+++ b/utils/webseal-simulator/sdc-simulator/startup.sh
@@ -1,11 +1,9 @@
#!/bin/sh
-
-
cd /root/chef-solo
chef-solo -c solo.rb -E ${ENVNAME}
rc=$?
-if [[ $rc != 0 ]]; then
+if [ $rc -ne 0 ]; then
echo "Chef exaction failed."
exit $rc;
fi
@@ -21,5 +19,6 @@ JAVA_OPTIONS=" ${JAVA_OPTIONS} \
cd /var/lib/jetty
-/docker-entrypoint.sh
+
+java $JAVA_OPTIONS -jar "$JETTY_HOME/start.jar"