diff --git a/5.6/jessie/apache/Dockerfile b/5.6/jessie/apache/Dockerfile index b4032a5f79..0ef5e85ae2 100644 --- a/5.6/jessie/apache/Dockerfile +++ b/5.6/jessie/apache/Dockerfile @@ -48,7 +48,7 @@ RUN apt-get update \ ENV APACHE_CONFDIR /etc/apache2 ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars -RUN set -ex \ +RUN set -eux; \ \ # generically convert lines like # export APACHE_RUN_USER=www-data @@ -56,33 +56,32 @@ RUN set -ex \ # : ${APACHE_RUN_USER:=www-data} # export APACHE_RUN_USER # so that they can be overridden at runtime ("-e APACHE_RUN_USER=...") - && sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS" \ + sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS"; \ \ # setup directories and permissions - && . "$APACHE_ENVVARS" \ - && for dir in \ + . "$APACHE_ENVVARS"; \ + for dir in \ "$APACHE_LOCK_DIR" \ "$APACHE_RUN_DIR" \ "$APACHE_LOG_DIR" \ /var/www/html \ ; do \ - rm -rvf "$dir" \ - && mkdir -p "$dir" \ - && chown -R "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir" \ + rm -rvf "$dir"; \ + mkdir -p "$dir"; \ + chown "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"; \ # allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - && chmod 1777 "$dir" \ - ; done + chmod 777 "$dir"; \ + done; \ + \ +# logs should go to stdout / stderr + ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log"; \ + ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log"; \ + ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log"; \ + chown -R --no-dereference "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$APACHE_LOG_DIR" # Apache + PHP requires preforking Apache for best results RUN a2dismod mpm_event && a2enmod mpm_prefork -# logs should go to stdout / stderr -RUN set -ex \ - && . "$APACHE_ENVVARS" \ - && ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log" \ - && ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log" \ - && ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log" - # PHP files should be handled by PHP, and should be preferred over any other file type RUN { \ echo ''; \ diff --git a/5.6/stretch/apache/Dockerfile b/5.6/stretch/apache/Dockerfile index ff5b32488c..7634ac487f 100644 --- a/5.6/stretch/apache/Dockerfile +++ b/5.6/stretch/apache/Dockerfile @@ -48,7 +48,7 @@ RUN apt-get update \ ENV APACHE_CONFDIR /etc/apache2 ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars -RUN set -ex \ +RUN set -eux; \ \ # generically convert lines like # export APACHE_RUN_USER=www-data @@ -56,33 +56,32 @@ RUN set -ex \ # : ${APACHE_RUN_USER:=www-data} # export APACHE_RUN_USER # so that they can be overridden at runtime ("-e APACHE_RUN_USER=...") - && sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS" \ + sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS"; \ \ # setup directories and permissions - && . "$APACHE_ENVVARS" \ - && for dir in \ + . "$APACHE_ENVVARS"; \ + for dir in \ "$APACHE_LOCK_DIR" \ "$APACHE_RUN_DIR" \ "$APACHE_LOG_DIR" \ /var/www/html \ ; do \ - rm -rvf "$dir" \ - && mkdir -p "$dir" \ - && chown -R "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir" \ + rm -rvf "$dir"; \ + mkdir -p "$dir"; \ + chown "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"; \ # allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - && chmod 1777 "$dir" \ - ; done + chmod 777 "$dir"; \ + done; \ + \ +# logs should go to stdout / stderr + ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log"; \ + ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log"; \ + ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log"; \ + chown -R --no-dereference "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$APACHE_LOG_DIR" # Apache + PHP requires preforking Apache for best results RUN a2dismod mpm_event && a2enmod mpm_prefork -# logs should go to stdout / stderr -RUN set -ex \ - && . "$APACHE_ENVVARS" \ - && ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log" \ - && ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log" \ - && ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log" - # PHP files should be handled by PHP, and should be preferred over any other file type RUN { \ echo ''; \ diff --git a/7.0/jessie/apache/Dockerfile b/7.0/jessie/apache/Dockerfile index 8fe802852e..27e31a53c5 100644 --- a/7.0/jessie/apache/Dockerfile +++ b/7.0/jessie/apache/Dockerfile @@ -48,7 +48,7 @@ RUN apt-get update \ ENV APACHE_CONFDIR /etc/apache2 ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars -RUN set -ex \ +RUN set -eux; \ \ # generically convert lines like # export APACHE_RUN_USER=www-data @@ -56,33 +56,32 @@ RUN set -ex \ # : ${APACHE_RUN_USER:=www-data} # export APACHE_RUN_USER # so that they can be overridden at runtime ("-e APACHE_RUN_USER=...") - && sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS" \ + sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS"; \ \ # setup directories and permissions - && . "$APACHE_ENVVARS" \ - && for dir in \ + . "$APACHE_ENVVARS"; \ + for dir in \ "$APACHE_LOCK_DIR" \ "$APACHE_RUN_DIR" \ "$APACHE_LOG_DIR" \ /var/www/html \ ; do \ - rm -rvf "$dir" \ - && mkdir -p "$dir" \ - && chown -R "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir" \ + rm -rvf "$dir"; \ + mkdir -p "$dir"; \ + chown "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"; \ # allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - && chmod 1777 "$dir" \ - ; done + chmod 777 "$dir"; \ + done; \ + \ +# logs should go to stdout / stderr + ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log"; \ + ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log"; \ + ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log"; \ + chown -R --no-dereference "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$APACHE_LOG_DIR" # Apache + PHP requires preforking Apache for best results RUN a2dismod mpm_event && a2enmod mpm_prefork -# logs should go to stdout / stderr -RUN set -ex \ - && . "$APACHE_ENVVARS" \ - && ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log" \ - && ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log" \ - && ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log" - # PHP files should be handled by PHP, and should be preferred over any other file type RUN { \ echo ''; \ diff --git a/7.0/stretch/apache/Dockerfile b/7.0/stretch/apache/Dockerfile index bea2942ab3..9877f0ced7 100644 --- a/7.0/stretch/apache/Dockerfile +++ b/7.0/stretch/apache/Dockerfile @@ -48,7 +48,7 @@ RUN apt-get update \ ENV APACHE_CONFDIR /etc/apache2 ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars -RUN set -ex \ +RUN set -eux; \ \ # generically convert lines like # export APACHE_RUN_USER=www-data @@ -56,33 +56,32 @@ RUN set -ex \ # : ${APACHE_RUN_USER:=www-data} # export APACHE_RUN_USER # so that they can be overridden at runtime ("-e APACHE_RUN_USER=...") - && sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS" \ + sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS"; \ \ # setup directories and permissions - && . "$APACHE_ENVVARS" \ - && for dir in \ + . "$APACHE_ENVVARS"; \ + for dir in \ "$APACHE_LOCK_DIR" \ "$APACHE_RUN_DIR" \ "$APACHE_LOG_DIR" \ /var/www/html \ ; do \ - rm -rvf "$dir" \ - && mkdir -p "$dir" \ - && chown -R "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir" \ + rm -rvf "$dir"; \ + mkdir -p "$dir"; \ + chown "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"; \ # allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - && chmod 1777 "$dir" \ - ; done + chmod 777 "$dir"; \ + done; \ + \ +# logs should go to stdout / stderr + ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log"; \ + ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log"; \ + ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log"; \ + chown -R --no-dereference "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$APACHE_LOG_DIR" # Apache + PHP requires preforking Apache for best results RUN a2dismod mpm_event && a2enmod mpm_prefork -# logs should go to stdout / stderr -RUN set -ex \ - && . "$APACHE_ENVVARS" \ - && ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log" \ - && ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log" \ - && ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log" - # PHP files should be handled by PHP, and should be preferred over any other file type RUN { \ echo ''; \ diff --git a/7.1/jessie/apache/Dockerfile b/7.1/jessie/apache/Dockerfile index 614dbdafd1..e420c6ea5b 100644 --- a/7.1/jessie/apache/Dockerfile +++ b/7.1/jessie/apache/Dockerfile @@ -48,7 +48,7 @@ RUN apt-get update \ ENV APACHE_CONFDIR /etc/apache2 ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars -RUN set -ex \ +RUN set -eux; \ \ # generically convert lines like # export APACHE_RUN_USER=www-data @@ -56,33 +56,32 @@ RUN set -ex \ # : ${APACHE_RUN_USER:=www-data} # export APACHE_RUN_USER # so that they can be overridden at runtime ("-e APACHE_RUN_USER=...") - && sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS" \ + sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS"; \ \ # setup directories and permissions - && . "$APACHE_ENVVARS" \ - && for dir in \ + . "$APACHE_ENVVARS"; \ + for dir in \ "$APACHE_LOCK_DIR" \ "$APACHE_RUN_DIR" \ "$APACHE_LOG_DIR" \ /var/www/html \ ; do \ - rm -rvf "$dir" \ - && mkdir -p "$dir" \ - && chown -R "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir" \ + rm -rvf "$dir"; \ + mkdir -p "$dir"; \ + chown "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"; \ # allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - && chmod 1777 "$dir" \ - ; done + chmod 777 "$dir"; \ + done; \ + \ +# logs should go to stdout / stderr + ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log"; \ + ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log"; \ + ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log"; \ + chown -R --no-dereference "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$APACHE_LOG_DIR" # Apache + PHP requires preforking Apache for best results RUN a2dismod mpm_event && a2enmod mpm_prefork -# logs should go to stdout / stderr -RUN set -ex \ - && . "$APACHE_ENVVARS" \ - && ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log" \ - && ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log" \ - && ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log" - # PHP files should be handled by PHP, and should be preferred over any other file type RUN { \ echo ''; \ diff --git a/7.1/stretch/apache/Dockerfile b/7.1/stretch/apache/Dockerfile index f9cbf8556d..149c450446 100644 --- a/7.1/stretch/apache/Dockerfile +++ b/7.1/stretch/apache/Dockerfile @@ -48,7 +48,7 @@ RUN apt-get update \ ENV APACHE_CONFDIR /etc/apache2 ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars -RUN set -ex \ +RUN set -eux; \ \ # generically convert lines like # export APACHE_RUN_USER=www-data @@ -56,33 +56,32 @@ RUN set -ex \ # : ${APACHE_RUN_USER:=www-data} # export APACHE_RUN_USER # so that they can be overridden at runtime ("-e APACHE_RUN_USER=...") - && sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS" \ + sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS"; \ \ # setup directories and permissions - && . "$APACHE_ENVVARS" \ - && for dir in \ + . "$APACHE_ENVVARS"; \ + for dir in \ "$APACHE_LOCK_DIR" \ "$APACHE_RUN_DIR" \ "$APACHE_LOG_DIR" \ /var/www/html \ ; do \ - rm -rvf "$dir" \ - && mkdir -p "$dir" \ - && chown -R "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir" \ + rm -rvf "$dir"; \ + mkdir -p "$dir"; \ + chown "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"; \ # allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - && chmod 1777 "$dir" \ - ; done + chmod 777 "$dir"; \ + done; \ + \ +# logs should go to stdout / stderr + ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log"; \ + ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log"; \ + ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log"; \ + chown -R --no-dereference "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$APACHE_LOG_DIR" # Apache + PHP requires preforking Apache for best results RUN a2dismod mpm_event && a2enmod mpm_prefork -# logs should go to stdout / stderr -RUN set -ex \ - && . "$APACHE_ENVVARS" \ - && ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log" \ - && ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log" \ - && ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log" - # PHP files should be handled by PHP, and should be preferred over any other file type RUN { \ echo ''; \ diff --git a/7.2/stretch/apache/Dockerfile b/7.2/stretch/apache/Dockerfile index de86cf3950..d4c1f7f074 100644 --- a/7.2/stretch/apache/Dockerfile +++ b/7.2/stretch/apache/Dockerfile @@ -48,7 +48,7 @@ RUN apt-get update \ ENV APACHE_CONFDIR /etc/apache2 ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars -RUN set -ex \ +RUN set -eux; \ \ # generically convert lines like # export APACHE_RUN_USER=www-data @@ -56,33 +56,32 @@ RUN set -ex \ # : ${APACHE_RUN_USER:=www-data} # export APACHE_RUN_USER # so that they can be overridden at runtime ("-e APACHE_RUN_USER=...") - && sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS" \ + sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS"; \ \ # setup directories and permissions - && . "$APACHE_ENVVARS" \ - && for dir in \ + . "$APACHE_ENVVARS"; \ + for dir in \ "$APACHE_LOCK_DIR" \ "$APACHE_RUN_DIR" \ "$APACHE_LOG_DIR" \ /var/www/html \ ; do \ - rm -rvf "$dir" \ - && mkdir -p "$dir" \ - && chown -R "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir" \ + rm -rvf "$dir"; \ + mkdir -p "$dir"; \ + chown "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"; \ # allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - && chmod 1777 "$dir" \ - ; done + chmod 777 "$dir"; \ + done; \ + \ +# logs should go to stdout / stderr + ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log"; \ + ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log"; \ + ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log"; \ + chown -R --no-dereference "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$APACHE_LOG_DIR" # Apache + PHP requires preforking Apache for best results RUN a2dismod mpm_event && a2enmod mpm_prefork -# logs should go to stdout / stderr -RUN set -ex \ - && . "$APACHE_ENVVARS" \ - && ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log" \ - && ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log" \ - && ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log" - # PHP files should be handled by PHP, and should be preferred over any other file type RUN { \ echo ''; \ diff --git a/7.3-rc/stretch/apache/Dockerfile b/7.3-rc/stretch/apache/Dockerfile index 05b3e86383..c8f3e88938 100644 --- a/7.3-rc/stretch/apache/Dockerfile +++ b/7.3-rc/stretch/apache/Dockerfile @@ -48,7 +48,7 @@ RUN apt-get update \ ENV APACHE_CONFDIR /etc/apache2 ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars -RUN set -ex \ +RUN set -eux; \ \ # generically convert lines like # export APACHE_RUN_USER=www-data @@ -56,33 +56,32 @@ RUN set -ex \ # : ${APACHE_RUN_USER:=www-data} # export APACHE_RUN_USER # so that they can be overridden at runtime ("-e APACHE_RUN_USER=...") - && sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS" \ + sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS"; \ \ # setup directories and permissions - && . "$APACHE_ENVVARS" \ - && for dir in \ + . "$APACHE_ENVVARS"; \ + for dir in \ "$APACHE_LOCK_DIR" \ "$APACHE_RUN_DIR" \ "$APACHE_LOG_DIR" \ /var/www/html \ ; do \ - rm -rvf "$dir" \ - && mkdir -p "$dir" \ - && chown -R "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir" \ + rm -rvf "$dir"; \ + mkdir -p "$dir"; \ + chown "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"; \ # allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - && chmod 1777 "$dir" \ - ; done + chmod 777 "$dir"; \ + done; \ + \ +# logs should go to stdout / stderr + ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log"; \ + ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log"; \ + ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log"; \ + chown -R --no-dereference "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$APACHE_LOG_DIR" # Apache + PHP requires preforking Apache for best results RUN a2dismod mpm_event && a2enmod mpm_prefork -# logs should go to stdout / stderr -RUN set -ex \ - && . "$APACHE_ENVVARS" \ - && ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log" \ - && ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log" \ - && ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log" - # PHP files should be handled by PHP, and should be preferred over any other file type RUN { \ echo ''; \ diff --git a/apache-Dockerfile-block-1 b/apache-Dockerfile-block-1 index 8c2fbecbdf..e74f7a3379 100644 --- a/apache-Dockerfile-block-1 +++ b/apache-Dockerfile-block-1 @@ -6,7 +6,7 @@ RUN apt-get update \ ENV APACHE_CONFDIR /etc/apache2 ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars -RUN set -ex \ +RUN set -eux; \ \ # generically convert lines like # export APACHE_RUN_USER=www-data @@ -14,33 +14,32 @@ RUN set -ex \ # : ${APACHE_RUN_USER:=www-data} # export APACHE_RUN_USER # so that they can be overridden at runtime ("-e APACHE_RUN_USER=...") - && sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS" \ + sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS"; \ \ # setup directories and permissions - && . "$APACHE_ENVVARS" \ - && for dir in \ + . "$APACHE_ENVVARS"; \ + for dir in \ "$APACHE_LOCK_DIR" \ "$APACHE_RUN_DIR" \ "$APACHE_LOG_DIR" \ /var/www/html \ ; do \ - rm -rvf "$dir" \ - && mkdir -p "$dir" \ - && chown -R "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir" \ + rm -rvf "$dir"; \ + mkdir -p "$dir"; \ + chown "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"; \ # allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - && chmod 1777 "$dir" \ - ; done + chmod 777 "$dir"; \ + done; \ + \ +# logs should go to stdout / stderr + ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log"; \ + ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log"; \ + ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log"; \ + chown -R --no-dereference "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$APACHE_LOG_DIR" # Apache + PHP requires preforking Apache for best results RUN a2dismod mpm_event && a2enmod mpm_prefork -# logs should go to stdout / stderr -RUN set -ex \ - && . "$APACHE_ENVVARS" \ - && ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log" \ - && ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log" \ - && ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log" - # PHP files should be handled by PHP, and should be preferred over any other file type RUN { \ echo ''; \