Skip to content

Instantly share code, notes, and snippets.

@skhatri
Created June 24, 2020 12:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skhatri/bbfd334c7f9f2aa1f3464f1bac2d98aa to your computer and use it in GitHub Desktop.
Save skhatri/bbfd334c7f9f2aa1f3464f1bac2d98aa to your computer and use it in GitHub Desktop.
ubi minimal docker java11 microservices
FROM registry.access.redhat.com/ubi8/ubi-minimal
LABEL base=ubi8 engine=jvm version=java11 timezone=UTC port=8080 dir=/opt/app user=app
RUN microdnf install java-11-openjdk-headless openssl hostname bash curl tzdata shadow-utils && microdnf clean all
ENV JAVA_HOME=/usr/lib/jvm/jre-11
ENV TZ=UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
EXPOSE 8080
RUN mkdir -p /opt/app && ln -s /opt/app /lib
WORKDIR /opt/app
RUN groupadd --system --gid=1000 app\
&& useradd --system --no-log-init --gid app --uid=1000 app \
&& chown -R app:app /opt/app
USER root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment