sebdet | 30670ac | 2020-08-04 14:16:00 +0200 | [diff] [blame^] | 1 | FROM jetty:9.4.31-jre11-slim |
| 2 | |
| 3 | USER root |
| 4 | |
| 5 | # Install Chef |
| 6 | RUN 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 |
| 30 | ENV USER_JETTY="jetty" |
| 31 | ENV GROUP_JETTY="jetty" |
| 32 | ENV UID_JETTY="352070" |
| 33 | ENV GID_JETTY="35953" |
| 34 | |
| 35 | # Remove user: |
| 36 | RUN deluser ${USER_JETTY} |
| 37 | #RUN delgroup ${GROUP_JETTY} |
| 38 | RUN echo "${USER_JETTY}:x:${UID_JETTY}:${GID_JETTY}::/home/${USER_JETTY}:Linux User,,,:/home/jetty:/bin/false" >> /etc/passwd |
| 39 | RUN echo "${GROUP_JETTY}:x:${GID_JETTY}:${USER_JETTY}" >> /etc/group |
| 40 | RUN echo "${USER_JETTY}:!:17501:0:99999:7:::" >> /etc/shadow |
| 41 | RUN mkdir /home/${USER_JETTY} && chown ${USER_JETTY}:${GROUP_JETTY} /home/${USER_JETTY} |
| 42 | RUN chown -R jetty:jetty ${JETTY_BASE}/webapps /var/lib/jetty |
| 43 | |
| 44 | USER jetty |
Avi Ziv | c175a0d | 2018-03-15 13:21:44 +0200 | [diff] [blame] | 45 | |
MichaelMorris | a2abf6e | 2020-03-10 12:37:48 +0000 | [diff] [blame] | 46 | COPY --chown=jetty:jetty chef-solo ${JETTY_BASE}/chef-solo/ |
MichaelMorris | a2abf6e | 2020-03-10 12:37:48 +0000 | [diff] [blame] | 47 | COPY --chown=jetty:jetty chef-repo/cookbooks ${JETTY_BASE}/chef-solo/cookbooks/ |
Satoshi Fujii | a4beafe | 2019-06-17 13:25:22 +0900 | [diff] [blame] | 48 | ADD --chown=jetty:jetty onboarding-be-*.war ${JETTY_BASE}/webapps/ |
Satoshi Fujii | a4beafe | 2019-06-17 13:25:22 +0900 | [diff] [blame] | 49 | ADD --chown=jetty:jetty api-docs.war ${JETTY_BASE}/webapps/ |
sebdet | 30670ac | 2020-08-04 14:16:00 +0200 | [diff] [blame^] | 50 | COPY --chown=jetty:jetty startup.sh ${JETTY_BASE}/ |
Avi Ziv | c175a0d | 2018-03-15 13:21:44 +0200 | [diff] [blame] | 51 | |
MichaelMorris | a2abf6e | 2020-03-10 12:37:48 +0000 | [diff] [blame] | 52 | RUN chmod 770 ${JETTY_BASE}/startup.sh |
Avi Ziv | c175a0d | 2018-03-15 13:21:44 +0200 | [diff] [blame] | 53 | |
sebdet | 30670ac | 2020-08-04 14:16:00 +0200 | [diff] [blame^] | 54 | ENTRYPOINT [ "sh", "-c", "${JETTY_BASE}/startup.sh"] |