Skip to content

Commit

Permalink
Node.js: avoid "Error: could not get uid/gid" on Alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
generalmimon committed Oct 10, 2023
1 parent 22c1e10 commit 4658bb3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/javascript/nodejs10-linux-x86_64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ FROM node:10-alpine
# Copy files common for all images
COPY 4img/* ./

# NOTE: the following `unsafe-perm=true` setting is needed on Alpine for
# Node.js versions older than 12 to avoid "Error: could not get
# uid/gid", see https://stackoverflow.com/a/52196681
RUN npm config set unsafe-perm true

# Install all dependencies
RUN ./prepare
RUN ./prepare-alpine-init && ./prepare-alpine-ruby && ./prepare-alpine-uninit
Expand Down
5 changes: 5 additions & 0 deletions src/javascript/nodejs4-linux-x86_64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ FROM node:4-alpine
# Copy files common for all images
COPY 4img/* ./

# NOTE: the following `unsafe-perm=true` setting is needed on Alpine for
# Node.js versions older than 12 to avoid "Error: could not get
# uid/gid", see https://stackoverflow.com/a/52196681
RUN npm config set unsafe-perm true

# Install all dependencies
RUN ./prepare
RUN ./prepare-alpine-init && ./prepare-alpine-ruby && ./prepare-alpine-uninit
Expand Down
5 changes: 5 additions & 0 deletions src/javascript/nodejs8-linux-x86_64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ FROM node:8-alpine
# Copy files common for all images
COPY 4img/* ./

# NOTE: the following `unsafe-perm=true` setting is needed on Alpine for
# Node.js versions older than 12 to avoid "Error: could not get
# uid/gid", see https://stackoverflow.com/a/52196681
RUN npm config set unsafe-perm true

# Install all dependencies
RUN ./prepare
RUN ./prepare-alpine-init && ./prepare-alpine-ruby && ./prepare-alpine-uninit
Expand Down

0 comments on commit 4658bb3

Please sign in to comment.