blob: 3a2359c4abb768d8a81833a65cb0e16ad74e4f92 [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
Michael Lando9dd269d2017-02-20 01:04:22 +020046
MichaelMorrisa2abf6e2020-03-10 12:37:48 +000047RUN mkdir -p ${JETTY_BASE}/config/catalog-fe
Michael Lando9dd269d2017-02-20 01:04:22 +020048
MichaelMorrisa2abf6e2020-03-10 12:37:48 +000049COPY --chown=jetty:jetty chef-solo ${JETTY_BASE}/chef-solo/
50
51COPY --chown=jetty:jetty chef-repo/cookbooks ${JETTY_BASE}/chef-solo/cookbooks/
Michael Lando9dd269d2017-02-20 01:04:22 +020052
Satoshi Fujiia4beafe2019-06-17 13:25:22 +090053ADD --chown=jetty:jetty onboarding*.war ${JETTY_BASE}/webapps/
Areli Fuss0a89f592017-09-11 10:27:29 +030054
Satoshi Fujiia4beafe2019-06-17 13:25:22 +090055ADD --chown=jetty:jetty catalog-fe-*.war ${JETTY_BASE}/webapps/
Areli Fuss0a89f592017-09-11 10:27:29 +030056
MichaelMorrisa2abf6e2020-03-10 12:37:48 +000057COPY --chown=jetty:jetty startup.sh ${JETTY_BASE}
Michael Landoaa616442017-10-24 11:08:18 +030058
MichaelMorrisa2abf6e2020-03-10 12:37:48 +000059RUN chmod 770 ${JETTY_BASE}/startup.sh
Michael Lando9dd269d2017-02-20 01:04:22 +020060
sebdet30670ac2020-08-04 14:16:00 +020061ENTRYPOINT [ "sh", "-c", "${JETTY_BASE}/startup.sh"]