Skip to content

Commit

Permalink
Use Ubuntu 24.04 as base image for Rookify containers
Browse files Browse the repository at this point in the history
Signed-off-by: Tobias Wolf <[email protected]>
  • Loading branch information
NotTheEvilOne committed Apr 17, 2024
1 parent 88798a9 commit ef78db2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
29 changes: 12 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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"]
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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] = {
Expand Down

0 comments on commit ef78db2

Please sign in to comment.