blob: 9c6275d87a694fb415b3fe530429b8b87011c226 [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 vim \
12 make \
13 gcc \
14 ruby \
15 ruby-dev \
16 libffi-dev \
17 libxml2-dev && \
18 gem install \
19 chef:13.8.5 \
20 berkshelf:6.3.1 \
21 io-console:0.4.6 \
22 etc webrick \
23 --no-document && \
24 gem cleanup && \
25 apt-get update -y && \
26 apt-get install -y binutils jq && \
27 apt-get clean
28
29# Replace Jetty user ID
30ENV USER_JETTY="jetty"
31ENV GROUP_JETTY="jetty"
32ENV UID_JETTY="352070"
33ENV GID_JETTY="35953"
34
35# Remove user:
36RUN deluser ${USER_JETTY}
37#RUN delgroup ${GROUP_JETTY}
38RUN echo "${USER_JETTY}:x:${UID_JETTY}:${GID_JETTY}::/home/${USER_JETTY}:Linux User,,,:/home/jetty:/bin/false" >> /etc/passwd
39RUN echo "${GROUP_JETTY}:x:${GID_JETTY}:${USER_JETTY}" >> /etc/group
40RUN echo "${USER_JETTY}:!:17501:0:99999:7:::" >> /etc/shadow
41RUN mkdir /home/${USER_JETTY} && chown ${USER_JETTY}:${GROUP_JETTY} /home/${USER_JETTY}
42RUN chown -R jetty:jetty ${JETTY_BASE}/webapps /var/lib/jetty
43
44USER jetty
Avi Zivc175a0d2018-03-15 13:21:44 +020045
MichaelMorrisa2abf6e2020-03-10 12:37:48 +000046COPY --chown=jetty:jetty chef-solo ${JETTY_BASE}/chef-solo/
MichaelMorrisa2abf6e2020-03-10 12:37:48 +000047COPY --chown=jetty:jetty chef-repo/cookbooks ${JETTY_BASE}/chef-solo/cookbooks/
Satoshi Fujiia4beafe2019-06-17 13:25:22 +090048ADD --chown=jetty:jetty onboarding-be-*.war ${JETTY_BASE}/webapps/
Satoshi Fujiia4beafe2019-06-17 13:25:22 +090049ADD --chown=jetty:jetty api-docs.war ${JETTY_BASE}/webapps/
sebdet30670ac2020-08-04 14:16:00 +020050COPY --chown=jetty:jetty startup.sh ${JETTY_BASE}/
Avi Zivc175a0d2018-03-15 13:21:44 +020051
MichaelMorrisa2abf6e2020-03-10 12:37:48 +000052RUN chmod 770 ${JETTY_BASE}/startup.sh
Avi Zivc175a0d2018-03-15 13:21:44 +020053
sebdet30670ac2020-08-04 14:16:00 +020054ENTRYPOINT [ "sh", "-c", "${JETTY_BASE}/startup.sh"]