mirror of
https://github.com/dunglas/frankenphp.git
synced 2025-12-24 13:38:11 +08:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user