# Build Dangerzone from source using Poetry
# Stage 1: builder - installs dependencies and builds a wheel from the repo
FROM python:3.12.13-bookworm AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Install build tools
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential git curl ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy only the Poetry configuration first to leverage Docker cache
COPY pyproject.toml poetry.lock* ./
# Install Poetry and install project dependencies
RUN python -m pip install --upgrade pip \
&& pip install poetry \
&& poetry config virtualenvs.create false \
&& poetry install --no-interaction --no-ansi
# Copy the rest of the repository (source code, assets, etc.)
COPY . .
# Build a wheel distribution of the project
RUN poetry build -f wheel
# Stage 2: runtime image - minimal Python runtime with the built wheel installed
FROM python:3.12.13-bookworm
ENV DEBIAN_FRONTEND=noninteractive
# Install minimal runtime dependencies (Qt/GUI related libs may be required by PySide6)
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libgl1 libxext6 libxrender1 libx11-6 \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy the built wheel from the builder stage and install it
COPY --from=builder /app/dist/*.whl /tmp/
RUN python -m pip install --no-cache-dir /tmp/*.whl
# Expose the default command to run Dangerzone. The CLI/GUI entrypoint is
# defined in pyproject.toml as the "dangerzone" script.
CMD ["dangerzone"]
# Ignore common development and VCS files .git __pycache__/ *.pyc *.pyo *.pyd build/ dist/ *.egg-info/ .env .envrc venv/ *.swp *.swo *.bak .DS_Store # Ignore large datasets or generated artifacts tests/test_docs_large/ assets/ shared/ dangerzone/container_helpers/repro-sources-list.sh dangerzone/container_helpers/gvisor.key # Exclude local config and CI artifacts Dockerfile.env Dockerfile.in
Summary (under 1500 chars):
- Exact error message and exit code:
- Error: The current project could not be installed: No file/folder found for package dangerzone
- Exit code: 1
- Follow-up guidance included in output:
- If you do not want to install the current project use --no-root.
- If you want to use Poetry only for dependency management but not for packaging, you can disable package mode by setting package-mode = false in your pyproject.toml file.
- If you did intend to install the current project, you may need to set `packages` in your pyproject.toml file.
- Failing command/step:
- [builder 5/7] RUN python -m pip install --upgrade pip && pip install poetry && poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi
- Missing packages or files mentioned:
- No file/folder found for package dangerzone (the current project to be installed by Poetry)
- Implication: pyproject.toml may be missing a correctly defined packages section, or the package directory is not present.
- Version mismatch info:
- The log shows the project is dangerzone (0.10.0), but the failure is due to packaging configuration rather than dependency/version incompatibilities. No explicit version mismatch is reported; the message points to packaging setup (packages in pyproject.toml or package-mode).# Build Dangerzone from source using Poetry
# Stage 1: builder - installs dependencies and builds a wheel from the repo
FROM python:3.12.13-bookworm AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Install build tools
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential git curl ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy only the Poetry configuration first to leverage Docker cache
COPY pyproject.toml poetry.lock* ./
# Install Poetry and install project dependencies
RUN python -m pip install --upgrade pip \
&& pip install poetry \
&& poetry config virtualenvs.create false \
&& poetry install --no-interaction --no-ansi --no-root
# Copy the rest of the repository (source code, assets, etc.)
COPY . .
# Build a wheel distribution of the project
RUN poetry build -f wheel
# Stage 2: runtime image - minimal Python runtime with the built wheel installed
FROM python:3.12.13-bookworm
ENV DEBIAN_FRONTEND=noninteractive
# Install minimal runtime dependencies (Qt/GUI related libs may be required by PySide6)
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libgl1 libxext6 libxrender1 libx11-6 \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy the built wheel from the builder stage and install it
COPY --from=builder /app/dist/*.whl /tmp/
RUN python -m pip install --no-cache-dir /tmp/*.whl
# Expose the default command to run Dangerzone. The CLI/GUI entrypoint is
# defined in pyproject.toml as the "dangerzone" script.
CMD ["dangerzone"]
# Build Dangerzone from source without Poetry for a simpler, reproducible build
# Stage 1: builder - install dependencies and build a wheel from the repo
FROM python:3.12.13-bookworm AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Install build tools and basic dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential git curl ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy the repository
COPY . .
# Upgrade pip and ensure wheel/build tools are present
RUN python -m pip install --upgrade pip \
&& python -m pip install --no-cache-dir wheel setuptools build
# Build a wheel from the project using setup.py
RUN python -m build --wheel --outdir dist
# Stage 2: runtime image - minimal Python runtime with the built wheel installed
FROM python:3.12.13-bookworm
ENV DEBIAN_FRONTEND=noninteractive
# Install runtime dependencies for GUI stack (Qt/PySide6)
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libgl1 libxext6 libxrender1 libx11-6 \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy the built wheel from the builder stage and install it
COPY --from=builder /app/dist/*.whl /tmp/
RUN python -m pip install --no-cache-dir /tmp/*.whl
# Expose the default command to run Dangerzone. The CLI/GUI entrypoint is
# defined in setup.py/pyproject.toml as the "dangerzone" script.
CMD ["dangerzone"]
Smoke [PASS]: command -v dangerzone >/dev/null && echo dangerzone-found Smoke [PASS]: dangerzone --help >/dev/null 2>&1 && echo help-ok || echo help-missing Smoke [PASS]: python -V >/dev/null 2>&1 && echo python-ok