fix: dockerfile build errors#8735
Conversation
Updated Dockerfile to streamline installation and build process.
Summary of ChangesHello @barnabasbusa, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on rectifying build failures within the Docker environment by modernizing the dependency management and build steps. It integrates Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request successfully fixes the Docker build issues by updating the Dockerfile to use corepack for managing pnpm. The changes are a good step forward. I've included a couple of suggestions to further optimize the Dockerfile for better build performance and maintainability, such as using pnpm prune for dependency pruning and structuring the stages to avoid redundant commands.
| RUN corepack enable && corepack prepare --activate && \ | ||
| pnpm install --frozen-lockfile && \ | ||
| pnpm build && \ | ||
| pnpm install --non-interactive --frozen-lockfile --production | ||
| pnpm install --frozen-lockfile --prod |
There was a problem hiding this comment.
For better performance and to follow pnpm best practices, consider using pnpm prune --prod to remove development dependencies instead of running pnpm install again with the --prod flag. pnpm prune is specifically designed for this purpose and is more efficient as it only removes extraneous packages.
RUN corepack enable && corepack prepare --activate && \
pnpm install --frozen-lockfile && \
pnpm build && \
pnpm prune --prod
There was a problem hiding this comment.
pnpm prune is an interactive command, not good for CI.
|
|
||
| # Rebuild native deps | ||
| RUN pnpm rebuild | ||
| RUN corepack enable && pnpm rebuild |
There was a problem hiding this comment.
The corepack enable command is run in both the build_src and build_deps stages. To optimize the build process and reduce redundancy, you could create a common base stage where corepack is enabled once.
For example:
FROM node:24-slim AS base
RUN corepack enable
FROM base AS build_src
# ... no need for corepack enable here
FROM base AS build_deps
# ... no need for corepack enable hereThis would make the Dockerfile cleaner and potentially faster to build if the base layer is cached.
matthewkeil
left a comment
There was a problem hiding this comment.
Looks OK to me but would like @nazarhussain to give final approval as he is the person that worked on our pnpm transition
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## unstable #8735 +/- ##
=========================================
Coverage 52.02% 52.02%
=========================================
Files 848 848
Lines 64650 64650
Branches 4767 4767
=========================================
Hits 33632 33632
Misses 30949 30949
Partials 69 69 🚀 New features to boost your workflow:
|
|
🎉 This PR is included in v1.39.0 🎉 |
Updated Dockerfile to streamline installation and build process.
Motivation
After the last PR, the dockerfile wasn't building anymore. This PR fixes it.
Description
Closes #issue_number
AI Assistance Disclosure