From 79010054a074d4a05abeb28a43cc62430348773d Mon Sep 17 00:00:00 2001 From: Tom Tuffin Date: Fri, 25 Aug 2023 16:33:56 +0200 Subject: [PATCH] Use ansible-core to bring image size down to ~550mb --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 24e83857d..291841ef9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,11 +9,13 @@ 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 + +USER $USER_ID ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk +ENV PATH="${PATH}:$APP_DIR/.local/bin" RUN pip install -U pip \ - && pip install ansible \ + && pip install ansible-core \ ansible-runner \ jmespath \ asyncio \ @@ -26,5 +28,4 @@ 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" -USER $USER_ID RUN pip install .