From 733aef71de0cf1c5c9cbe666021f14782e16a30a Mon Sep 17 00:00:00 2001 From: Tom Tuffin Date: Fri, 25 Aug 2023 15:21:46 +0200 Subject: [PATCH] Working image using centos stream9 dev image Brings the total size down to 1.05gb, but we can probably do better. --- Dockerfile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index aa771ca9..24e83857 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,15 @@ FROM quay.io/centos/centos:stream9-development ARG USER_ID=${USER_ID:-1001} +ARG APP_DIR=${APP_DIR:-/app} ARG DEVEL_COLLECTION_LIBRARY=0 -WORKDIR $HOME USER 0 +RUN useradd -u $USER_ID -d $APP_DIR appuser +WORKDIR $APP_DIR +COPY . $WORKDIR +RUN chown -R $USER_ID $APP_DIR + RUN dnf install -y java-17-openjdk-devel python3-pip ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk RUN pip install -U pip \ @@ -21,8 +26,5 @@ RUN pip install -U pip \ RUN bash -c "if [ $DEVEL_COLLECTION_LIBRARY -ne 0 ]; then \ ansible-galaxy collection install git+https://github.com/ansible/event-driven-ansible.git --force; fi" -COPY . $WORKDIR -RUN chown -R $USER_ID ./ - USER $USER_ID RUN pip install .