Browse Source

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
MK 2 months ago
parent
commit
047ce0c8b2
1 changed files with 4 additions and 4 deletions
  1. 4 4
      docs/docker.md

+ 4 - 4
docs/docker.md

@@ -149,11 +149,11 @@ Here is a sample `Dockerfile` doing this:
 ```dockerfile
 FROM dunglas/frankenphp
 
-ARG USER=www-data
+ARG USER=appuser
 
 RUN \
 	# Use "adduser -D ${USER}" for alpine based distros
-	useradd -D ${USER}; \
+	useradd ${USER}; \
 	# Add additional capability to bind to port 80 and 443
 	setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/frankenphp; \
 	# 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:
 ```dockerfile
 FROM dunglas/frankenphp
 
-ARG USER=www-data
+ARG USER=appuser
 
 RUN \
 	# Use "adduser -D ${USER}" for alpine based distros
-	useradd -D ${USER}; \
+	useradd ${USER}; \
 	# Remove default capability
 	setcap -r /usr/local/bin/frankenphp; \
 	# Give write access to /data/caddy and /config/caddy