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 | 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 |
| 31 | ENV USER_JETTY="jetty" |
| 32 | ENV GROUP_JETTY="jetty" |
| 33 | ENV UID_JETTY="352070" |
| 34 | ENV GID_JETTY="35953" |
| 35 | |
| 36 | # Remove user: |
| 37 | RUN deluser ${USER_JETTY} |
| 38 | #RUN delgroup ${GROUP_JETTY} |
| 39 | RUN echo "${USER_JETTY}:x:${UID_JETTY}:${GID_JETTY}::/home/${USER_JETTY}:Linux User,,,:/home/jetty:/bin/false" >> /etc/passwd |
| 40 | RUN echo "${GROUP_JETTY}:x:${GID_JETTY}:${USER_JETTY}" >> /etc/group |
| 41 | RUN echo "${USER_JETTY}:!:17501:0:99999:7:::" >> /etc/shadow |
| 42 | RUN mkdir /home/${USER_JETTY} && chown ${USER_JETTY}:${GROUP_JETTY} /home/${USER_JETTY} |
| 43 | RUN chown -R jetty:jetty ${JETTY_BASE}/webapps /var/lib/jetty |
| 44 | |
| 45 | USER jetty |
Michael Lando | 9dd269d | 2017-02-20 01:04:22 +0200 | [diff] [blame] | 46 | |
MichaelMorris | a2abf6e | 2020-03-10 12:37:48 +0000 | [diff] [blame] | 47 | RUN mkdir -p ${JETTY_BASE}/config/catalog-fe |
Michael Lando | 9dd269d | 2017-02-20 01:04:22 +0200 | [diff] [blame] | 48 | |
MichaelMorris | a2abf6e | 2020-03-10 12:37:48 +0000 | [diff] [blame] | 49 | COPY --chown=jetty:jetty chef-solo ${JETTY_BASE}/chef-solo/ |
| 50 | |
| 51 | COPY --chown=jetty:jetty chef-repo/cookbooks ${JETTY_BASE}/chef-solo/cookbooks/ |
Michael Lando | 9dd269d | 2017-02-20 01:04:22 +0200 | [diff] [blame] | 52 | |
Satoshi Fujii | a4beafe | 2019-06-17 13:25:22 +0900 | [diff] [blame] | 53 | ADD --chown=jetty:jetty onboarding*.war ${JETTY_BASE}/webapps/ |
Areli Fuss | 0a89f59 | 2017-09-11 10:27:29 +0300 | [diff] [blame] | 54 | |
Satoshi Fujii | a4beafe | 2019-06-17 13:25:22 +0900 | [diff] [blame] | 55 | ADD --chown=jetty:jetty catalog-fe-*.war ${JETTY_BASE}/webapps/ |
Areli Fuss | 0a89f59 | 2017-09-11 10:27:29 +0300 | [diff] [blame] | 56 | |
MichaelMorris | a2abf6e | 2020-03-10 12:37:48 +0000 | [diff] [blame] | 57 | COPY --chown=jetty:jetty startup.sh ${JETTY_BASE} |
Michael Lando | aa61644 | 2017-10-24 11:08:18 +0300 | [diff] [blame] | 58 | |
MichaelMorris | a2abf6e | 2020-03-10 12:37:48 +0000 | [diff] [blame] | 59 | RUN chmod 770 ${JETTY_BASE}/startup.sh |
Michael Lando | 9dd269d | 2017-02-20 01:04:22 +0200 | [diff] [blame] | 60 | |
sebdet | 30670ac | 2020-08-04 14:16:00 +0200 | [diff] [blame] | 61 | ENTRYPOINT [ "sh", "-c", "${JETTY_BASE}/startup.sh"] |