Skip to content

Commit 9228dbd

Browse files
authored
Update BestPractices.md to remove alpine user
Since the `node` user was added to the alpine variant, there is no need to recommend that they need to create the `node` user. In fact, it would break. Only the `onbuild` variant does not have the user. I also added the `USER node` syntax to show how to [set the user](https://docs.docker.com/engine/reference/builder/#user) in the dockerfile.
1 parent 526177c commit 9228dbd

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

docs/BestPractices.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,8 @@ When using the `onbuild` variant, add the user like so:
3030
FROM node:4.1.2-onbuild
3131
# Add our user and group first to make sure their IDs get assigned consistently
3232
RUN groupadd -r node && useradd -r -g node node
33-
```
34-
35-
When using the `alpine` variant, add the user like so:
36-
37-
```Dockerfile
38-
FROM node:7.3.0-alpine
39-
RUN addgroup -S node && adduser -S -g node node
33+
# Set the user to use when running this image
34+
USER node
4035
```
4136

4237
## Memory

0 commit comments

Comments
 (0)