blob: 24a7dd194390c7768bb006dd88c8c7fb3b6b0ea3 [file] [log] [blame]
sebdet30670ac2020-08-04 14:16:00 +02001FROM jetty:9.4.31-jre11-slim
2
3USER root
4
5# Install Chef
6RUN set -ex && \
7 apt-get update -y && \
8 apt-get install -y \
9 jq \
10 curl \
11 curl \
12 vim \
13 make \
14 gcc \
15 ruby \
16 ruby-dev \
17 libffi-dev \
18 libxml2-dev && \
19 gem install \
20 chef:13.8.5 \
21 berkshelf:6.3.1 \
22 io-console:0.4.6 \
23 etc webrick \
24 --no-document && \
25 gem cleanup && \
26 apt-get update -y && \
27 apt-get install -y binutils jq && \
28 apt-get clean
29
30# Replace Jetty user ID
31ENV USER_JETTY="jetty"
32ENV GROUP_JETTY="jetty"
33ENV UID_JETTY="352070"
34ENV GID_JETTY="35953"
35
36# Remove user:
37RUN deluser ${USER_JETTY}
38#RUN delgroup ${GROUP_JETTY}
39RUN echo "${USER_JETTY}:x:${UID_JETTY}:${GID_JETTY}::/home/${USER_JETTY}:Linux User,,,:/home/jetty:/bin/false" >> /etc/passwd
40RUN echo "${GROUP_JETTY}:x:${GID_JETTY}:${USER_JETTY}" >> /etc/group
41RUN echo "${USER_JETTY}:!:17501:0:99999:7:::" >> /etc/shadow
42RUN mkdir /home/${USER_JETTY} && chown ${USER_JETTY}:${GROUP_JETTY} /home/${USER_JETTY}
43RUN chown -R jetty:jetty ${JETTY_BASE}/webapps /var/lib/jetty
44
45USER jetty
Tal Gitelmanfa222902017-08-16 13:44:31 +030046
47COPY chef-solo /root/chef-solo/
Tal Gitelmanfa222902017-08-16 13:44:31 +030048
Michael Landob35130e2017-09-27 19:31:12 +030049COPY chef-repo/cookbooks /root/chef-solo/cookbooks/
Tal Gitelmanfa222902017-08-16 13:44:31 +030050
Tal Gitelmanfa222902017-08-16 13:44:31 +030051ADD WSSimulator*.war ${JETTY_BASE}/webapps/
Michael Landob35130e2017-09-27 19:31:12 +030052
Tal Gitelman0a722cd2017-10-24 14:54:53 +030053USER root
54
Tal Gitelmanfa222902017-08-16 13:44:31 +030055RUN chown -R jetty:jetty ${JETTY_BASE}/webapps
56
sebdet30670ac2020-08-04 14:16:00 +020057COPY startup.sh ${JETTY_BASE}/
Tal Gitelmanfa222902017-08-16 13:44:31 +030058
sebdet30670ac2020-08-04 14:16:00 +020059RUN chmod 777 ${JETTY_BASE}/startup.sh
Tal Gitelmanfa222902017-08-16 13:44:31 +030060
sebdet30670ac2020-08-04 14:16:00 +020061ENTRYPOINT [ "sh", "-c", "${JETTY_BASE}/startup.sh"]