-
Notifications
You must be signed in to change notification settings - Fork 34
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
Patch Pnpm Dockerfile #1714
Patch Pnpm Dockerfile #1714
Conversation
🦋 Changeset detectedLatest commit: cccb7f6 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
||
const DOCKER_IMAGE_CONFIG_REGEX = | ||
/^(RUN )(pnpm config set store-dir \/root\/.pnpm-store)/gm; | ||
const DOCKER_IMAGE_FETCH_REGEX = |
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.
Tries to look for the patched line:
--mount=type=bind,source=package.json,target=package.json
inbetween
RUN --mount=type=bind,source=.npmrc,target=.npmrc
and
pnpm fetch or pnpm install
It uses a negative lookahead so it fails if it already sees the patched line.
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.
This is challenging to review but the tests look good!
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.
👏
Co-authored-by: Aaron Moat <[email protected]>
Corepack seems to always fetch the latest package manager if you don't have a
package.json
present despite us installing a specific version ofpnpm
beforehand. This autofixes our Dockerfiles to always mount the package.json file when running a pnpm commandhttps://seekchat.slack.com/archives/C07C02YUF9S/p1729154703475989?thread_ts=1729142626.867769&cid=C07C02YUF9S