-
-
Notifications
You must be signed in to change notification settings - Fork 152
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
feat: 2.5x faster docker build with uv #2532
base: main
Are you sure you want to change the base?
Conversation
- Add new Dockerfile.uv using the faster uv package manager - Improve .dockerignore to reduce build context size - Build is 2.5x faster and has better caching properties - Final image size is slightly larger (698MB vs 525MB) 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]>
COPY --from=builder /build/dist/*.whl /wheels/ | ||
|
||
# Install the wheels with uv (using --system since we're in a Docker container) | ||
RUN uv pip install --system /wheels/*.whl |
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.
Can it not do --system
? I am not sure of the security implications of this, if it overrides any system installations that could expose an attack surface inside the container
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.
i think that's how you are supposed to install things in docker
noticed this inside the container, caused by
|
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.
Waiting on this to be resolved https://github.com/ApeWorX/ape/pull/2532/files#r1971652268
USER harambe | ||
|
||
# Set entrypoint | ||
ENTRYPOINT ["ape"] |
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.
ENTRYPOINT ["ape"] | |
ENTRYPOINT ["ape"] | |
Summary
Performance Analysis
This PR introduces a Docker build optimization using the uv package manager and an improved .dockerignore file. The changes are presented for the consideration of Ape maintainers and are not yet integrated into any CI or build pipelines.
Build Times Comparison
Detailed Step Analysis
Build Context Transfer:
transferring context: 2.34GB 11.8s
transferring context: 2.85MB 0.0s
File Copying Times:
COPY . . - DONE 13.3s
COPY . . - DONE 0.1s
Package Build/Install:
RUN pip wheel . - DONE 50.1s
RUN uv build --wheel . - DONE 4.5s
Image Size:
Key Performance Factors
Build Context Optimization:
UV Performance:
Build Process Structure:
Test plan
🤖 Generated with Claude Code