From f10c5b8b41099b21ffb94a2a4ce4587651f95d4a Mon Sep 17 00:00:00 2001 From: omer-vishlitzky Date: Mon, 23 Mar 2026 08:10:50 +0200 Subject: [PATCH] MGMT-22799: add Containerfile for pytest test image Self-contained image with all tools needed to run the e2e test suite on a bare metal machine via podman. Depends on #18 (pyproject.toml and uv.lock must exist). --- .dockerignore | 10 ++++++++++ Containerfile | 26 ++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 .dockerignore create mode 100644 Containerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..d7541dbe9 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,10 @@ +.git +.venv +__pycache__ +*.pyc +.pytest_cache +reports/ +playbooks/ +roles/ +inventory/ +retry/ diff --git a/Containerfile b/Containerfile new file mode 100644 index 000000000..2737c8532 --- /dev/null +++ b/Containerfile @@ -0,0 +1,26 @@ +FROM registry.access.redhat.com/ubi9/ubi:latest + +ARG GRPCURL_VERSION=1.9.1 +ARG FULFILLMENT_CLI_VERSION=0.0.48 + +RUN dnf install -y python3.11 python3.11-pip && dnf clean all + +RUN curl -Lsf "https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable/openshift-client-linux.tar.gz" \ + | tar xz --no-same-owner -C /usr/local/bin oc kubectl + +COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv + +RUN curl -Lsf "https://github.com/fullstorydev/grpcurl/releases/download/v${GRPCURL_VERSION}/grpcurl_${GRPCURL_VERSION}_linux_x86_64.tar.gz" \ + | tar xz --no-same-owner -C /usr/local/bin grpcurl + +RUN curl -Lsfo /usr/local/bin/fulfillment-cli "https://github.com/osac-project/fulfillment-service/releases/download/v${FULFILLMENT_CLI_VERSION}/fulfillment-cli_Linux_x86_64" \ + && chmod +x /usr/local/bin/fulfillment-cli + +WORKDIR /tests + +COPY pyproject.toml uv.lock ./ +RUN uv sync --frozen --python python3.11 + +COPY . . + +ENV PATH="/tests/.venv/bin:$PATH"