-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
setup docker to use uv for installation #11001
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
# Link the ia CLI binary into /usr/local/bin so that it shows up | ||
# on the PATH. Do this instead of trying to modify the PATH, because | ||
# that causes headaches with su, cron, etc. | ||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you're not using uvx
, you could skip it.
Before: Pip install on my machine:
With uv:
Cut out 70s! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing has been working smoothly, so I think we're good to go! |
Testing what it would take to get UV working for our docker setup. It's supposed to be a lot faster.
A nice byproduct is that it actually simplifies the dockerfiles a bit
Before
docker build --no-cache -f docker/Dockerfile.olbase -t openlibrary/olbase:latest .
RUN python -m pip install --upgrade pip wheel && python -m pip install --default-timeout=100 -r requirements.txt 29.3s
docker compose build
RUN python -m pip install -r requirements_test.txt && python -m pip list --outdated 18.1s
RUN pip install $(grep -E 'webpy.git|web.py==|multipart==|Babel==' requirements.txt) 9.9s
Total time: 57.3 seconds
After
docker build --no-cache -f docker/Dockerfile.olbase -t openlibrary/olbase:latest .
RUN uv pip install --upgrade wheel 1.0s
RUN uv pip install -r requirements.txt 10.6s
docker compose build
RUN uv pip install -r requirements_test.txt && uv pip list --outdated 12.3s
RUN uv pip install $(grep -E 'webpy.git|web.py==|multipart==|Babel==' requirements.txt) 0.2s
Total time: 24.1 seconds
Technical
Testing
Screenshot
Stakeholders