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

[rush] building docker image: ERROR: Current PNPM store path does not match the last one used. #3690

Closed
jakub-murin opened this issue Oct 10, 2022 · 1 comment

Comments

@jakub-murin
Copy link

jakub-murin commented Oct 10, 2022

Summary

I have rash monorepo consisting of 3 workspaces:

apps/backend - a NestJS backend microservice
apps/frontend- a React SPA
schema - shared datatypes (DTO/payloads)

I'm attempting to create a Dockerfile to build an image of the backend app.

Repro steps

The Dockerfile in apps/backend

FROM node:18-bullseye-slim AS build
WORKDIR /usr/src/app
COPY . /usr/src/app
RUN node common/scripts/install-run-rush.js install
RUN node common/scripts/install-run-rush.js build --verbose --to @sfp-cc/backend

FROM gcr.io/distroless/nodejs:18
COPY --from=build /usr/src/monorepo/apps/backend /usr/src/app
WORKDIR /usr/src/app
EXPOSE 3000
CMD [ "node", "dist/main" ]

When I run docker build theImage:v1 -f apps/backend/Dockerfile (from the root directory) the install-run-rush.js install step fails with

#10 1.891 Checking installation in "/usr/src/app/common/temp"
#10 1.892 ERROR: Current PNPM store path does not match the last one used. This may cause
#10 1.892 inconsistency in your builds.
#10 1.892 If you wish to install with the new store path, please run "rush update
#10 1.892 --purge"
#10 1.892
#10 1.892 Old Path: /Users/userX/src/perso/projectX/common/temp/pnpm-store
#10 1.892 New Path: /usr/src/app/common/temp/pnpm-store

I've been trying to find an example of how to build a docker image of a rush monorepo subproject but couldn't find any.

Question Answer
@microsoft/rush globally installed version? 5.77.3
rushVersion from rush.json? 5.77.3
useWorkspaces from rush.json? yes
Operating system? MacOS M1
Would you consider contributing a PR? Yes
Node.js version (node -v)? v18.10.0
@D4N14L
Copy link
Member

D4N14L commented Oct 12, 2022

This issue was resolved in 5.81.0: #3660

@D4N14L D4N14L closed this as completed Oct 12, 2022
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

No branches or pull requests

2 participants