From 94a1cc5160e83f41f966e75896dc3bf59fd9bfeb Mon Sep 17 00:00:00 2001 From: Ely Deckers Date: Sun, 19 Jan 2025 23:12:31 +0100 Subject: [PATCH] fix: pydantic issue in API --- api/21-alpine/Dockerfile | 10 ++++++++++ api/22-alpine/Dockerfile | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/api/21-alpine/Dockerfile b/api/21-alpine/Dockerfile index 0a9d2bf..9d7c163 100644 --- a/api/21-alpine/Dockerfile +++ b/api/21-alpine/Dockerfile @@ -16,6 +16,9 @@ LABEL org.label-schema.schema-version="1.0" \ RUN pip install --no-cache-dir --upgrade pip==22.0.4 +# Required for installation of Python sslpsk package +RUN apk add build-base openssl-dev + RUN adduser -D bareos USER bareos WORKDIR /home/bareos @@ -23,6 +26,13 @@ WORKDIR /home/bareos ENV PATH="/home/bareos/.local/bin:${PATH}" RUN pip install --no-cache-dir "bareos-restapi>=21*,<22*" +# Pin pydantic to 1.x version to circumvent +# https://github.com/barcus/bareos/issues/187 +RUN pip install --no-cache-dir "pydantic==1.10.21" + +# Support connection encryption via TLS-PSK +RUN pip install --no-cache-dir "sslpsk" + COPY --chown=bareos docker-entrypoint.sh /docker-entrypoint.sh RUN chmod a+x /docker-entrypoint.sh diff --git a/api/22-alpine/Dockerfile b/api/22-alpine/Dockerfile index 782ab96..80009a3 100644 --- a/api/22-alpine/Dockerfile +++ b/api/22-alpine/Dockerfile @@ -16,6 +16,9 @@ LABEL org.label-schema.schema-version="1.0" \ RUN pip install --no-cache-dir --upgrade pip==22.0.4 +# Required for installation of Python sslpsk package +RUN apk add build-base openssl-dev + RUN adduser -D bareos USER bareos WORKDIR /home/bareos @@ -23,6 +26,13 @@ WORKDIR /home/bareos ENV PATH="/home/bareos/.local/bin:${PATH}" RUN pip install --no-cache-dir "bareos-restapi>=22*,<23*" +# Pin pydantic to 1.x version to circumvent +# https://github.com/barcus/bareos/issues/187 +RUN pip install --no-cache-dir "pydantic==1.10.21" + +# Support connection encryption via TLS-PSK +RUN pip install --no-cache-dir "sslpsk" + COPY --chown=bareos docker-entrypoint.sh /docker-entrypoint.sh RUN chmod a+x /docker-entrypoint.sh