Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,11 @@ RUN mkosi --version
# Install project dependencies into a persistent venv so that
# `uv run` inside the container reuses it instead of recreating one.
COPY pyproject.toml /opt/captain/pyproject.toml
COPY uv.lock /opt/captain/uv.lock
COPY captain /opt/captain/captain
COPY build.py /opt/captain/build.py
RUN uv venv /opt/captain-venv && \
VIRTUAL_ENV=/opt/captain-venv uv pip install --project /opt/captain /opt/captain
UV_PROJECT_ENVIRONMENT=/opt/captain-venv uv sync --frozen --project /opt/captain
Comment thread
jacobweinstock marked this conversation as resolved.

# Point uv at the pre-built venv for all future runs.
ENV VIRTUAL_ENV=/opt/captain-venv
Expand Down
6 changes: 3 additions & 3 deletions captain/cli/_stages.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ def _build_mkosi_stage(cfg: Config, extra_args: list[str]) -> None:
return

# --- idempotency --------------------------------------------------
initramfs_image = cfg.initramfs_output / "image.cpio.zst"
existing = sorted(cfg.initramfs_output.glob("*.cpio*"))
force = "--force" in cfg.mkosi_args
if initramfs_image.is_file() and not force:
log.info("Initramfs already built: %s (use --force to rebuild)", initramfs_image)
if existing and not force:
log.info("Initramfs already built: %s (use --force to rebuild)", existing[0])
Comment thread
jacobweinstock marked this conversation as resolved.
return

mkosi_args = list(cfg.mkosi_args) + list(extra_args)
Expand Down