From ef78db26802e8d2b06d3210a05628c9f9ff3a817 Mon Sep 17 00:00:00 2001 From: Tobias Wolf Date: Wed, 17 Apr 2024 19:59:29 +0200 Subject: [PATCH] Use Ubuntu 24.04 as base image for Rookify containers Signed-off-by: Tobias Wolf --- Dockerfile | 29 ++++++++++++----------------- setup.py | 2 +- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9226b54..2039fff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ # Builder FROM python:3.11 as builder -# Note: this value currenlty needs to be the same as the value returned from get_version() from setup.py -ARG ROOKIFY_VERSION=0.0.1 +ARG ROOKIFY_VERSION=0.0.0.dev0 +ENV ROOKIFY_VERSION=$ROOKIFY_VERSION WORKDIR /app/rookify @@ -12,31 +12,26 @@ RUN python -m build /app/rookify/ # Base -From quay.io/ceph/ceph:v18.2.2 as base +FROM ubuntu:24.04 as base -COPY requirements.txt /app/rookify/src/ +# Update packages required for Rookify +RUN apt-get update && apt-get install -qy python3-pip-whl python3-rados python3-venv -# Install Librados: -# Get rados version from requirements.txt and install it using apt, -# because librados does not exist as pip package -RUN cat /etc/os-release && dnf install -y python39-pip python3-virtualenv +# Generate virtualenv including system packages with simlinks +RUN /usr/bin/python3 -m venv --system-site-packages /app/rookify/.venv -# Install package with requirements including systempackages with simlinks -RUN /usr/bin/python3.9 -m venv --system-site-packages /app/rookify/.venv && \ - /app/rookify/.venv/bin/pip3.9 install --ignore-installed -r /app/rookify/src/requirements.txt # Rookify FROM base AS rookify LABEL org.opencontainers.image.source="https://github.com/SovereignCloudStack/rookify" -ARG ROOKIFY_VERSION=0.0.1 + +ARG ROOKIFY_VERSION=0.0.0.dev0 +ENV ROOKIFY_VERSION=$ROOKIFY_VERSION WORKDIR /app/rookify COPY --from=builder /app/rookify/dist/Rookify-${ROOKIFY_VERSION}-py3-none-any.whl ./src/ -RUN .venv/bin/pip3.9 install ./src/Rookify-${ROOKIFY_VERSION}-py3-none-any.whl - -# This is for debugging and will not be used when ENTRYPOINT is set -CMD ["sleep", "infinity"] +RUN .venv/bin/pip3 install ./src/Rookify-${ROOKIFY_VERSION}-py3-none-any.whl # Set the ENTRYPOINT to activate the venv and then run the 'rookify' command -ENTRYPOINT ["/app/rookify/bin/rookify"] +ENTRYPOINT ["./bin/rookify"] diff --git a/setup.py b/setup.py index 7896859..c4f7656 100644 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ def get_version() -> str: :since: v0.0.1 """ - return os.environ.get("ROOKIFY_VERSION", "0.0.0-dev") + return os.environ.get("ROOKIFY_VERSION", "0.0.0.dev0") _setup: Dict[str, Any] = {