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

[BUG] Version npm@9.1.1 incompatible with Docker when userns-remap feature is enabled #5900

Open
2 tasks done
isiegl opened this issue Nov 28, 2022 · 3 comments
Open
2 tasks done
Assignees
Labels
Bug thing that needs fixing Priority 2 secondary priority issue Release 9.x work is associated with a specific npm 9 release

Comments

@isiegl
Copy link

isiegl commented Nov 28, 2022

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

FROM node:18.12.1-alpine AS base
WORKDIR /app
EXPOSE 3000

FROM node:18.12.1-alpine AS build
WORKDIR /src
COPY "FMC.GTMP.Twix.PDP.Web.Mock/Client/src" "temp/src"
COPY "FMC.GTMP.Twix.PDP.Web.Mock/Client/public" "temp/public"
COPY "FMC.GTMP.Twix.PDP.Web.Mock/Client/package.json" "temp/package.json"
COPY "FMC.GTMP.Twix.PDP.Web.Mock/Client/webpack.config.js" "temp/webpack.config.js"
WORKDIR /src/temp
RUN apk update
RUN npm install -g npm@9.1.1
RUN npm install

FROM base AS final
WORKDIR /app
ENV NODE_ENV production
COPY --from=build /src/temp ./

ENTRYPOINT ["npm", "run", "start"]

When enabling the userns-remap Docker feature and installing any NPM version above 9.1.1, the image TAR extraction process fails.

ERROR - failed to register layer: Error processing tar file(exit status 1): Container ID 369884941 cannot be mapped to a host IDErr: 0, Message: failed to register layer: Error processing tar file(exit status 1): Container ID 369884941 cannot be mapped to a host ID

Expected Behavior

The Docker image builds, the docker container starts successfully and the app is shown in the browser.

Steps To Reproduce

  1. Docker engine is running
  2. Enable the docker feature userns-remap
  3. Build the docker image based on the docker file content shared above

Environment

  • npm: 9.1.1
@nazario29
Copy link

nazario29 commented Feb 7, 2023

In my case I could experience this issue with any of npm 9.x versions, actually tried all of them below 9.1.1.
For anyone that is struggling with this issue please follow Qusic workaround 1b7c1f8 🥇

@nlf
Copy link
Contributor

nlf commented Feb 16, 2023

i believe npm/pacote#261 should fix this. will follow up after that lands and ships

@nlf nlf added Priority 2 secondary priority issue and removed Needs Triage needs review for next steps labels Feb 16, 2023
@nlf nlf self-assigned this Feb 16, 2023
@NoNameProvided
Copy link

The above-mentioned PR has been merged and included in the 9.5.1 release of NPM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Priority 2 secondary priority issue Release 9.x work is associated with a specific npm 9 release
Projects
None yet
Development

No branches or pull requests

4 participants