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

Trying to run corepack in node/node-lts results in corepack: not found #2431

Open
revosw opened this issue Apr 2, 2024 · 0 comments
Open
Labels
needs-triage applied to all new customer/user issues. Removed after triage occurs.

Comments

@revosw
Copy link

revosw commented Apr 2, 2024

Which image/versions are related to this issue/feature request?

node and node-lts

Issue/Feature description

I'm trying to use pnpm to install packages. I get the below error when using this dockerfile

 => ERROR [stage-0 3/7] RUN corepack          0.3s 
------
 > [stage-0 3/7] RUN corepack:
0.244 /bin/sh: corepack: not found
------
Dockerfile:3
--------------------
   1 |     FROM chainguard/node:latest-dev
   2 |     WORKDIR /app
   3 | >>> RUN corepack enable
   4 |     COPY package.json ./
   5 |     RUN npm install
--------------------
ERROR: failed to solve: process "/bin/sh -c corepack" did not complete successfully: exit code: 127
FROM chainguard/node:latest-dev
WORKDIR /app
RUN corepack enable
COPY package.json pnpm-lock.yaml ./
RUN pnpm install
COPY . ./
RUN npm run build

FROM chainguard/node:latest
WORKDIR /app
COPY --from=0 /app/build /app/node_modules /app/
CMD ["npm", "run", "start"]

Here is a reproduction repo for the exact setup I used
https://github.com/revosw/wolfi-pnpm

Here is a step-by-step on how I made this repo:

  1. In an empty folder, run npx create-remix@latest and complete the wizard
  2. Create .dockerignore
node_modules
build
  1. Create Dockerfile
FROM chainguard/node:latest-dev
WORKDIR /app
RUN corepack enable
COPY package.json pnpm-lock.yaml ./
RUN pnpm install
COPY . ./
RUN npm run build

FROM chainguard/node:latest
WORKDIR /app
COPY --from=0 /app/build /app/node_modules /app/
CMD ["npm", "run", "start"]
  1. Run docker build -t wolfi-remix .
@revosw revosw added the needs-triage applied to all new customer/user issues. Removed after triage occurs. label Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage applied to all new customer/user issues. Removed after triage occurs.
Projects
None yet
Development

No branches or pull requests

1 participant