Skip to content

Commit 047ce0c

Browse files
authored
docs: fix user creation example in Ubuntu-based Docker images (#1243)
* Fix user creation in default docker images The `adduser` command uses `-D` to mean "create with defaults". The `useradd` command uses `-D` to mean "show or edit the defaults". man pages: - [`useradd`](https://manpages.debian.org/jessie/passwd/useradd.8.en.html) - [`adduser](https://manpages.debian.org/jessie/adduser/adduser.8.en.html) (Those are for Debian, but they are very similar for every other distro that I checked) * Use a different username that doesn't already exist
1 parent 2f3e4b6 commit 047ce0c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/docker.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,11 @@ Here is a sample `Dockerfile` doing this:
149149
```dockerfile
150150
FROM dunglas/frankenphp
151151
152-
ARG USER=www-data
152+
ARG USER=appuser
153153
154154
RUN \
155155
# Use "adduser -D ${USER}" for alpine based distros
156-
useradd -D ${USER}; \
156+
useradd ${USER}; \
157157
# Add additional capability to bind to port 80 and 443
158158
setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/frankenphp; \
159159
# Give write access to /data/caddy and /config/caddy
@@ -173,11 +173,11 @@ the webserver as a non-root user, and without the need for any capability:
173173
```dockerfile
174174
FROM dunglas/frankenphp
175175
176-
ARG USER=www-data
176+
ARG USER=appuser
177177
178178
RUN \
179179
# Use "adduser -D ${USER}" for alpine based distros
180-
useradd -D ${USER}; \
180+
useradd ${USER}; \
181181
# Remove default capability
182182
setcap -r /usr/local/bin/frankenphp; \
183183
# Give write access to /data/caddy and /config/caddy

0 commit comments

Comments
 (0)