diff options
author | Jamie Nguyen <j@jamielinux.com> | 2018-07-18 08:45:06 +0100 |
---|---|---|
committer | Jamie Nguyen <j@jamielinux.com> | 2018-07-18 08:45:06 +0100 |
commit | b37340668e00aa34fd2255dc7fa78735154abac9 (patch) | |
tree | a44cbff2611ce5b300dd29875299b42bb68eeb75 /2.4/Dockerfile | |
parent | ea652eee8e16c3ee3e61a361158b0e308863aab5 (diff) | |
download | apache-b37340668e00aa34fd2255dc7fa78735154abac9.tar.gz apache-b37340668e00aa34fd2255dc7fa78735154abac9.tar.bz2 apache-b37340668e00aa34fd2255dc7fa78735154abac9.tar.xz apache-b37340668e00aa34fd2255dc7fa78735154abac9.zip |
Use WORKDIR
Diffstat (limited to '2.4/Dockerfile')
-rw-r--r-- | 2.4/Dockerfile | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/2.4/Dockerfile b/2.4/Dockerfile index 3c1c2e4..6083e29 100644 --- a/2.4/Dockerfile +++ b/2.4/Dockerfile @@ -1,10 +1,11 @@ FROM httpd:alpine -# This variable is inherited from httpd:alpine image: +# These variables are inherited from the httpd:alpine image: # ENV HTTPD_PREFIX /usr/local/apache2 +# WORKDIR "$HTTPD_PREFIX" # Copy in our configuration files. -COPY conf/ "$HTTPD_PREFIX/conf/" +COPY conf/ conf/ RUN set -ex; \ # Create empty default DocumentRoot. @@ -16,35 +17,35 @@ RUN set -ex; \ \ # Enable DAV modules. for i in dav dav_fs; do \ - sed -i -e "/^#LoadModule ${i}_module.*/s/^#//" "$HTTPD_PREFIX/conf/httpd.conf"; \ + sed -i -e "/^#LoadModule ${i}_module.*/s/^#//" "conf/httpd.conf"; \ done; \ \ # Make sure authentication modules are enabled. for i in authn_core authn_file authz_core authz_user auth_basic auth_digest; do \ - sed -i -e "/^#LoadModule ${i}_module.*/s/^#//" "$HTTPD_PREFIX/conf/httpd.conf"; \ + sed -i -e "/^#LoadModule ${i}_module.*/s/^#//" "conf/httpd.conf"; \ done; \ \ # Make sure other modules are enabled. for i in alias headers mime setenvif; do \ - sed -i -e "/^#LoadModule ${i}_module.*/s/^#//" "$HTTPD_PREFIX/conf/httpd.conf"; \ + sed -i -e "/^#LoadModule ${i}_module.*/s/^#//" "conf/httpd.conf"; \ done; \ \ # Run httpd as "www-data" (instead of "daemon"). for i in User Group; do \ - sed -i -e "s|^$i .*|$i www-data|" "$HTTPD_PREFIX/conf/httpd.conf"; \ + sed -i -e "s|^$i .*|$i www-data|" "conf/httpd.conf"; \ done; \ \ # Include enabled configs and sites. printf '%s\n' "Include conf/conf-enabled/*.conf" \ - >> "$HTTPD_PREFIX/conf/httpd.conf"; \ + >> "conf/httpd.conf"; \ printf '%s\n' "Include conf/sites-enabled/*.conf" \ - >> "$HTTPD_PREFIX/conf/httpd.conf"; \ + >> "conf/httpd.conf"; \ \ # Enable dav and default site. - mkdir -p "$HTTPD_PREFIX/conf/conf-enabled"; \ - mkdir -p "$HTTPD_PREFIX/conf/sites-enabled"; \ - ln -s ../conf-available/dav.conf "$HTTPD_PREFIX/conf/conf-enabled"; \ - ln -s ../sites-available/default.conf "$HTTPD_PREFIX/conf/sites-enabled"; \ + mkdir -p "conf/conf-enabled"; \ + mkdir -p "conf/sites-enabled"; \ + ln -s ../conf-available/dav.conf "conf/conf-enabled"; \ + ln -s ../sites-available/default.conf "conf/sites-enabled"; \ # Install openssl if we need to generate a self-signed certificate. apk add --no-cache openssl |