Skip to content

Commit

Permalink
fix: fix adding the node user
Browse files Browse the repository at this point in the history
User adduser instead of useradd since the former isn't installed
in the base alpine image.

Add both a node user and group with 1000 id following the same
procedure as the official nodejs image.

https://github.com/nodejs/docker-node/blob/main/Dockerfile-alpine.template#L5
  • Loading branch information
ttshivers authored and ahmadnassri committed Jul 30, 2023
1 parent 0ad54d4 commit 681c7c8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ RUN node install.js

FROM base AS app

RUN useradd -ms /bin/bash node
RUN addgroup -g 1000 node \
&& adduser -u 1000 -G node -s /bin/sh -D node

LABEL com.github.actions.name="Conventional Commit Lint" \
com.github.actions.description="commitlint your PRs with Conventional style" \
Expand Down

0 comments on commit 681c7c8

Please sign in to comment.