From fdc7689bda3bca30d67ed04a57ebf91a9ed3f7ea Mon Sep 17 00:00:00 2001 From: Julien Cabillot Date: Wed, 1 Nov 2017 17:27:07 +0100 Subject: [PATCH 1/9] on tourne sans root, quotes --- Dockerfile | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index b4bb663..8ebe1e5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,21 @@ -FROM php:apache +FROM "php:apache" -RUN apt-get update && \ +RUN sed -i'' 's/^Listen 80$/Listen 8080/' "/etc/apache2/ports.conf" && \ + sed -i'' 's/^$//' '/etc/apache2/sites-enabled/000-default.conf' && \ + apt-get update && \ apt-get -y install libpng12-dev && \ docker-php-ext-install gd && \ apt-get clean all && \ a2enmod headers && \ - rm -rf /usr/share/doc/* \ - /var/cache/* \ - /var/lib/apt/lists/* + rm -rf "/usr/share/doc/*" \ + "/var/cache/*" \ + "/var/lib/apt/lists/*" \ + "/var/www/html" -COPY src/ /var/www/html/ -RUN chown -R www-data:www-data /var/www/html/ +COPY "src" "/var/www/html" +RUN chown -R "www-data":"www-data" "/var/www/html/" + +USER "www-data" HEALTHCHECK --interval=10s \ - CMD curl --fail "http://localhost" || exit 1 \ No newline at end of file + CMD curl --fail "http://localhost:8080" || exit 1 From b61dbce76549a07597033394128aff47dd8edc58 Mon Sep 17 00:00:00 2001 From: Julien Cabillot Date: Wed, 1 Nov 2017 17:31:44 +0100 Subject: [PATCH 2/9] on pin la version de php:apache --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 29ba45a..889392e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM "php:apache" +FROM "php:7.1-apache" WORKDIR "/var/www" From 0122eb7ffd58d8edf03a27b6681d4e7f7bd5aff7 Mon Sep 17 00:00:00 2001 From: Julien Cabillot Date: Fri, 3 Nov 2017 08:42:34 +0100 Subject: [PATCH 3/9] =?UTF-8?q?m=C3=A9nage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 889392e..4dbf0bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,11 +9,14 @@ RUN sed -i'' 's/^Listen 80$/Listen 8080/' "/etc/apache2/ports.conf" && \ docker-php-ext-install gd && \ apt-get clean all && \ a2enmod headers && \ - rm -rf "/var/www/html" && \ - git clone "https://github.com/blueimp/jQuery-File-Upload.git" "html" && \ rm -rf "/usr/share/doc/*" \ - "/var/cache/*" \ - "/var/lib/apt/lists/*" + "/var/cache/*" \ + "/var/lib/apt/lists/*" \ + "/usr/src/*" \ + "/var/cache/*" \ + "/var/log/"{apt/*,dpkg.log} \ + "/var/www/html" && \ + git clone "https://github.com/blueimp/jQuery-File-Upload.git" "html" RUN chown -R "www-data":"www-data" "/var/www/html" From d3b5117eda57157338e8a670d43051999fee994d Mon Sep 17 00:00:00 2001 From: Julien Cabillot Date: Fri, 3 Nov 2017 08:50:53 +0100 Subject: [PATCH 4/9] =?UTF-8?q?m=C3=A9nage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4dbf0bc..7f1965d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,8 @@ RUN sed -i'' 's/^Listen 80$/Listen 8080/' "/etc/apache2/ports.conf" && \ "/usr/src/*" \ "/var/cache/*" \ "/var/log/"{apt/*,dpkg.log} \ - "/var/www/html" && \ + "/var/www/html" \ + "/tmp/*" && \ git clone "https://github.com/blueimp/jQuery-File-Upload.git" "html" RUN chown -R "www-data":"www-data" "/var/www/html" From 1d034f5bd927e9e5b3e0b4e4dba4bc0778d13f9b Mon Sep 17 00:00:00 2001 From: Julien Cabillot Date: Sun, 5 Nov 2017 19:11:25 +0100 Subject: [PATCH 5/9] ajout de tiny comme init --- Dockerfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7f1965d..24ec9d0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,15 @@ RUN sed -i'' 's/^Listen 80$/Listen 8080/' "/etc/apache2/ports.conf" && \ RUN chown -R "www-data":"www-data" "/var/www/html" +# Add Tini +ENV "TINI_VERSION" "v0.16.1" +ADD "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini" "/tini" +RUN chmod +x "/tini" +ENTRYPOINT ["/tini", "--"] + USER "www-data" -HEALTHCHECK --interval=10s \ +CMD [ "docker-php-entrypoint", "apache2-foreground" ] + +HEALTHCHECK --interval="10s" \ CMD curl --fail "http://localhost:8080" || exit 1 From aca1c471c67c042504739c2501868cf6ceb54dbd Mon Sep 17 00:00:00 2001 From: Julien Cabillot Date: Mon, 6 Nov 2017 19:32:14 +0100 Subject: [PATCH 6/9] =?UTF-8?q?passage=20=C3=A0=20www/phpapache?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 36 ++++++------------------------------ 1 file changed, 6 insertions(+), 30 deletions(-) diff --git a/Dockerfile b/Dockerfile index 24ec9d0..28b53bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,35 +1,11 @@ -FROM "php:7.1-apache" +ARG VERSION=latest +FROM "registry.cabillot.eu/www/phpapache":${VERSION} +MAINTAINER "Julien Cabillot " -WORKDIR "/var/www" - -RUN sed -i'' 's/^Listen 80$/Listen 8080/' "/etc/apache2/ports.conf" && \ - sed -i'' 's/^$//' '/etc/apache2/sites-enabled/000-default.conf' && \ - apt-get update && \ +RUN apt-get update && \ apt-get -y install libpng12-dev git && \ docker-php-ext-install gd && \ apt-get clean all && \ a2enmod headers && \ - rm -rf "/usr/share/doc/*" \ - "/var/cache/*" \ - "/var/lib/apt/lists/*" \ - "/usr/src/*" \ - "/var/cache/*" \ - "/var/log/"{apt/*,dpkg.log} \ - "/var/www/html" \ - "/tmp/*" && \ - git clone "https://github.com/blueimp/jQuery-File-Upload.git" "html" - -RUN chown -R "www-data":"www-data" "/var/www/html" - -# Add Tini -ENV "TINI_VERSION" "v0.16.1" -ADD "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini" "/tini" -RUN chmod +x "/tini" -ENTRYPOINT ["/tini", "--"] - -USER "www-data" - -CMD [ "docker-php-entrypoint", "apache2-foreground" ] - -HEALTHCHECK --interval="10s" \ - CMD curl --fail "http://localhost:8080" || exit 1 + rmdir "/var/www/html" && \ + git clone "https://github.com/blueimp/jQuery-File-Upload.git" "/var/www/html" From deba5c1627e406c0a3d564205f638f2550952b3c Mon Sep 17 00:00:00 2001 From: Julien Cabillot Date: Mon, 6 Nov 2017 19:38:15 +0100 Subject: [PATCH 7/9] =?UTF-8?q?headers=20n'est=20plus=20n=C3=A9cessaire,?= =?UTF-8?q?=20changement=20du=20workdir=20sinon=20le=20git=20clone=20plant?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 28b53bc..931039d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,10 +2,12 @@ ARG VERSION=latest FROM "registry.cabillot.eu/www/phpapache":${VERSION} MAINTAINER "Julien Cabillot " +# Nécessaire pour le git clone plus loin +WORKDIR "/var/www" + RUN apt-get update && \ apt-get -y install libpng12-dev git && \ docker-php-ext-install gd && \ apt-get clean all && \ - a2enmod headers && \ rmdir "/var/www/html" && \ git clone "https://github.com/blueimp/jQuery-File-Upload.git" "/var/www/html" From 82c3332b64fefc546d6f281824dcb95fa3f3a0fc Mon Sep 17 00:00:00 2001 From: Julien Cabillot Date: Mon, 6 Nov 2017 19:44:59 +0100 Subject: [PATCH 8/9] purge des executables --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 931039d..662b50e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -ARG VERSION=latest -FROM "registry.cabillot.eu/www/phpapache":${VERSION} +ARG VERSION="latest" +FROM "registry.cabillot.eu/www/phpapache:${VERSION}" MAINTAINER "Julien Cabillot " # Nécessaire pour le git clone plus loin @@ -10,4 +10,5 @@ RUN apt-get update && \ docker-php-ext-install gd && \ apt-get clean all && \ rmdir "/var/www/html" && \ - git clone "https://github.com/blueimp/jQuery-File-Upload.git" "/var/www/html" + git clone "https://github.com/blueimp/jQuery-File-Upload.git" "/var/www/html" && \ + apt-get -y autoremove --purge git libpng12-dev From 0b39449cc8c77556d39016283ae03fce18033fb1 Mon Sep 17 00:00:00 2001 From: Julien Cabillot Date: Tue, 7 Nov 2017 09:33:09 +0100 Subject: [PATCH 9/9] =?UTF-8?q?m=C3=A9nage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 662b50e..5e4f18d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,4 +11,12 @@ RUN apt-get update && \ apt-get clean all && \ rmdir "/var/www/html" && \ git clone "https://github.com/blueimp/jQuery-File-Upload.git" "/var/www/html" && \ - apt-get -y autoremove --purge git libpng12-dev + apt-get -y autoremove --purge git libpng12-dev && \ + apt-get -y clean all && \ + rm -rf "/usr/share/doc/*" \ + "/var/cache/*" \ + "/var/lib/apt/lists/*" \ + "/usr/src/*" \ + "/var/cache/*" \ + "/var/log/"{apt/*,dpkg.log} \ + "/tmp/*"