Skip to content

Commit

Permalink
add trimmed down dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
hk10111 committed Oct 30, 2024
1 parent ea78c0d commit 70e40c0
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions base/Docker-refresh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
ARG MICRODIR=/microdir
ARG PACKAGES_TO_INSTALL="temurin-17-jre shadow-utils"

FROM registry.access.redhat.com/ubi8 AS BUILD
ARG MICRODIR
ARG PACKAGES_TO_INSTALL
RUN mkdir ${MICRODIR}

RUN printf "[temurin-jre] \n\
name=temurin-jre \n\
baseurl=https://packages.adoptium.net/artifactory/rpm/rhel/\$releasever/\$basearch \n\
enabled=1 \n\
gpgcheck=1 \n\
gpgkey=https://packages.adoptium.net/artifactory/api/gpg/key/public \n\
" > /etc/yum.repos.d/adoptium.repo

RUN yum --nodocs install -y --setopt=install_weak_deps=False ${PACKAGES_TO_INSTALL}

RUN yum clean all

FROM registry.access.redhat.com/ubi8-micro AS REFRESH
ARG MICRODIR
COPY --from=BUILD /usr/lib/jvm/temurin-17-jre/ ${MICRODIR}/jre/

ENV PATH="${MICRODIR}/jre/bin:${PATH}"

RUN echo "appuser:x:1001:1001::/home/appuser:/bin/sh" >> /etc/passwd && \
mkdir -p /home/appuser && \
chown 1001:1001 /home/appuser

USER appuser
WORKDIR /home/appuser

0 comments on commit 70e40c0

Please sign in to comment.