From 26ba1103c10215b8b54e98fa176ef99eda0a3f0f Mon Sep 17 00:00:00 2001 From: Steven Date: Wed, 28 Dec 2016 14:22:26 -0500 Subject: [PATCH] Update BestPractices.md with alpine user Added entry to **Non-root User** section to show adding user & group in the alpine variant since the commands are a little different. --- docs/BestPractices.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/BestPractices.md b/docs/BestPractices.md index ec1e1b70..ce504d27 100644 --- a/docs/BestPractices.md +++ b/docs/BestPractices.md @@ -23,6 +23,13 @@ FROM node:4.1.2-onbuild RUN groupadd -r node && useradd -r -g node node ``` +When using the `alpine` variant, add the user like so: + +```Dockerfile +FROM node:7.3.0-alpine +RUN addgroup -S app && adduser -S -g app app +``` + ## Memory By default, any Docker Container may consume as much of the hardware such as CPU and RAM. If you are running multiple containers on the same host you should limit how much memory they can consume.