docker-node
docker-node copied to clipboard
Nodejs container version node:16.14.2-slim suddenly failed to start suggestion fix "chmod 1000:0 /root/.npm"
Nodejs container image version 16.14.2-slim deployed in AWS Fargate failed to start suddenly with loading the webpack and suggesting to add "chmod 1000:0 /root/.npm/". Worked after adding the RUN chmod 1000:0 /root/.npm/ in Dockerfile. However we are not sure what would have made this behaviour to suddenly failed when the same Dockerfile without "chmod 1000:0 /root/.npm/" Worked before. Understand that there is no support for 16.14.2. But, Just wanted to understand the root cause of this so it doesnt occur again.
Environment- Production
- Platform: AWS Fargate
- Docker Version: 16.14.2
- Node.js Version: node-v10.18.1 , npm-6.13.4
- Image Tag: 16.14.2-slim
Expected Behavior
Current Behavior
Possible Solution
Steps to Reproduce
Additional Information
I have had the same issue, a couple of months ago. The most awkward thing - this "chmod 1000:0" is the user, that is used by the image (e.g. user in docker-compose.yml). But to add the "RUN chmod ..." - you have to know, which user to put here. So I have the dilemma - I build an image, it runs on one machine with one user. It doesn't run on a different machine. It forces to use the same user/group IDs on host machine... Sad :(
Not sure exactly because there isn't enough details but It's possible that it worked when it is built on a machine where the use building already have UID 1000 (typical installation in many linux distributions) and doesn't work when built on. a machine where the user has a different UDI