Skip to content

build(docker): migrate to uv for deterministic builds and fix context#52

Merged
JacksonFergusonDev merged 2 commits intomainfrom
docker
Feb 3, 2026
Merged

build(docker): migrate to uv for deterministic builds and fix context#52
JacksonFergusonDev merged 2 commits intomainfrom
docker

Conversation

@JacksonFergusonDev
Copy link
Owner

Summary

This PR overhauls the Docker build process by replacing pip with uv. It resolves build failures caused by stale requirements.txt hashes and execution errors caused by leaking the local macOS/Linux virtual environment into the container.

Key Changes

  • Dockerfile:
    • Switched to ghcr.io/astral-sh/uv to handle dependencies.
    • Replaced pip install with uv sync --frozen to enforce strict adherence to uv.lock.
    • Added pyproject.toml and uv.lock to the build steps.
  • .dockerignore:
    • Allowed uv.lock: Previously ignored, now required for the build.
    • Ignored .venv: Prevents the local host's virtual environment (e.g., macOS binaries) from being copied into the Linux container, fixing the exec format error crash.
    • Ignored requirements.txt: no longer used in the build process.

Testing

  • Build Verification: Ran docker build -t star-ground-test . successfully.
  • Runtime Verification: Ran docker run -p 8501:8501 star-ground-test and confirmed Streamlit launches without crashing.

* Un-ignores `uv.lock` so it can be copied into the build context (required for `uv sync`).
* Ignores the local `.venv` directory to prevent it from overwriting the container's environment, which was causing "Exec format" errors.
* Ignores `requirements.txt` as it is replaced by the lockfile.
Replaces the legacy `pip install -r requirements.txt` workflow with `uv sync` inside the Dockerfile. This ensures the container uses the exact dependency versions defined in `uv.lock` and resolves hash mismatch errors caused by stale requirement files.
@JacksonFergusonDev JacksonFergusonDev merged commit b7a41ac into main Feb 3, 2026
1 check passed
@JacksonFergusonDev JacksonFergusonDev deleted the docker branch February 3, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant