docker-node
docker-node copied to clipboard
Alpine "Best Practice", error "addgroup: gid '999' in use "
Environment
- Platform: Linux based Ubunu 20.04.2
- Docker Version: 20.10.7, build f0df350
- Node.js Version: 14-alpine
- Image Tag: node:14-alpine
Expected Behavior
I need to change uid/gid , i i use the follow command from the docs :
RUN deluser --remove-home node \
&& addgroup -S node -g 999 \
&& adduser -S -G node -u 999 node
Current Behavior
The command not working because of follow error;
Steps to Reproduce
using the follow dockerfile config:
FROM node:14-alpine
RUN deluser --remove-home node \
&& addgroup -S node -g 999 \
&& adduser -S -G node -u 999 node
WORKDIR /app
RUN chown -R node /app
USER node
COPY package.json .
RUN npm i
COPY . .
VOLUME [ "app/node_modules" ]
EXPOSE 4200
CMD [ "npm", "start" ]
Did you resolve this? I'm currently running into this same issue -> node:18-alpine3.14
same issue here
whats going on ?
Note that delgroup node
was removed because the group had already been deleted:
https://github.com/nodejs/docker-node/issues/870
but you report that now the group can't be added because it hasn't been deleted.
So I would see if adding delgroup fixes it.
https://github.com/nodejs/docker-node/blob/main/14/alpine3.17/Dockerfile