docker-node icon indicating copy to clipboard operation
docker-node copied to clipboard

Alpine "Best Practice", error "addgroup: gid '999' in use "

Open ampmonteiro opened this issue 3 years ago • 4 comments

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;

image

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" ]

ampmonteiro avatar Aug 11 '21 15:08 ampmonteiro

Did you resolve this? I'm currently running into this same issue -> node:18-alpine3.14

sachasmart-weavik avatar Aug 12 '22 14:08 sachasmart-weavik

same issue here

pauloreis7 avatar Sep 11 '22 21:09 pauloreis7

whats going on ?

mathpaquette avatar Feb 01 '23 23:02 mathpaquette

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

joebowbeer avatar Feb 02 '23 06:02 joebowbeer