Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
When running older official node image, npm works fine:
docker container run --rm -it -u nobody:nobody --entrypoint /bin/sh node:16.14-alpine -c "id && npm -v || echo Exit"
uid=65534(nobody) gid=65534(nobody)
8.5.0
With latest one, npm just silently exits:
docker container run --rm -it -u nobody:nobody --entrypoint /bin/sh node:16-alpine -c "id && npm -v || echo Exit"
uid=65534(nobody) gid=65534(nobody)
Exit
Custom image that updates NPM:
docker container run --rm -it -u nobody:nobody --entrypoint /bin/sh npm -c "id && npm -v || echo Exit"
uid=65534(nobody) gid=65534(nobody)
Exit
docker container run --rm -it -u node:node --entrypoint /bin/sh npm -c "id && npm -v || echo Exit"
uid=1000(node) gid=1000(node)
8.12.1
Expected Behavior
docker container run --rm -it -u nobody:nobody --entrypoint /bin/sh node:16-alpine -c "id && npm -v || echo Exit"
uid=65534(nobody) gid=65534(nobody)
8.11.0
Steps To Reproduce
With docker behavior steps can be used to reproduce. For newer version image creation is needed, as user can't be changed in shell to nobody.
Custom image created with Dockerfile:
FROM node:16-alpine
RUN npm i -g npm && npm -v
USER nobody
Environment
No response
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
When running older official node image, npm works fine:
With latest one, npm just silently exits:
Custom image that updates NPM:
Expected Behavior
Steps To Reproduce
With docker behavior steps can be used to reproduce. For newer version image creation is needed, as user can't be changed in shell to nobody.
Custom image created with Dockerfile:
Environment
No response