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

chore: auto-detect preferred package manager in Dockerfile #38693

Merged
merged 3 commits into from
Jul 18, 2022

Conversation

balazsorban44
Copy link
Member

Noticed while I had a look at #38686. We don't need to ask the user to comment in/out sections in the Dockerfile, as we can detect the package manager they prefer based on which lockfile we copied over.

Bug

  • Related issues linked using fixes #number
  • Integration tests added
  • Errors have helpful link attached, see contributing.md

Feature

  • Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
  • Related issues linked using fixes #number
  • Integration tests added
  • Documentation added
  • Telemetry added. In case of a feature if it's used or not.
  • Errors have helpful link attached, see contributing.md

Documentation / Examples

  • Make sure the linting passes by running pnpm lint
  • The examples guidelines are followed from our contributing doc

@ijjk ijjk added the examples Issue/PR related to examples label Jul 15, 2022
RUN \
[ -f yarn.lock ] && yarn --frozen-lockfile --prod || \
[ -f package-lock.json ] && npm ci || \
[ -f pnpm-lock.yaml ] && yarn global add pnpm && pnpm fetch --prod && pnpm i -r --offline --prod || \
Copy link
Member Author

Choose a reason for hiding this comment

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

There is wget -qO- https://get.pnpm.io/install.sh | sh - also, but I got some errors while trying that locally, so I stuck with yarn global add pnpm. Is this a bad idea? 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

Why not npm i pnpm -g🤔?
https://pnpm.io/installation#using-npm

Copy link
Member Author

Choose a reason for hiding this comment

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

yarn might be slightly faster, I think. haven't tested it though

@ijjk ijjk merged commit 35a3243 into canary Jul 18, 2022
@ijjk ijjk deleted the chore/issue-38686 branch July 18, 2022 18:45
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
examples Issue/PR related to examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants