Skip to content
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

Merged
merged 10 commits into from
Oct 19, 2024
Merged

Patch Pnpm Dockerfile #1714

merged 10 commits into from
Oct 19, 2024

Conversation

samchungy
Copy link
Contributor

@samchungy samchungy commented Oct 17, 2024

Corepack seems to always fetch the latest package manager if you don't have a package.json present despite us installing a specific version of pnpm beforehand. This autofixes our Dockerfiles to always mount the package.json file when running a pnpm command

https://seekchat.slack.com/archives/C07C02YUF9S/p1729154703475989?thread_ts=1729142626.867769&cid=C07C02YUF9S

Copy link

changeset-bot bot commented Oct 17, 2024

🦋 Changeset detected

Latest 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 =
Copy link
Contributor Author

@samchungy samchungy Oct 17, 2024

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.

Copy link
Contributor

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!

@samchungy samchungy marked this pull request as ready for review October 18, 2024 00:02
@samchungy samchungy requested a review from a team as a code owner October 18, 2024 00:02
Copy link
Contributor

@AaronMoat AaronMoat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

.changeset/strange-cameras-brake.md Outdated Show resolved Hide resolved
.changeset/strange-cameras-brake.md Outdated Show resolved Hide resolved
@samchungy samchungy merged commit 91af3b6 into main Oct 19, 2024
15 checks passed
@samchungy samchungy deleted the patchy-patch branch October 19, 2024 03:16
@seek-oss-ci seek-oss-ci mentioned this pull request Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants