Could not get uid/gid when building Node/Docker Could not get uid/gid when building Node/Docker reactjs reactjs

Could not get uid/gid when building Node/Docker


UPD Fixed in nodejs@12.4.0?

Check if this is linked to nodejs/docker-node issue 813:

Root cause seems to be: Thread stack size

The default stack size for new threads on glibc is determined based on the resource limit governing the main thread’s stack (RLIMIT_STACK).
It generally ends up being 2-10 MB.

There three possible solutions:

You already tried the third option, but consider also:

Alternatively, you should switch to the slim (Debian) variant until this get's fixe upstream by the Alpine team.


I faced same issue in Docker for node-alpine image when I am dockerizing my react application

I resolved with following dockerfile configuration.

FROM node:8.10.0-alpine# Set a working directoryWORKDIR /usr/src/appCOPY ./build/package.json .COPY ./build/yarn.lock .# To handle 'not get uid/gid'RUN npm config set unsafe-perm true# Install Node.js dependenciesRUN yarn install --production --no-progress# Copy application filesCOPY ./build .# Install pm2RUN npm install -g pm2 --silent# Run the container under "node" user by defaultUSER nodeCMD ["pm2", "start", "mypm2config.yml", "--no-daemon", "--env", "preprod"]