-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
really fix packages/halmos/Dockerfile
- Loading branch information
1 parent
b9cf162
commit 6c3af34
Showing
2 changed files
with
16 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,35 @@ | ||
FROM ghcr.io/a16z/halmos-builder:latest | ||
|
||
# inspired by https://hynek.me/articles/docker-uv/ | ||
|
||
# - enable the virtual environment | ||
# - install halmos and its dependencies in UV_PROJECT_ENVIRONMENT | ||
# - enable bytecode compilation for faster startup | ||
# - disable downloading any additional packages | ||
# - use copy mode for linking instead of symlinking (because we mount to /src temporarily) | ||
ENV PATH="/halmos/.venv/bin:$PATH" \ | ||
UV_PROJECT_ENVIRONMENT='/halmos/.venv' \ | ||
ENV PATH="/halmos/bin:$PATH" \ | ||
VIRTUAL_ENV='/halmos' \ | ||
UV_PROJECT_ENVIRONMENT='/halmos' \ | ||
UV_COMPILE_BYTECODE=1 \ | ||
UV_PYTHON=python3.13 \ | ||
UV_PYTHON_DOWNLOADS=never \ | ||
UV_LINK_MODE=copy | ||
|
||
# Install halmos, assuming it is checked out in the current host directory | ||
RUN --mount=type=bind,source=../..,target=/src,readonly=false \ | ||
cd /src && \ | ||
uv sync --frozen --extra dev | ||
uv sync --frozen --extra dev --no-editable | ||
|
||
# Set a nicer prompt | ||
ENV IMAGE_NAME=halmos | ||
RUN echo 'PS1="($IMAGE_NAME) \[\033[1;32m\]\u@\h \[\033[1;35m\]\w \$\[\033[0m\] "' >> /root/.bashrc | ||
|
||
# optional: print python version, site packages, and check that halmos can be imported | ||
RUN <<EOT | ||
python -V | ||
python -Im site | ||
python -Ic 'import halmos' | ||
EOT | ||
|
||
WORKDIR /workspace | ||
CMD ["uv", "run", "halmos"] | ||
CMD ["halmos"] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.