From 453adb7de6b5b9ac29a24b98e39892f3efee4533 Mon Sep 17 00:00:00 2001 From: DataWearsAHood <44448030+DataWearsAHood@users.noreply.github.com> Date: Fri, 19 Jun 2026 14:08:01 -0400 Subject: [PATCH 1/5] fix: replace deprecated maintainer instruction with label Co-authored-by AI --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 775012a0..f4adc160 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM ubuntu:latest -MAINTAINER Shamal Faily +LABEL maintainer="Shamal Faily " ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update RUN apt-get install -y build-essential \ From a8992fe15d924f00cbd613a61adf45d65ea0cc23 Mon Sep 17 00:00:00 2001 From: DataWearsAHood <44448030+DataWearsAHood@users.noreply.github.com> Date: Fri, 19 Jun 2026 14:09:57 -0400 Subject: [PATCH 2/5] fix: reduce dockerfile layers Merge apt-get, copy, env, mkdir, and cleanup run steps to cut image layers. Co-authored-by AI --- Dockerfile | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/Dockerfile b/Dockerfile index f4adc160..b3fcfb8d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,7 @@ FROM ubuntu:latest LABEL maintainer="Shamal Faily " ARG DEBIAN_FRONTEND=noninteractive -RUN apt-get update -RUN apt-get install -y build-essential \ +RUN apt-get update && apt-get install -y build-essential \ python3-dev \ mysql-client \ graphviz \ @@ -22,21 +21,17 @@ RUN apt-get install -y build-essential \ apt-transport-https \ ca-certificates -RUN pip3 install wheel --break-system-packages -#Installing Python modules -COPY docker/requirements.txt / -RUN pip3 install -r requirements.txt --break-system-packages -COPY docker/wsgi_requirements.txt / +COPY docker/requirements.txt docker/wsgi_requirements.txt / +RUN pip3 install wheel --break-system-packages \ + && pip3 install -r requirements.txt --break-system-packages RUN pip3 install -r wsgi_requirements.txt --break-system-packages -#Environment Variable starts from here -ENV CAIRIS_SRC=/cairis/cairis -ENV CAIRIS_CFG_DIR=/cairis/docker -ENV CAIRIS_CFG=/cairis.cnf -ENV PYTHONPATH=/cairis +ENV CAIRIS_SRC=/cairis/cairis \ + CAIRIS_CFG_DIR=/cairis/docker \ + CAIRIS_CFG=/cairis.cnf \ + PYTHONPATH=/cairis -RUN mkdir /tmpDocker -RUN mkdir /images +RUN mkdir /tmpDocker /images #Clonning the repo RUN git clone --depth 1 -b master https://github.com/cairis-platform/cairis /cairis @@ -47,17 +42,19 @@ RUN mkdir /cairisTmp &&\ rm -rf /cairis/ &&\ mv /cairisTmp/ /cairis/ -COPY docker/cairis.cnf / -COPY docker/setupDb.sh / -COPY docker/createdb.sql / -COPY docker/addAccount.sh / +COPY \ + docker/cairis.cnf \ + docker/setupDb.sh \ + docker/createdb.sql \ + docker/addAccount.sh \ + / COPY docker/register_user.html /cairis/cairis/daemon/templates/security -RUN /cairis/cairis/bin/installUI.sh +RUN /cairis/cairis/bin/installUI.sh \ + && apt-get remove --purge -y git \ + && apt-get autoremove -y \ + && rm -rf /var/lib/apt/lists/* EXPOSE 8000 -RUN apt-get remove --purge -y git -RUN apt-get autoremove -y - CMD ["./setupDb.sh"] From 93966ba7a92263d2f5a723dab446e9ab5164c723 Mon Sep 17 00:00:00 2001 From: DataWearsAHood <44448030+DataWearsAHood@users.noreply.github.com> Date: Fri, 19 Jun 2026 14:28:16 -0400 Subject: [PATCH 3/5] docs: restore truncated license text in installUI.sh Co-authored-by AI --- cairis/bin/installUI.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cairis/bin/installUI.sh b/cairis/bin/installUI.sh index b99cb5d4..edf1ca61 100755 --- a/cairis/bin/installUI.sh +++ b/cairis/bin/installUI.sh @@ -13,10 +13,10 @@ # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the -# specific language go -# -# Author: Shamal Faily +# specific language governing permissions and limitations +# under the License. +# Author: Shamal Faily export UI_REPO=/tmp/cairis-ui rm -rf $UI_REPO From 2c1333c964899f90b256bd44079721462e4e88e0 Mon Sep 17 00:00:00 2001 From: DataWearsAHood <44448030+DataWearsAHood@users.noreply.github.com> Date: Fri, 19 Jun 2026 14:28:16 -0400 Subject: [PATCH 4/5] fix: replace apt-key yarn install with npm in installUI.sh Copy the fixed script into the image after cloning CAIRIS and split the UI build run step from git cleanup. Co-authored-by AI --- Dockerfile | 7 +++++-- cairis/bin/installUI.sh | 26 ++++++++++++++------------ 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index b3fcfb8d..9460884c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -48,10 +48,13 @@ COPY \ docker/createdb.sql \ docker/addAccount.sh \ / +COPY cairis/bin/installUI.sh /cairis/cairis/bin/installUI.sh COPY docker/register_user.html /cairis/cairis/daemon/templates/security -RUN /cairis/cairis/bin/installUI.sh \ - && apt-get remove --purge -y git \ +RUN chmod +x /cairis/cairis/bin/installUI.sh \ + && /cairis/cairis/bin/installUI.sh + +RUN apt-get remove --purge -y git \ && apt-get autoremove -y \ && rm -rf /var/lib/apt/lists/* diff --git a/cairis/bin/installUI.sh b/cairis/bin/installUI.sh index edf1ca61..3e4c9581 100755 --- a/cairis/bin/installUI.sh +++ b/cairis/bin/installUI.sh @@ -1,4 +1,5 @@ -#!/bin/bash -x +#!/bin/bash +set -euo pipefail # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information @@ -19,14 +20,15 @@ # Author: Shamal Faily export UI_REPO=/tmp/cairis-ui -rm -rf $UI_REPO -apt-get install curl -curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs -curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - -echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list -apt-get update && apt-get install -y yarn -apt-get install -y yarn -git clone https://github.com/cairis-platform/cairis-ui $UI_REPO -yarn --cwd $UI_REPO install --ignore-engines -yarn --cwd $UI_REPO run build -cp -r $UI_REPO/dist $CAIRIS_SRC +rm -rf "$UI_REPO" + +apt-get update +apt-get install -y curl ca-certificates gnupg +curl -fsSL https://deb.nodesource.com/setup_16.x | bash - +apt-get install -y nodejs +npm install -g yarn + +git clone https://github.com/cairis-platform/cairis-ui "$UI_REPO" +yarn --cwd "$UI_REPO" install --ignore-engines +yarn --cwd "$UI_REPO" run build +cp -r "$UI_REPO/dist" "$CAIRIS_SRC" From d17c22fcf34602c8ee17b021881a4b83567936b9 Mon Sep 17 00:00:00 2001 From: DataWearsAHood <44448030+DataWearsAHood@users.noreply.github.com> Date: Fri, 19 Jun 2026 14:58:56 -0400 Subject: [PATCH 5/5] fix: pin docker base to debian bookworm for python 3.11 compatibility CAIRIS imports imghdr, which was removed in Python 3.13+. Switch from ubuntu:latest to debian:bookworm-slim and adjust apt packages accordingly. Co-authored-by AI --- Dockerfile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9460884c..da337cc0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,25 +1,27 @@ -FROM ubuntu:latest +FROM debian:bookworm-slim +# Pin to Bookworm (Python 3.11). CAIRIS uses imghdr, which was removed in Python 3.13+. LABEL maintainer="Shamal Faily " ARG DEBIAN_FRONTEND=noninteractive -RUN apt-get update && apt-get install -y build-essential \ +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential \ python3-dev \ - mysql-client \ + default-mysql-client \ graphviz \ python3-pip \ python3-numpy \ python3-mysqldb \ git \ default-libmysqlclient-dev \ - python3-apt \ libxml2-dev \ libxslt1-dev \ libssl-dev \ + libmagic1 \ apache2 \ apache2-dev \ poppler-utils \ python3-setuptools \ - apt-transport-https \ - ca-certificates + ca-certificates \ + && rm -rf /var/lib/apt/lists/* COPY docker/requirements.txt docker/wsgi_requirements.txt / RUN pip3 install wheel --break-system-packages \