Skip to content

Commit 991d56f

Browse files
committed
tested for $HOSTUID before trying to attempt to change the UID for www-data in the php box
1 parent 0e078fa commit 991d56f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docker/php/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
ARG PHPVER
22
FROM php:${PHPVER}-fpm
33

4-
# set www-data to our host user's UID
4+
# attempt to set www-data's UID to our host user's UID
55
ARG HOSTUID
6-
RUN usermod -u $HOSTUID www-data; groupmod -g $HOSTUID www-data
6+
CMD [ "$HOSTUID" -gt "1" ] && usermod -u $HOSTUID www-data && groupmod -g $HOSTUID www-data
77

88
# Install some stuff
99
RUN apt-get update -y && apt-get install -y sendmail libpng-dev

0 commit comments

Comments
 (0)