1
0
mirror of https://github.com/misterunknown/ifm.git synced 2025-09-01 19:52:33 +02:00

Adjust apache uid and gid

The alpine packages now use the username apache instead of www-data, so
we're adjusting to this.

Also, since we want to use this image with the stock php-apache images,
which uses uid and gid 33 (since it's debian based), we also adjust
things accordingly.

NOTE: At a later point this should be solved with a build or environment
      variable.
This commit is contained in:
Tuschl
2017-07-25 20:54:27 +02:00
parent b27eb41a03
commit 1b37528e32

View File

@@ -2,14 +2,11 @@ FROM alpine:3.5
ENV PHP_INI_DIR /etc/php5
# ensure www-data user exists
# ensure apache user exists with the desired uid
RUN set -x \
&& addgroup -g 82 -S www-data \
&& adduser -u 82 -D -S -G www-data www-data
# 82 is the standard uid/gid for "www-data" in Alpine
# http://git.alpinelinux.org/cgit/aports/tree/main/apache2/apache2.pre-install?h=v3.3.2
# http://git.alpinelinux.org/cgit/aports/tree/main/lighttpd/lighttpd.pre-install?h=v3.3.2
# http://git.alpinelinux.org/cgit/aports/tree/main/nginx-initscripts/nginx-initscripts.pre-install?h=v3.3.2
&& deluser xfs \
&& addgroup -g 33 -S apache \
&& adduser -u 33 -D -S -G apache apache
RUN set -xe; \
apk add --no-cache --virtual .image-runtime-deps \
@@ -44,7 +41,7 @@ RUN set -xe; \
RUN mkdir -p /run/apache2 \
&& mv /var/www/localhost/htdocs /var/www/html \
&& chown -R www-data:www-data /var/www \
&& chown -R apache:apache /var/www \
&& chmod g+ws /var/www/html \
&& rm /var/www/html/index.html \
&& rm -Rf /var/www/localhost \