Dockerfile48 lines · 1325 chars # Dockerfile for PerfKitBenchmarker based on Python 3.12 (bookworm)
FROM python:3.12.13-bookworm
WORKDIR /pkb
# Use bash as default shell
SHELL ["/bin/bash", "-lc"]
# Install system dependencies and build tools
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
build-essential \
libffi-dev \
libssl-dev \
zlib1g-dev \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
liblzma-dev \
libncurses5-dev \
libncursesw5-dev \
ca-certificates \
git \
curl \
; \
rm -rf /var/lib/apt/lists/*
# Install Python dependencies
COPY requirements.txt /pkb/
RUN pip install --no-cache-dir -r requirements.txt
# Copy the repository code
COPY . /pkb
# Do not install the package; rely on local source at /pkb
ENV PYTHONPATH=/pkb
# Create a simple wrapper script named 'pkb' to invoke the module entry point
RUN printf '#!/usr/bin/env bash\nexec python -m perfkitbenchmarker "$@"\n' > /usr/local/bin/pkb && chmod +x /usr/local/bin/pkb
# Install testing dependencies (if present)
RUN if [ -f requirements-testing.txt ]; then pip install --no-cache-dir -r requirements-testing.txt; fi
# Smoke tests: verify the CLI wrapper and module entry
CMD ["bash", "-lc", "pkb --version; python -m perfkitbenchmarker --version"]