Skip to content

Commit

Permalink
Add node group/user with gid/uid 1000 and a home directory.
Browse files Browse the repository at this point in the history
This is a workaround for boot2docker issue 581, see
boot2docker/boot2docker#581
  • Loading branch information
blueimp committed Nov 15, 2016
1 parent 9d7725c commit 3d8dc76
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
3 changes: 1 addition & 2 deletions Dockerfile-alpine.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ FROM alpine:3.4
ENV NPM_CONFIG_LOGLEVEL info
ENV NODE_VERSION 0.0.0

RUN addgroup -S node \
&& adduser -D -S -h /var/cache/node -s /sbin/nologin -G node node \
RUN adduser -D -u 1000 node \
&& apk add --no-cache \
libstdc++ \
&& apk add --no-cache --virtual .build-deps \
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile-slim.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM buildpack-deps:jessie-curl

RUN groupadd -r node && useradd -r -g node node
RUN groupadd --gid 1000 node \
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node

# gpg keys listed at https://github.com/nodejs/node
RUN set -ex \
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile-wheezy.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM buildpack-deps:wheezy

RUN groupadd -r node && useradd -r -g node node
RUN groupadd --gid 1000 node \
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node

# gpg keys listed at https://github.com/nodejs/node
RUN set -ex \
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM buildpack-deps:jessie

RUN groupadd -r node && useradd -r -g node node
RUN groupadd --gid 1000 node \
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node

# gpg keys listed at https://github.com/nodejs/node
RUN set -ex \
Expand Down

0 comments on commit 3d8dc76

Please sign in to comment.