From 02ad396a6a33b762940056de415a66b69ade50bd Mon Sep 17 00:00:00 2001 From: a-sansara Date: Mon, 30 Jan 2017 02:58:46 +0100 Subject: [PATCH] fix php7 & add symfony-php7 --- DOCKER.md | 6 +- README.md | 6 +- pluie/alpine-apache-fpm/README.md | 6 +- pluie/alpine-apache-php7/README.md | 4 +- pluie/alpine-apache-php7/files.tar | Bin 10240 -> 10240 bytes .../install.d/50-fix-apache.sh | 4 +- pluie/alpine-apache/README.md | 6 +- pluie/alpine-mysql/README.md | 6 +- .../.gitignore | 0 pluie/alpine-symfony-php7/Dockerfile | 19 +++++ pluie/alpine-symfony-php7/README.md | 77 ++++++++++++++++++ pluie/alpine-symfony-php7/build | 22 +++++ pluie/alpine-symfony-php7/files.tar | Bin 0 -> 10240 bytes .../install.d/10-symfony.sh | 7 ++ pluie/alpine-symfony-php7/main.sh | 8 ++ .../pre-init.d/10-symfony.sh | 13 +++ pluie/alpine-symfony/Dockerfile | 2 +- pluie/alpine-symfony/README.md | 6 +- pluie/alpine-symfony/pre-init.d/10-symfony.sh | 7 +- pluie/alpine/README.md | 8 +- 20 files changed, 185 insertions(+), 22 deletions(-) rename pluie/{alpine-apache-php7 => alpine-symfony-php7}/.gitignore (100%) create mode 100644 pluie/alpine-symfony-php7/Dockerfile create mode 100644 pluie/alpine-symfony-php7/README.md create mode 100755 pluie/alpine-symfony-php7/build create mode 100644 pluie/alpine-symfony-php7/files.tar create mode 100755 pluie/alpine-symfony-php7/install.d/10-symfony.sh create mode 100755 pluie/alpine-symfony-php7/main.sh create mode 100755 pluie/alpine-symfony-php7/pre-init.d/10-symfony.sh diff --git a/DOCKER.md b/DOCKER.md index 1414ad2..98c8a1a 100644 --- a/DOCKER.md +++ b/DOCKER.md @@ -6,7 +6,8 @@ - [pluie/alpine-apache-fpm][7] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 Fpm - [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.1 - [pluie/alpine-apache-php7][8] ( ~ 50 MB ) Apache/2.4.25 Php/7.0.15 - - [pluie/alpine-mysql][4] ( ~172 MB ) MariaDb/10.1.14 + - [pluie/alpine-symfony-php7][9] ( ~ 82 MB ) Symfony2.8 or 3.2 Php/7.0.15 + - [pluie/alpine-mysql][4] ( ~172 MB ) Mysql/5.5.47 ( MariaDB ) - [docker tips][5] ### Networking @@ -163,4 +164,5 @@ docker run --name symfony --restart=always \ [7]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-fpm [5]: https://github.com/pluie-org/docker-images/blob/master/DOCKER.md [6]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony - [8]: https://github.com/pluie-org/docker-images/tree/master/pluie/7alpine-php + [8]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-php7 + [9]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony-php7 diff --git a/README.md b/README.md index ca81ed8..572ef63 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,8 @@ various based images for Docker - [pluie/alpine-apache-fpm][7] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 Fpm - [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.1 - [pluie/alpine-apache-php7][8] ( ~ 50 MB ) Apache/2.4.25 Php/7.0.15 - - [pluie/alpine-mysql][4] ( ~172 MB ) MariaDb/10.1.14 + - [pluie/alpine-symfony-php7][9] ( ~ 82 MB ) Symfony2.8 or 3.2 Php/7.0.15 + - [pluie/alpine-mysql][4] ( ~172 MB ) Mysql/5.5.47 ( MariaDB ) - [docker tips][5] ## Base Image Structure @@ -80,4 +81,5 @@ you can keep same __build__ script in any project [7]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-fpm [5]: https://github.com/pluie-org/docker-images/blob/master/DOCKER.md [6]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony - [8]: https://github.com/pluie-org/docker-images/tree/master/pluie/7alpine-php + [8]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-php7 + [9]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony-php7 diff --git a/pluie/alpine-apache-fpm/README.md b/pluie/alpine-apache-fpm/README.md index 3c5dc8d..86402d7 100644 --- a/pluie/alpine-apache-fpm/README.md +++ b/pluie/alpine-apache-fpm/README.md @@ -6,7 +6,8 @@ - [pluie/alpine-apache-fpm][7] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 Fpm - [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.1 - [pluie/alpine-apache-php7][8] ( ~ 50 MB ) Apache/2.4.25 Php/7.0.15 - - [pluie/alpine-mysql][4] ( ~172 MB ) MariaDb/10.1.14 + - [pluie/alpine-symfony-php7][9] ( ~ 82 MB ) Symfony2.8 or 3.2 Php/7.0.15 + - [pluie/alpine-mysql][4] ( ~172 MB ) Mysql/5.5.47 ( MariaDB ) - [docker tips][5] Extend pluie/alpine with __apache 2.4.23__ and __php 5.6.24__ with FPM @@ -95,4 +96,5 @@ $ docker exec -it afpm "httpd -h" [7]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-fpm [5]: https://github.com/pluie-org/docker-images/blob/master/DOCKER.md [6]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony - [8]: https://github.com/pluie-org/docker-images/tree/master/pluie/7alpine-php + [8]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-php7 + [9]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony-php7 diff --git a/pluie/alpine-apache-php7/README.md b/pluie/alpine-apache-php7/README.md index 4843c1d..bd8ad35 100644 --- a/pluie/alpine-apache-php7/README.md +++ b/pluie/alpine-apache-php7/README.md @@ -4,8 +4,9 @@ - [pluie/alpine][2] ( < 10 MB ) Alpine/3.4 - [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 - [pluie/alpine-apache-fpm][7] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 Fpm - - [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.0 + - [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.1 - [pluie/alpine-apache-php7][8] ( ~ 50 MB ) Apache/2.4.25 Php/7.0.15 + - [pluie/alpine-symfony-php7][9] ( ~ 82 MB ) Symfony2.8 or 3.2 Php/7.0.15 - [pluie/alpine-mysql][4] ( ~172 MB ) Mysql/5.5.47 ( MariaDB ) - [docker tips][5] @@ -92,3 +93,4 @@ $ docker exec -it php7 "httpd -h" [5]: https://github.com/pluie-org/docker-images/blob/master/DOCKER.md [6]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony [8]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-php7 + [9]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony-php7 diff --git a/pluie/alpine-apache-php7/files.tar b/pluie/alpine-apache-php7/files.tar index 73d370bc3891e15262e8764ef856b3365c4318ad..559c3d7cae46037dc686f4a31840174f29c4ef04 100644 GIT binary patch delta 90 zcmZn&Xb9NQDlb7cm@DX)78mIQd7J&jHVFa%+cp;; delta 90 zcmZn&Xb9NQDQ&;%%BW?*c_pkM%z k5te0U&dE%gtSBZU2&DB3G78KU^h=A2^ntw1eqx&h0pCRzDF6Tf diff --git a/pluie/alpine-apache-php7/install.d/50-fix-apache.sh b/pluie/alpine-apache-php7/install.d/50-fix-apache.sh index 59afa2e..b85c386 100755 --- a/pluie/alpine-apache-php7/install.d/50-fix-apache.sh +++ b/pluie/alpine-apache-php7/install.d/50-fix-apache.sh @@ -16,8 +16,8 @@ function a2setModule(){ sed -i "s#${scom}LoadModule $2_module modules/mod_$2.so#${rcom}LoadModule $2_module modules/mod_$2.so#" "$path" fi } -if [ ! -f /usr/lib/php ]; then - ln -s /usr/lib/php7 /usr/lib/php +if [ ! -f /usr/bin/php ]; then + ln -s /usr/bin/php7 /usr/bin/php fi if [ ! -f /usr/lib/libxml2.so ]; then ln -s /usr/lib/libxml2.so.2 /usr/lib/libxml2.so diff --git a/pluie/alpine-apache/README.md b/pluie/alpine-apache/README.md index 2f58cb7..5db30d4 100644 --- a/pluie/alpine-apache/README.md +++ b/pluie/alpine-apache/README.md @@ -4,8 +4,9 @@ - [pluie/alpine][2] ( < 10 MB ) Alpine/3.4 - [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 - [pluie/alpine-apache-fpm][7] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 Fpm - - [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.0 + - [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.1 - [pluie/alpine-apache-php7][8] ( ~ 50 MB ) Apache/2.4.25 Php/7.0.15 + - [pluie/alpine-symfony-php7][9] ( ~ 82 MB ) Symfony2.8 or 3.2 Php/7.0.15 - [pluie/alpine-mysql][4] ( ~172 MB ) Mysql/5.5.47 ( MariaDB ) - [docker tips][5] @@ -91,4 +92,5 @@ $ docker exec -it apache "httpd -h" [7]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-fpm [5]: https://github.com/pluie-org/docker-images/blob/master/DOCKER.md [6]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony - [8]: https://github.com/pluie-org/docker-images/tree/master/pluie/7alpine-php + [8]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-php7 + [9]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony-php7 diff --git a/pluie/alpine-mysql/README.md b/pluie/alpine-mysql/README.md index bf1d5bf..79dabd9 100644 --- a/pluie/alpine-mysql/README.md +++ b/pluie/alpine-mysql/README.md @@ -6,7 +6,8 @@ - [pluie/alpine-apache-fpm][7] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 Fpm - [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.1 - [pluie/alpine-apache-php7][8] ( ~ 50 MB ) Apache/2.4.25 Php/7.0.15 - - [pluie/alpine-mysql][4] ( ~172 MB ) MariaDb/10.1.14 + - [pluie/alpine-symfony-php7][9] ( ~ 82 MB ) Symfony2.8 or 3.2 Php/7.0.15 + - [pluie/alpine-mysql][4] ( ~172 MB ) Mysql/5.5.47 ( MariaDB ) - [docker tips][5] Extend pluie/alpine with mysql (MariaDb/10.1.14) @@ -134,4 +135,5 @@ docker run --name mycontainer --link mysql:db ... [7]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-fpm [5]: https://github.com/pluie-org/docker-images/blob/master/DOCKER.md [6]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony - [8]: https://github.com/pluie-org/docker-images/tree/master/pluie/7alpine-php + [8]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-php7 + [9]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony-php7 diff --git a/pluie/alpine-apache-php7/.gitignore b/pluie/alpine-symfony-php7/.gitignore similarity index 100% rename from pluie/alpine-apache-php7/.gitignore rename to pluie/alpine-symfony-php7/.gitignore diff --git a/pluie/alpine-symfony-php7/Dockerfile b/pluie/alpine-symfony-php7/Dockerfile new file mode 100644 index 0000000..57edea8 --- /dev/null +++ b/pluie/alpine-symfony-php7/Dockerfile @@ -0,0 +1,19 @@ +# @app pluie/alpine-apache +# @author a-Sansara https://git.pluie.org/pluie/docker-images + +FROM pluie/alpine-apache-php7 + +MAINTAINER a-Sansara https://github.com/a-sansara + +ADD files.tar /scripts + +ENV SHENV_NAME=Symfony \ + SHENV_COLOR=33 \ + HTTP_SERVER_NAME=symfony.docker \ + WWW_DIR=web \ + WWW_INDEX=app.php \ + SYMFONY_VERSION=3.2 + +EXPOSE 80 + +RUN bash /scripts/install.sh diff --git a/pluie/alpine-symfony-php7/README.md b/pluie/alpine-symfony-php7/README.md new file mode 100644 index 0000000..6f1a578 --- /dev/null +++ b/pluie/alpine-symfony-php7/README.md @@ -0,0 +1,77 @@ +# pluie/alpine-apache + +- [index][1] +- [pluie/alpine][2] ( < 10 MB ) Alpine/3.4 + - [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 + - [pluie/alpine-apache-fpm][7] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 Fpm + - [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.1 + - [pluie/alpine-apache-php7][8] ( ~ 50 MB ) Apache/2.4.25 Php/7.0.15 + - [pluie/alpine-symfony-php7][9] ( ~ 82 MB ) Symfony2.8 or 3.2 Php/7.0.15 + - [pluie/alpine-mysql][4] ( ~172 MB ) Mysql/5.5.47 ( MariaDB ) +- [docker tips][5] + +Extend pluie/alpine-apache-php7. + +if __/app/$WWW_DIR__ does not exits then __pluie/alpine-symfony-php7__ install +the symfony framework with $SYMFONY_VERSION version on the /app directory + +## Image Size + +- image ~ 82 MB + +## ENV variables + +``` + SYMFONY_VERSION=3.2 # symfony version +``` + +### Inherit ENV variables + +``` + HTTP_SERVER_NAME=symfony.docker # apache ServerName + WWW_DIR=web # DocumentRoot relative to volume + WWW_INDEX=app.php # DirectoryIndex + SHENV_CTX=LOCAL # LOCAL|INT|PROD change context bg color + SHENV_NAME=symfony # container name + SHENV_COLOR=33 # ANSI EXTENDED COLOR CODE + FIX_OWNERSHIP=1 + TZ=Europe/Paris # TIMEZONE +``` + +## Image Volumes + +- __/app__ directory is a docker volume bind to your symfony project + +__/app/$WWW_DIR__ is the documentRoot. + +__/app/vhost__ is your app vhost configuration file (with a serverName directive). +by default it use the apache rewrite module to redirect all uri to entry point $WWW_INDEX + + +## Image Usage + +chdir to your project directory +``` +$ docker run --name symfony -it --link=mysql:db -v $(pwd):/app pluie/alpine-symfony-php7 +``` +or +``` +$ docker run --name symfony -d --link=mysql:db -e HTTP_SERVER_NAME=yourServerName -v $(pwd):/app pluie/alpine-symfony-php7 +``` + +## Connect to container + +``` +$ docker exec -it symfony bash +``` + + + [1]: https://github.com/pluie-org/docker-images + [2]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine + [3]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache + [4]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-mysql + [7]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-fpm + [5]: https://github.com/pluie-org/docker-images/blob/master/DOCKER.md + [6]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony + [8]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-php7 + [9]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony-php7 diff --git a/pluie/alpine-symfony-php7/build b/pluie/alpine-symfony-php7/build new file mode 100755 index 0000000..09b3da8 --- /dev/null +++ b/pluie/alpine-symfony-php7/build @@ -0,0 +1,22 @@ +#!/bin/bash +# @app pluie/alpine-apache +# @author a-Sansara https://git.pluie.org/pluie/docker-images + + Ctitle="\033[1;38;5;15;1;48;5;30m" + Citem="\033[1;38;5;36m" + Coff="\033[m" + DOCKDIR=$(dirname "$(readlink -f ${BASH_SOURCE[0]})") +DOCKBUILD=$(basename $DOCKDIR) + DOCKREPO=$(basename $(dirname $DOCKDIR)) + DOCKTAG=${1:-"latest"} + TMPPWD=$(pwd) + indent=" " +cd $DOCKDIR +echo -e "\n ${Ctitle} Preparing files : ${Coff}${Citem}\n" + +tar -cvf files.tar *.sh pre-init.d/ install.d/ | sed "s/^/${indent}↠ /" + +echo -e "\n ${Ctitle} Proceed Dockerfile build : ${Coff}\n +" +docker build --force-rm -t ${DOCKREPO}/${DOCKBUILD}:${DOCKTAG} . | sed "s/^/${indent}/" +cd $TMPPWD diff --git a/pluie/alpine-symfony-php7/files.tar b/pluie/alpine-symfony-php7/files.tar new file mode 100644 index 0000000000000000000000000000000000000000..ff9e89c39e7035c39121cb2392192acbc46ce5d8 GIT binary patch literal 10240 zcmeH~Uu)Yi5WxNHPjOBAw4%s=q8PfD4bqOnmVmP^lrf5GyRoP(3(INRZ$HUSw$Q;E z*gP6`BA|0lI*H%u?xd0nIn=q+XY)*pBIcORkC?aHTa_0?BgYRt^J9#8f#dnXI2=3R z^|`67?UinL4d8I1xzxPoTg9{fCH=GEhw^!RL~n(pw_NA$F}&kSLEBWZ5*g)%5;7xP z@g&b${i?|;g9|vBceo&L8l}%DU5aMd&Kg$rl6LdcD!I>UB1*o@wCfIm>ZBH`(KM;b zva%=7b%hkoXVDZH4CclcjgZR$4BoeE!h~mL+`zS~q(CNcF^kVX#IvjE#61+ouX&%U z&WLruFr~e1)5iGk;@_xk{EtHBvmmhXABMrm0oL1&b`1aL@xSAL-y`~|ysPBXUoHqQ z`F|8e&-~BEKEwRKb4q&?_saj9WAWz&K-|GsI0BLaHI;^*EEbEK$z=@R-a?aS(zT^0 zG0LV?tz6!xqK56T_OH!eKxS*O)#_w^{pn&hy}tQ!9?vgl({A2_)zLTIGM(AHT1y}? z_~tmCbro$d^#iXr2Fl7*pcs~?>vp1hCl0>^32E*>MbT&axA(n0^S>9Ekv9JaBM1_|BQtp=Kmcx^(Ow?{Lj@rkSpM63My9-5lJN