Compare commits

...

19 Commits
1.2 ... master

Author SHA1 Message Date
a-Sansara
09b2d8f1a0 update summary menu in all readme 2018-08-14 02:43:27 +02:00
a-Sansara
e946a39e7c add base ubuntu lts + update libyaml with base ubuntu 2018-08-14 02:21:22 +02:00
a-Sansara
2e5e401c85 adding vala shared lib pluie-yaml-0.4 2018-08-08 01:18:37 +02:00
a-Sansara
b525151f68 update libecho to version 0.2 2017-11-18 00:00:49 +01:00
a-Sansara
db06c5d107 update libecho README 2017-11-07 02:24:34 +01:00
a-Sansara
ffe9dc8cb0 adding vala shared lib libpluie-echo-0.1 2017-11-05 15:22:53 +01:00
a-sansara
43ca75bef6 fix TZ inheritance on install & init process 2017-07-05 21:20:53 +02:00
a-sansara
32093e01d6 amend 2017-03-18 02:24:19 +01:00
a-sansara
232ea7a8da update all images with alpine 3.5 - remove edge for php7 versions 2017-03-18 02:16:10 +01:00
a-sansara
28533f0cce fixing symfony init + enabling gateway ip on dev 2017-03-16 04:35:46 +01:00
a-sansara
9cabf4d736 Merge branch 'master' of https://git.pluie.org/pluie/docker-images 2017-03-15 04:41:30 +01:00
a-sansara
3951d9deb1 fix apache $WWW-DIR creation 2017-03-15 04:35:10 +01:00
a-sansara
17163c9b3d add fpm-php7 2017-02-16 14:30:26 +01:00
a-sansara
9852484282 update readme 2017-01-30 03:31:26 +01:00
a-sansara
02ad396a6a fix php7 & add symfony-php7 2017-01-30 02:58:46 +01:00
a-sansara
88e1b70c4d update README 2017-01-30 00:33:26 +01:00
a-sansara
125eb03dee add files.tar for automated build 2017-01-30 00:16:30 +01:00
a-sansara
7ddff5a239 amend 2017-01-30 00:12:54 +01:00
a-sansara
b92bff465d adding pluie/alpine-apache-php7 2017-01-29 23:44:52 +01:00
88 changed files with 1420 additions and 100 deletions

View File

@ -1,11 +1,16 @@
## Docker
- [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-mysql][4] ( ~172 MB ) MariaDb/10.1.14
- [pluie/alpine][2] ( ~ 9 MB ) Alpine/3.5
- [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.25 Php/5.6.30
- [pluie/alpine-apache-fpm][7] ( ~ 51 MB ) Apache/2.4.25 Php/5.6.30 Fpm
- [pluie/alpine-symfony][6] ( ~ 83 MB ) Symfony2.8 or 3.2
- [pluie/alpine-apache-php7][8] ( ~ 45 MB ) Apache/2.4.25 Php/7.0.16
- [pluie/alpine-symfony-php7][9] ( ~ 77 MB ) Symfony2.8 or 3.2 Php/7.0.16
- [pluie/alpine-mysql][4] ( ~181 MB ) Mysql/5.6 ( MariaDB )
- [pluie/libecho][10] ( ~288 MB ) Vala 0.34.2 pluie-echo-0.2
- [pluie/ubuntu][12] ( ~141 MB ) Ubuntu 18.04
- [pluie/libyaml][11] ( ~538 MB ) Vala 0.40.4 pluie-yaml-0.4
- [docker tips][5]
### Networking
@ -34,6 +39,7 @@ docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}
172.22.0.6 wordpress.docker
172.22.0.7 fpm.docker
172.22.0.8 symfony.docker
172.22.0.9 php7.docker
# <
```
@ -72,13 +78,13 @@ docker stats container
#### map
[db.docker] (http://db.docker)
[pma.docker] (http://pma.docker)
[gogs.docker] (http://gogs.docker)
[bo-payment.docker] (http://bo-payment.docker)
[wordpress.docker] (http://wordpress.docker)
[fpm.docker] (http://symfony.docker)
[symfony.docker] (http://symfony.docker)
[db.docker](http://db.docker)
[pma.docker](http://pma.docker)
[gogs.docker](http://gogs.docker)
[bo-payment.docker](http://bo-payment.docker)
[wordpress.docker](http://wordpress.docker)
[fpm.docker](http://symfony.docker)
[symfony.docker](http://symfony.docker)
#### Mysql
```
@ -122,6 +128,18 @@ docker run --name apache --restart=always \
-d pluie/alpine-apache
```
#### Apache Php7
```
cd /home/dev/docker
docker run --name php7 --restart=always \
--net home0 -h bo-payment.docker --ip 172.22.0.9 --link mysql:db \
-v $(pwd)/repo/pws-server:/app \
-e HTTP_SERVER_NAME=bo-payment.docker \
-e WWW_DIR=web \
-d pluie/alpine-apache-php7
```
#### Wordpress
```
cd /home/dev/docker
@ -153,6 +171,17 @@ docker run --name symfony --restart=always \
-e SYMFONY_VERSION=2.8 \
-v $(pwd)/repo/myapp:/app \
-d pluie/alpine-symfony
```
### Symfony Php7
```
cd /home/dev/docker
docker run --name symfony --restart=always \
--net home0 -h symfony.docker --ip 172.22.0.8 --link=mysql:db \
-e HTTP_SERVER_NAME=symfony \
-e SYMFONY_VERSION=3.2 \
-v $(pwd)/repo/myapp:/app \
-d pluie/alpine-symfony-php7
```
[1]: https://github.com/pluie-org/docker-images
@ -162,3 +191,8 @@ 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/alpine-apache-php7
[9]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony-php7
[10]: https://github.com/pluie-org/docker-images/tree/master/pluie/libecho
[11]: https://github.com/pluie-org/docker-images/tree/master/pluie/libyaml
[12]: https://github.com/pluie-org/docker-images/tree/master/pluie/ubuntu

View File

@ -5,11 +5,16 @@ various based images for Docker
## Available Images
- [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-mysql][4] ( ~172 MB ) MariaDb/10.1.14
- [pluie/alpine][2] ( ~ 9 MB ) Alpine/3.5
- [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.25 Php/5.6.30
- [pluie/alpine-apache-fpm][7] ( ~ 51 MB ) Apache/2.4.25 Php/5.6.30 Fpm
- [pluie/alpine-symfony][6] ( ~ 83 MB ) Symfony2.8 or 3.2
- [pluie/alpine-apache-php7][8] ( ~ 45 MB ) Apache/2.4.25 Php/7.0.16
- [pluie/alpine-symfony-php7][9] ( ~ 77 MB ) Symfony2.8 or 3.2 Php/7.0.16
- [pluie/alpine-mysql][4] ( ~181 MB ) Mysql/5.6 ( MariaDB )
- [pluie/libecho][10] ( ~288 MB ) Vala 0.34.2 pluie-echo-0.2
- [pluie/ubuntu][12] ( ~141 MB ) Ubuntu 18.04
- [pluie/libyaml][11] ( ~538 MB ) Vala 0.40.4 pluie-yaml-0.4
- [docker tips][5]
## Base Image Structure
@ -79,3 +84,8 @@ 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/alpine-apache-php7
[9]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony-php7
[10]: https://github.com/pluie-org/docker-images/tree/master/pluie/libecho
[11]: https://github.com/pluie-org/docker-images/tree/master/pluie/libyaml
[12]: https://github.com/pluie-org/docker-images/tree/master/pluie/ubuntu

View File

@ -13,7 +13,7 @@ ENV SHENV_NAME=ApacheFpm \
WWW_DIR=www \
WWW_INDEX=index.php \
FIX_OWNERSHIP=1 \
TZ=Europe/Paris
TZ=Europe/Paris
EXPOSE 80

View File

@ -1,26 +1,31 @@
# 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-mysql][4] ( ~172 MB ) MariaDb/10.1.14
- [pluie/alpine][2] ( ~ 9 MB ) Alpine/3.5
- [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.25 Php/5.6.30
- [pluie/alpine-apache-fpm][7] ( ~ 51 MB ) Apache/2.4.25 Php/5.6.30 Fpm
- [pluie/alpine-symfony][6] ( ~ 83 MB ) Symfony2.8 or 3.2
- [pluie/alpine-apache-php7][8] ( ~ 45 MB ) Apache/2.4.25 Php/7.0.16
- [pluie/alpine-symfony-php7][9] ( ~ 77 MB ) Symfony2.8 or 3.2 Php/7.0.16
- [pluie/alpine-mysql][4] ( ~181 MB ) Mysql/5.6 ( MariaDB )
- [pluie/libecho][10] ( ~288 MB ) Vala 0.34.2 pluie-echo-0.2
- [pluie/ubuntu][12] ( ~141 MB ) Ubuntu 18.04
- [pluie/libyaml][11] ( ~538 MB ) Vala 0.40.4 pluie-yaml-0.4
- [docker tips][5]
Extend pluie/alpine with __apache 2.4.23__ and __php 5.6.24__ with FPM
Extend pluie/alpine with __apache 2.4.25__ and __php 5.6.30__ with FPM
- you can use env var at container creation : __HTTP_SERVER_NAME__ (default : fpm.docker ortherwise edit app/vhost later)
## Image Size
- image ~ 50 MB
- image ~ 51 MB
## ENV variables
```
HTTP_SERVER_NAME=apache.docker # apache ServerName
HTTP_SERVER_NAME=fpm.docker # apache ServerName
WWW_DIR=www # DocumentRoot relative to volume
WWW_INDEX=index.php # DirectoryIndex
FIX_OWNERSHIP=1 #
@ -30,7 +35,7 @@ Extend pluie/alpine with __apache 2.4.23__ and __php 5.6.24__ with FPM
```
SHENV_CTX=LOCAL # LOCAL|INT|PROD change context bg color
SHENV_NAME=Apache # container name
SHENV_NAME=ApacheFpm # container name
SHENV_COLOR=67 # ANSI EXTENDED COLOR CODE
TZ=Europe/Paris # TIMEZONE
```
@ -66,17 +71,20 @@ by default it use the apache rewrite module to redirect all uri to entry point $
chdir to your project directory
```
$ docker run --name afpm -it --link=mysql:db1 -v $(pwd):/app pluie/alpine-apache-fpm
$ docker run --name afpm -it --link=mysql:db -v $(pwd):/app pluie/alpine-apache-fpm
```
or
```
$ docker run --name afpm -d --link=mysql:db1 -e HTTP_SERVER_NAME=yourServerName -v $(pwd):/app pluie/alpine-apache-fpm
$ docker run --name afpm -d --link=mysql:db -e HTTP_SERVER_NAME=yourServerName -v $(pwd):/app pluie/alpine-apache-fpm
```
## Controling http server
```
# reload
$ docker exec -it afpm "httpd -k graceful"
# restart
$ docker exec -it afpm "httpd -k restart"
```
for more commands :
@ -91,3 +99,8 @@ $ 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/alpine-apache-php7
[9]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony-php7
[10]: https://github.com/pluie-org/docker-images/tree/master/pluie/libecho
[11]: https://github.com/pluie-org/docker-images/tree/master/pluie/libyaml
[12]: https://github.com/pluie-org/docker-images/tree/master/pluie/ubuntu

Binary file not shown.

View File

@ -2,7 +2,7 @@
# @app pluie/alpine-apache
# @author a-Sansara https://git.pluie.org/pluie/docker-images
apk --update add apache2 apache2-proxy apache2-proxy-html apache-mod-fcgid libxml2 \
apk add apache2 apache2-proxy apache2-proxy-html apache-mod-fcgid libxml2 \
php5-fpm php5-cli php5-phar php5-zlib php5-zip php5-ctype php5-xml php5-pdo_mysql php5-mysqli \
php5-opcache php5-pdo php5-json php5-curl php5-gd php5-mcrypt php5-openssl php5-dom \
# php-pdo_odbc php-soap php-pgsql

View File

@ -20,19 +20,12 @@ function a2setModule(){
if [ ! -f /usr/lib/libxml2.so ]; then
ln -s /usr/lib/libxml2.so.2 /usr/lib/libxml2.so
fi
if [ ! -d /app/$WWW_DIR ]; then
mkdir -p /app/$WWW_DIR
fi
if [ ! -d /run/apache2 ]; then
mkdir /run/apache2
fi
chown -R 1000:apache /app/$WWW_DIR
chmod -R 755 /scripts/pre-init.d
mkdir -p /run/apache2
chown apache:apache /run/apache2
tmpsed='s#^DocumentRoot ".*#DocumentRoot "/app/'$WWW_DIR'"#g'
sed -i "$tmpsed" /etc/apache2/httpd.conf
sed -i 's#AllowOverride none#AllowOverride All#' /etc/apache2/httpd.conf
initTitle "Apache" "Loading Modules"
a2setModule 1 "rewrite"
a2setModule 1 "mpm_event"
@ -46,7 +39,8 @@ echo
tmpsed="/etc/php5/php.ini"
sed -ir 's/expose_php = On/expose_php = Off/' $tmpsed
sed -i "s|;*date.timezone =.*|date.timezone = ${TZ}|i" $tmpsed
sed -i "s|;*cgi.fix_pathinfo=.*|cgi.fix_pathinfo= 0|i" /etc/php5/php.ini
cat $tmpsed | grep "date.timezone"
sed -i "s|;*cgi.fix_pathinfo=.*|cgi.fix_pathinfo= 0|i" $tmpsed
tmpsed="/etc/php5/php-fpm.conf"
sed -i "s|;*daemonize\s*=\s*yes|daemonize = no|g" $tmpsed
sed -i "s|;*listen\s*=\s*127.0.0.1:9000|listen = 9000|g" $tmpsed

View File

@ -2,6 +2,17 @@
# @app pluie/alpine-apache
# @author a-Sansara https://git.pluie.org/pluie/docker-images
if [ ! -d /app/$WWW_DIR ]; then
CREATE_WWW_DIR=1
mkdir -p /app/$WWW_DIR
fi
if [ ! -f /app/$WWW_DIR/$WWW_INDEX ]; then
echo "<?php phpinfo();" > /app/$WWW_DIR/$WWW_INDEX
fi
tmpsed=/etc/apache2/httpd.conf
sed -i 's#^DocumentRoot ".*#DocumentRoot "/app/'$WWW_DIR'"#g' $tmpsed
sed -i 's#AllowOverride none#AllowOverride All#' $tmpsed
if [ ! -z "$FIX_OWNERSHIP" ] && [ "$FIX_OWNERSHIP" -eq 1 ] && [ -d /app/$WWW_DIR ]; then
chown -R 1000:apache /app/$WWW_DIR
fi

View File

@ -6,7 +6,7 @@ if [ ! -z "/app/vhost" ]; then
cat <<EOF > "/app/vhost"
<VirtualHost *:80>
ServerName $HTTP_SERVER_NAME
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=\$1
<FilesMatch \.php$>
SetHandler proxy:fcgi://127.0.0.1:9000
</FilesMatch>

View File

@ -0,0 +1,4 @@
#!/bin/bash
tmpsed="/etc/php5/php.ini"
sed -i "s|;*date.timezone =.*|date.timezone = ${TZ}|i" $tmpsed
cat $tmpsed | grep "date.timezone"

View File

@ -0,0 +1,20 @@
# @app pluie/alpine-apache
# @author a-Sansara https://git.pluie.org/pluie/docker-images
FROM pluie/alpine
MAINTAINER a-Sansara https://github.com/a-sansara
ADD files.tar /scripts
ENV SHENV_NAME=Php7 \
SHENV_COLOR=67 \
HTTP_SERVER_NAME=php7.docker \
WWW_DIR=www \
WWW_INDEX=index.php \
FIX_OWNERSHIP=1 \
TZ=Europe/Paris
EXPOSE 80
RUN bash /scripts/install.sh

View File

@ -0,0 +1,102 @@
# pluie/alpine-apache-php7
- [index][1]
- [pluie/alpine][2] ( ~ 9 MB ) Alpine/3.5
- [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.25 Php/5.6.30
- [pluie/alpine-apache-fpm][7] ( ~ 51 MB ) Apache/2.4.25 Php/5.6.30 Fpm
- [pluie/alpine-symfony][6] ( ~ 83 MB ) Symfony2.8 or 3.2
- [pluie/alpine-apache-php7][8] ( ~ 45 MB ) Apache/2.4.25 Php/7.0.16
- [pluie/alpine-symfony-php7][9] ( ~ 77 MB ) Symfony2.8 or 3.2 Php/7.0.16
- [pluie/alpine-mysql][4] ( ~181 MB ) Mysql/5.6 ( MariaDB )
- [pluie/libecho][10] ( ~288 MB ) Vala 0.34.2 pluie-echo-0.2
- [pluie/ubuntu][12] ( ~141 MB ) Ubuntu 18.04
- [pluie/libyaml][11] ( ~538 MB ) Vala 0.40.4 pluie-yaml-0.4
- [docker tips][5]
Extend pluie/alpine with __apache 2.4.25__ and __php 7.0.16__
- error log are attached to stdout
- no need port redirection
- you can use env var at container creation : __HTTP_SERVER_NAME__ (default : site.docker ortherwise edit /app/vhost later)
- you can still use ever your local http & sql server while your container(s) are running
## Image Size
- image ~ 45 MB
## ENV variables
```
HTTP_SERVER_NAME=site.docker # apache ServerName
WWW_DIR=www # DocumentRoot relative to volume
WWW_INDEX=index.php # DirectoryIndex
FIX_OWNERSHIP=1 #
```
### Inherit ENV variables
```
SHENV_CTX=LOCAL # LOCAL|INT|PROD change context bg color
SHENV_NAME=Php7 # container name
SHENV_COLOR=67 # ANSI EXTENDED COLOR CODE
TZ=Europe/Paris # TIMEZONE
```
## Image Volumes
__/app__ directory is a docker volume bind to your app project (silex/symfony etc)
__/app/$WWW_DIR__ is the documentRoot.
put only your entry point and static files to the documentRoot directory, no your app sources
(__/app__ directory is design for this).
__/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
```
/app/ # your application directory
|
|---- $WWW_DIR/ # documentRoot
|
|---- vhost # apache app vhost
```
## Image Usage
chdir to your project directory
```
$ docker run --name php7 -it --link=mysql:db -v $(pwd):/app pluie/alpine-apache
```
or
```
$ docker run --name php7 -it --link=mysql:db -e HTTP_SERVER_NAME=yourServerName -v $(pwd):/app pluie/alpine-apache-php7
```
## Controling http server
```
# reload
$ docker exec -it php7 "httpd -k graceful"
# restart
$ docker exec -it php7 "httpd -k restart"
```
for more commands :
```
$ docker exec -it php7 "httpd -h"
```
[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
[10]: https://github.com/pluie-org/docker-images/tree/master/pluie/libecho
[11]: https://github.com/pluie-org/docker-images/tree/master/pluie/libyaml
[12]: https://github.com/pluie-org/docker-images/tree/master/pluie/ubuntu

22
pluie/alpine-apache-php7/build Executable file
View File

@ -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

Binary file not shown.

View File

@ -0,0 +1,15 @@
#!/bin/bash
# @app pluie/alpine-apache-php7
# @author a-Sansara https://git.pluie.org/pluie/docker-images
#~ echo "http://dl-cdn.alpinelinux.org/alpine/edge/community
#~ http://dl-cdn.alpinelinux.org/alpine/edge/main
#~ http://dl-cdn.alpinelinux.org/alpine/edge/testing
#~ echo "http://alpine.gliderlabs.com/alpine/edge/community
#~ http://alpine.gliderlabs.com/alpine/edge/main
#~ http://alpine.gliderlabs.com/alpine/edge/testing
#~ " >> /etc/apk/repositories
#~ echo "http://dl-5.alpinelinux.org/alpine/edge/community
#~ http://dl-5.alpinelinux.org/alpine/edge/main
#~ http://dl-5.alpinelinux.org/alpine/edge/testing
#~ " > /etc/apk/repositories

View File

@ -0,0 +1,9 @@
#!/bin/bash
# @app pluie/alpine-apache
# @author a-Sansara https://git.pluie.org/pluie/docker-images
apk add apache2 apache2-proxy \
php7-apache2 php7-mbstring php7-session php7-phar php7-zlib php7-zip php7-ctype \
php7-mysqli php7-xml php7-pdo_mysql php7-opcache php7-pdo php7-json php7-curl \
php7-gd php7-mcrypt php7-openssl php7-dom \
# php-pdo_odbc php-soap php-pgsql

View File

@ -0,0 +1,46 @@
#!/bin/bash
# @app pluie/alpine-apache
# @author a-Sansara https://git.pluie.org/pluie/docker-images
function a2setModule(){
local enable=${1:-''}
local path=${3:-'/etc/apache2/httpd.conf'}
local scom=''
local rcom='\#'
if [ ! -z $1 ] && [ ! -z "$2" ]; then
if [ "$enable" = 1 ]; then
scom='\#'
rcom=''
fi
echo "$2"
sed -i "s#${scom}LoadModule $2_module modules/mod_$2.so#${rcom}LoadModule $2_module modules/mod_$2.so#" "$path"
fi
}
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
fi
if [ ! -d /run/apache2 ]; then
mkdir /run/apache2
fi
chmod -R 755 /scripts/pre-init.d
mkdir -p /run/apache2
chown apache:apache /run/apache2
initTitle "Apache" "Loading Modules"
a2setModule 1 "rewrite"
a2setModule 1 "mpm_prefork"
a2setModule 1 "slotmem_shm"
a2setModule 1 "heartmonitor"
#~ a2setModule 1 "watchdog"
initTitle "Apache" "Removing Modules"
a2setModule 0 "mpm_event"
a2setModule 0 "proxy_fdpass" /etc/apache2/conf.d/proxy.conf
sed -i "s|;*date.timezone =.*|date.timezone = ${TZ}|i" /etc/php7/php.ini
sed -ir 's/expose_php = On/expose_php = Off/' /etc/php7/php.ini
echo -e "\nIncludeOptional /app/vhost" >> /etc/apache2/httpd.conf
unset tmpsed

View File

@ -0,0 +1,8 @@
#!/bin/bash
# @app pluie/alpine-apache
# @author a-Sansara https://git.pluie.org/pluie/docker-images
. /scripts/common.sh
initTitle "Starting" "Apache Daemon"
httpd -D FOREGROUND

View File

@ -0,0 +1,23 @@
#!/usr/bin/bash
# @app pluie/alpine-apache
# @author a-Sansara https://git.pluie.org/pluie/docker-images
if [ ! -d /app/$WWW_DIR ]; then
echo create dir mode
CREATE_WWW_DIR=1
mkdir -p /app/$WWW_DIR
fi
if [ ! -f /app/$WWW_DIR/$WWW_INDEX ]; then
echo "<?php phpinfo();" > /app/$WWW_DIR/$WWW_INDEX
fi
tmpsed='s#^DocumentRoot ".*#DocumentRoot "/app/'$WWW_DIR'"#g'
sed -i "$tmpsed" /etc/apache2/httpd.conf
sed -i 's#AllowOverride none#AllowOverride All#' /etc/apache2/httpd.conf
if [ ! -z "$FIX_OWNERSHIP" ] && [ "$FIX_OWNERSHIP" -eq 1 ] && [ -d /app/$WWW_DIR ]; then
chown -R 1000:apache /app/$WWW_DIR
fi
touch /var/log/apache2/error.log
tail -F /var/log/apache2/error.log &

View File

@ -0,0 +1,24 @@
#!/usr/bin/bash
# @app pluie/alpine-apache
# @author a-Sansara https://git.pluie.org/pluie/docker-images
if [ ! -z "/app/vhost" ]; then
cat <<EOF > "/app/vhost"
<VirtualHost *:80>
ServerName $HTTP_SERVER_NAME
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=\$1
<Directory /app/$WWW_DIR>
AllowOverride None
Require all granted
DirectoryIndex $WWW_INDEX
<IfModule mod_rewrite.c>
Options -MultiViews +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ $WWW_INDEX [QSA,L]
</IfModule>
</Directory>
</VirtualHost>
# IncludeOptional /app/vhost2
EOF
fi

View File

@ -0,0 +1,4 @@
#!/bin/bash
tmpsed="/etc/php7/php.ini"
sed -i "s|;*date.timezone =.*|date.timezone = ${TZ}|i" $tmpsed
cat $tmpsed | grep "date.timezone"

View File

@ -13,7 +13,7 @@ ENV SHENV_NAME=Apache \
WWW_DIR=www \
WWW_INDEX=index.php \
FIX_OWNERSHIP=1 \
TZ=Europe/Paris
TZ=Europe/Paris
EXPOSE 80

View File

@ -1,18 +1,23 @@
# 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.0
- [pluie/alpine-mysql][4] ( ~172 MB ) Mysql/5.5.47 ( MariaDB )
- [pluie/alpine][2] ( ~ 9 MB ) Alpine/3.5
- [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.25 Php/5.6.30
- [pluie/alpine-apache-fpm][7] ( ~ 51 MB ) Apache/2.4.25 Php/5.6.30 Fpm
- [pluie/alpine-symfony][6] ( ~ 83 MB ) Symfony2.8 or 3.2
- [pluie/alpine-apache-php7][8] ( ~ 45 MB ) Apache/2.4.25 Php/7.0.16
- [pluie/alpine-symfony-php7][9] ( ~ 77 MB ) Symfony2.8 or 3.2 Php/7.0.16
- [pluie/alpine-mysql][4] ( ~181 MB ) Mysql/5.6 ( MariaDB )
- [pluie/libecho][10] ( ~288 MB ) Vala 0.34.2 pluie-echo-0.2
- [pluie/ubuntu][12] ( ~141 MB ) Ubuntu 18.04
- [pluie/libyaml][11] ( ~538 MB ) Vala 0.40.4 pluie-yaml-0.4
- [docker tips][5]
Extend pluie/alpine with __apache 2.4.23__ and __php 5.6.24__
Extend pluie/alpine with __apache 2.4.25__ and __php 5.6.30__
- error log are attached to stdout
- no need port redirection
- you can use env var at container creation : __HTTP_SERVER_NAME__ (default : docker-site.dev ortherwise edit app/vhost later)
- you can use env var at container creation : __HTTP_SERVER_NAME__ (default : apache.docker ortherwise edit app/vhost later)
- you can still use ever your local http & sql server while your container(s) are running
@ -62,23 +67,27 @@ by default it use the apache rewrite module to redirect all uri to entry point $
chdir to your project directory
```
$ docker run --name apache -it --link=mysql:db1 -v $(pwd):/app pluie/alpine-apache
$ docker run --name apache -it --link=mysql:db -v $(pwd):/app pluie/alpine-apache
```
or
```
$ docker run --name apache -it --link=mysql:db1 -e HTTP_SERVER_NAME=yourServerName -v $(pwd):/app pluie/alpine-apache
$ docker run --name apache -it --link=mysql:db -e HTTP_SERVER_NAME=yourServerName -v $(pwd):/app pluie/alpine-apache
```
## Controling http server
```
# reload
$ docker exec -it apache "httpd -k graceful"
# restart
$ docker exec -it apache "httpd -k restart"
```
for more commands :
```
$ docker exec -it apache "httpd -h"
```
[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
@ -86,3 +95,8 @@ $ 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/alpine-apache-php7
[9]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony-php7
[10]: https://github.com/pluie-org/docker-images/tree/master/pluie/libecho
[11]: https://github.com/pluie-org/docker-images/tree/master/pluie/libyaml
[12]: https://github.com/pluie-org/docker-images/tree/master/pluie/ubuntu

Binary file not shown.

View File

@ -2,7 +2,7 @@
# @app pluie/alpine-apache
# @author a-Sansara https://git.pluie.org/pluie/docker-images
apk --update add apache2 apache2-proxy \
apk add apache2 apache2-proxy \
php5-apache2 php5-cli php5-phar php5-zlib php5-zip php5-ctype php5-mysqli php5-xml php5-pdo_mysql \
php5-opcache php5-pdo php5-json php5-curl php5-gd php5-mcrypt php5-openssl php5-dom \
# php-pdo_odbc php-soap php-pgsql

View File

@ -19,21 +19,14 @@ function a2setModule(){
if [ ! -f /usr/lib/libxml2.so ]; then
ln -s /usr/lib/libxml2.so.2 /usr/lib/libxml2.so
fi
if [ ! -d /app/$WWW_DIR ]; then
mkdir -p /app/$WWW_DIR
fi
if [ ! -d /run/apache2 ]; then
mkdir /run/apache2
fi
chown -R 1000:apache /app/$WWW_DIR
chmod -R 755 /scripts/pre-init.d
mkdir -p /run/apache2
chown apache:apache /run/apache2
tmpsed='s#^DocumentRoot ".*#DocumentRoot "/app/'$WWW_DIR'"#g'
sed -i "$tmpsed" /etc/apache2/httpd.conf
sed -i 's#AllowOverride none#AllowOverride All#' /etc/apache2/httpd.conf
initTitle "Apache" "Loading Modules"
a2setModule 1 "rewrite"
a2setModule 1 "mpm_prefork"

View File

@ -2,6 +2,17 @@
# @app pluie/alpine-apache
# @author a-Sansara https://git.pluie.org/pluie/docker-images
if [ ! -d /app/$WWW_DIR ]; then
CREATE_WWW_DIR=1
mkdir -p /app/$WWW_DIR
fi
if [ ! -f /app/$WWW_DIR/$WWW_INDEX ]; then
echo "<?php phpinfo();" > /app/$WWW_DIR/$WWW_INDEX
fi
tmpsed=/etc/apache2/httpd.conf
sed -i 's#^DocumentRoot ".*#DocumentRoot "/app/'$WWW_DIR'"#g' "$tmpsed"
sed -i 's#AllowOverride none#AllowOverride All#' "$tmpsed"
if [ ! -z "$FIX_OWNERSHIP" ] && [ "$FIX_OWNERSHIP" -eq 1 ] && [ -d /app/$WWW_DIR ]; then
chown -R 1000:apache /app/$WWW_DIR
fi

View File

@ -6,7 +6,7 @@ if [ ! -z "/app/vhost" ]; then
cat <<EOF > "/app/vhost"
<VirtualHost *:80>
ServerName $HTTP_SERVER_NAME
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=\$1
<Directory /app/$WWW_DIR>
AllowOverride None
Require all granted

View File

@ -0,0 +1,4 @@
#!/bin/bash
tmpsed="/etc/php5/php.ini"
sed -i "s|;*date.timezone =.*|date.timezone = ${TZ}|i" $tmpsed
cat $tmpsed | grep "date.timezone"

View File

@ -0,0 +1,20 @@
# @app pluie/alpine-apache
# @author a-Sansara https://git.pluie.org/pluie/docker-images
FROM pluie/alpine
MAINTAINER a-Sansara https://github.com/a-sansara
ADD files.tar /scripts
ENV SHENV_NAME=Php7 \
SHENV_COLOR=67 \
HTTP_SERVER_NAME=php7.docker \
WWW_DIR=www \
WWW_INDEX=index.php \
FIX_OWNERSHIP=1 \
TZ=Europe/Paris
EXPOSE 80
RUN bash /scripts/install.sh

View File

@ -0,0 +1,102 @@
# pluie/alpine-apache-php7
- [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 )
- [pluie/libecho][10] ( ~288 MB ) Vala 0.34.2 pluie-echo-0.2
- [pluie/ubuntu][12] ( ~141 MB ) Ubuntu 18.04
- [pluie/libyaml][11] ( ~538 MB ) Vala 0.40.4 pluie-yaml-0.4
- [docker tips][5]
Extend pluie/alpine with __apache 2.4.25__ and __php 7.0.15__
- error log are attached to stdout
- no need port redirection
- you can use env var at container creation : __HTTP_SERVER_NAME__ (default : site.docker ortherwise edit /app/vhost later)
- you can still use ever your local http & sql server while your container(s) are running
## Image Size
- image ~ 50 MB
## ENV variables
```
HTTP_SERVER_NAME=site.docker # apache ServerName
WWW_DIR=www # DocumentRoot relative to volume
WWW_INDEX=index.php # DirectoryIndex
FIX_OWNERSHIP=1 #
```
### Inherit ENV variables
```
SHENV_CTX=LOCAL # LOCAL|INT|PROD change context bg color
SHENV_NAME=Php7 # container name
SHENV_COLOR=67 # ANSI EXTENDED COLOR CODE
TZ=Europe/Paris # TIMEZONE
```
## Image Volumes
__/app__ directory is a docker volume bind to your app project (silex/symfony etc)
__/app/$WWW_DIR__ is the documentRoot.
put only your entry point and static files to the documentRoot directory, no your app sources
(__/app__ directory is design for this).
__/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
```
/app/ # your application directory
|
|---- $WWW_DIR/ # documentRoot
|
|---- vhost # apache app vhost
```
## Image Usage
chdir to your project directory
```
$ docker run --name php7 -it --link=mysql:db -v $(pwd):/app pluie/alpine-apache
```
or
```
$ docker run --name php7 -it --link=mysql:db -e HTTP_SERVER_NAME=yourServerName -v $(pwd):/app pluie/alpine-apache-php7
```
## Controling http server
```
# reload
$ docker exec -it php7 "httpd -k graceful"
# restart
$ docker exec -it php7 "httpd -k restart"
```
for more commands :
```
$ docker exec -it php7 "httpd -h"
```
[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
[10]: https://github.com/pluie-org/docker-images/tree/master/pluie/libecho
[11]: https://github.com/pluie-org/docker-images/tree/master/pluie/libyaml
[12]: https://github.com/pluie-org/docker-images/tree/master/pluie/ubuntu

22
pluie/alpine-fpm-php7/build Executable file
View File

@ -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

Binary file not shown.

View File

@ -0,0 +1,8 @@
#!/bin/bash
# @app pluie/alpine-apache-php7
# @author a-Sansara https://git.pluie.org/pluie/docker-images
#
#~ echo "http://dl-5.alpinelinux.org/alpine/edge/community
#~ http://dl-5.alpinelinux.org/alpine/edge/main
#~ http://dl-5.alpinelinux.org/alpine/edge/testing
#~ " > /etc/apk/repositories

View File

@ -0,0 +1,9 @@
#!/bin/bash
# @app pluie/alpine-apache
# @author a-Sansara https://git.pluie.org/pluie/docker-images
apk add apache2 apache2-proxy apache2-proxy-html apache-mod-fcgid php7-fpm \
php7-apache2 php7-mbstring php7-session php7-phar php7-zlib php7-zip php7-ctype \
php7-mysqli php7-xml php7-pdo_mysql php7-opcache php7-pdo php7-json php7-curl \
php7-gd php7-mcrypt php7-openssl php7-dom \
# php-pdo_odbc php-soap php-pgsql

View File

@ -0,0 +1,60 @@
#!/bin/bash
# @app pluie/alpine-apache
# @author a-Sansara https://git.pluie.org/pluie/docker-images
function a2setModule(){
local enable=${1:-''}
local path=${3:-'/etc/apache2/httpd.conf'}
local scom=''
local rcom='\#'
if [ ! -z $1 ] && [ ! -z "$2" ]; then
if [ "$enable" = 1 ]; then
scom='\#'
rcom=''
fi
echo "$2"
sed -i "s#${scom}LoadModule $2_module modules/mod_$2.so#${rcom}LoadModule $2_module modules/mod_$2.so#" "$path"
fi
}
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
fi
if [ ! -d /app/$WWW_DIR ]; then
mkdir -p /app/$WWW_DIR
fi
if [ ! -d /run/apache2 ]; then
mkdir /run/apache2
fi
chown -R 1000:apache /app/$WWW_DIR
chmod -R 755 /scripts/pre-init.d
mkdir -p /run/apache2
chown apache:apache /run/apache2
tmpsed='s#^DocumentRoot ".*#DocumentRoot "/app/'$WWW_DIR'"#g'
sed -i "$tmpsed" /etc/apache2/httpd.conf
sed -i 's#AllowOverride none#AllowOverride All#' /etc/apache2/httpd.conf
initTitle "Apache" "Loading Modules"
a2setModule 1 "rewrite"
a2setModule 1 "mpm_event"
a2setModule 1 "slotmem_shm"
a2setModule 1 "heartmonitor"
a2setModule 1 "watchdog"
initTitle "Apache" "Removing Modules"
a2setModule 0 "mpm_prefork"
a2setModule 0 "proxy_fdpass" /etc/apache2/conf.d/proxy.conf
echo
tmpsed="/etc/php7/php.ini"
sed -ir 's/expose_php = On/expose_php = Off/' $tmpsed
sed -i "s|;*date.timezone =.*|date.timezone = ${TZ}|i" $tmpsed
sed -i "s|;*cgi.fix_pathinfo=.*|cgi.fix_pathinfo= 0|i" $tmpsed
tmpsed="/etc/php7/php-fpm.conf"
sed -i "s|;*daemonize\s*=\s*yes|daemonize = no|g" $tmpsed
sed -i "s|;*listen\s*=\s*127.0.0.1:9000|listen = 9000|g" $tmpsed
sed -i "s|;*listen\s*=\s*/||g" $tmpsed
sed -i "s|pm = dynamic|pm = ondemand|g" $tmpsed
echo -e "\nIncludeOptional /app/vhost" >> /etc/apache2/httpd.conf
unset tmpsed

8
pluie/alpine-fpm-php7/main.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
# @app pluie/alpine-apache
# @author a-Sansara https://git.pluie.org/pluie/docker-images
. /scripts/common.sh
initTitle "Starting" "Apache Daemon"
httpd -D FOREGROUND

View File

@ -0,0 +1,11 @@
#!/usr/bin/bash
# @app pluie/alpine-apache
# @author a-Sansara https://git.pluie.org/pluie/docker-images
if [ ! -z "$FIX_OWNERSHIP" ] && [ "$FIX_OWNERSHIP" -eq 1 ] && [ -d /app/$WWW_DIR ]; then
chown -R 1000:apache /app/$WWW_DIR
fi
touch /var/log/apache2/error.log
tail -F /var/log/apache2/error.log &

View File

@ -0,0 +1,27 @@
#!/usr/bin/bash
# @app pluie/alpine-apache
# @author a-Sansara https://git.pluie.org/pluie/docker-images
if [ ! -z "/app/vhost" ]; then
cat <<EOF > "/app/vhost"
<VirtualHost *:80>
ServerName $HTTP_SERVER_NAME
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
<FilesMatch \.php$>
SetHandler proxy:fcgi://127.0.0.1:9000
</FilesMatch>
<Directory /app/$WWW_DIR>
AllowOverride None
Require all granted
DirectoryIndex $WWW_INDEX
<IfModule mod_rewrite.c>
Options -MultiViews +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ $WWW_INDEX [QSA,L]
</IfModule>
</Directory>
</VirtualHost>
# IncludeOptional /app/vhost2
EOF
fi

View File

@ -0,0 +1,4 @@
#!/bin/bash
tmpsed="/etc/php7/php.ini"
sed -i "s|;*date.timezone =.*|date.timezone = ${TZ}|i" $tmpsed
cat $tmpsed | grep "date.timezone"

View File

@ -1,14 +1,19 @@
# pluie/alpine-mysql
- [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-mysql][4] ( ~172 MB ) MariaDb/10.1.14
- [pluie/alpine][2] ( ~ 9 MB ) Alpine/3.5
- [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.25 Php/5.6.30
- [pluie/alpine-apache-fpm][7] ( ~ 51 MB ) Apache/2.4.25 Php/5.6.30 Fpm
- [pluie/alpine-symfony][6] ( ~ 83 MB ) Symfony2.8 or 3.2
- [pluie/alpine-apache-php7][8] ( ~ 45 MB ) Apache/2.4.25 Php/7.0.16
- [pluie/alpine-symfony-php7][9] ( ~ 77 MB ) Symfony2.8 or 3.2 Php/7.0.16
- [pluie/alpine-mysql][4] ( ~181 MB ) Mysql/5.6 ( MariaDB )
- [pluie/libecho][10] ( ~288 MB ) Vala 0.34.2 pluie-echo-0.2
- [pluie/ubuntu][12] ( ~141 MB ) Ubuntu 18.04
- [pluie/libyaml][11] ( ~538 MB ) Vala 0.40.4 pluie-yaml-0.4
- [docker tips][5]
Extend pluie/alpine with mysql (MariaDb/10.1.14)
Extend pluie/alpine with mysql (MariaDb/10.1.22)
Project comes with various scripts to execute basic tasks such as :
- dbcreate
- dbdump
@ -19,7 +24,7 @@ Root access to database is only permit on localhost
## Image Size
- image ~ 172 MB
- image ~ 181 MB
## Image Volumes
@ -67,8 +72,9 @@ for example :
$ docker run --name pma -p 8080:80 --link mysql:db -d phpmyadmin/phpmyadmin
```
and phpmyadmin is accessible via http://localhost:8080/ and linked to your mysql container
and __phpmyadmin__ is accessible via `http://localhost:8080/` and linked to your mysql container
(by the way on dev, you don't need to expose your 8080 port too... simply use a bridge network and update your
`/etc/hosts` file - see [ docker tips ][5] for that)
### Existing Scripts
@ -104,7 +110,7 @@ $ docker exec -it mysql "mysql -udev -pmysql"
to connect to the mysql server as root :
```
$ docker exec -it mysql "mysql -uroot"
$ docker exec -it mysql mysql
```
to connect to the mysql container as root :
```
@ -126,7 +132,6 @@ to link this container to another, use the default docker behavior
docker run --name mycontainer --link mysql:db ...
```
[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
@ -134,3 +139,8 @@ 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/alpine-apache-php7
[9]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony-php7
[10]: https://github.com/pluie-org/docker-images/tree/master/pluie/libecho
[11]: https://github.com/pluie-org/docker-images/tree/master/pluie/libyaml
[12]: https://github.com/pluie-org/docker-images/tree/master/pluie/ubuntu

Binary file not shown.

View File

@ -2,4 +2,4 @@
# @app pluie/alpine-mysql
# @author a-Sansara https://git.pluie.org/pluie/docker-images
apk --update add mysql mysql-client pwgen \
apk add mysql mysql-client pwgen \

1
pluie/alpine-symfony-php7/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
files.tar

View File

@ -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

View File

@ -0,0 +1,88 @@
# pluie/alpine-symfony-php7
- [index][1]
- [pluie/alpine][2] ( ~ 9 MB ) Alpine/3.5
- [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.25 Php/5.6.30
- [pluie/alpine-apache-fpm][7] ( ~ 51 MB ) Apache/2.4.25 Php/5.6.30 Fpm
- [pluie/alpine-symfony][6] ( ~ 83 MB ) Symfony2.8 or 3.2
- [pluie/alpine-apache-php7][8] ( ~ 45 MB ) Apache/2.4.25 Php/7.0.16
- [pluie/alpine-symfony-php7][9] ( ~ 77 MB ) Symfony2.8 or 3.2 Php/7.0.16
- [pluie/alpine-mysql][4] ( ~181 MB ) Mysql/5.6 ( MariaDB )
- [pluie/libecho][10] ( ~288 MB ) Vala 0.34.2 pluie-echo-0.2
- [pluie/ubuntu][12] ( ~141 MB ) Ubuntu 18.04
- [pluie/libyaml][11] ( ~538 MB ) Vala 0.40.4 pluie-yaml-0.4
- [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 ~ 77 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
```
## Run the console
```
$ docker exec -it symfony php /app/bin/console --ansi
```
[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
[10]: https://github.com/pluie-org/docker-images/tree/master/pluie/libecho
[11]: https://github.com/pluie-org/docker-images/tree/master/pluie/libyaml
[12]: https://github.com/pluie-org/docker-images/tree/master/pluie/ubuntu

22
pluie/alpine-symfony-php7/build Executable file
View File

@ -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

Binary file not shown.

View File

@ -0,0 +1,7 @@
#!/bin/bash
# @app pluie/alpine-symfony
# @author a-Sansara https://git.pluie.org/pluie/docker-images
apk add php7-iconv php7-intl php7-posix
curl -LsS https://symfony.com/installer -o /usr/bin/symfony
chmod +x /usr/bin/symfony

View File

@ -0,0 +1,8 @@
#!/bin/bash
# @app pluie/alpine-apache
# @author a-Sansara https://git.pluie.org/pluie/docker-images
. /scripts/common.sh
initTitle "Starting" "Apache Daemon"
httpd -D FOREGROUND

View File

@ -0,0 +1,15 @@
#!/bin/bash
# @app pluie/alpine-symfony
# @author a-Sansara https://git.pluie.org/pluie/docker-images
if [ ! -z "$CREATE_WWW_DIR" ]; then
cd /tmp
symfony new app $SYMFONY_VERSION
rm -rf /app/web
mv -f app/* /app/
chown -R 1000:apache /app/
chown -R 774:apache /app/var
chmod -R g+w /app
CTN_IP=$(ip route | cut -d ' ' -f3 | head -n1)
sed -i "/::1/s//::1', '$CTN_IP/" /app/web/app_dev.php
fi

View File

@ -12,7 +12,7 @@ ENV SHENV_NAME=Symfony \
HTTP_SERVER_NAME=symfony.docker \
WWW_DIR=web \
WWW_INDEX=app.php \
SYMFONY_VERSION=3.1
SYMFONY_VERSION=3.2
EXPOSE 80

View File

@ -1,26 +1,31 @@
# pluie/alpine-symfony
- [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-mysql][4] ( ~172 MB ) MariaDb/10.1.14
- [pluie/alpine][2] ( ~ 9 MB ) Alpine/3.5
- [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.25 Php/5.6.30
- [pluie/alpine-apache-fpm][7] ( ~ 51 MB ) Apache/2.4.25 Php/5.6.30 Fpm
- [pluie/alpine-symfony][6] ( ~ 83 MB ) Symfony2.8 or 3.2
- [pluie/alpine-apache-php7][8] ( ~ 45 MB ) Apache/2.4.25 Php/7.0.16
- [pluie/alpine-symfony-php7][9] ( ~ 77 MB ) Symfony2.8 or 3.2 Php/7.0.16
- [pluie/alpine-mysql][4] ( ~181 MB ) Mysql/5.6 ( MariaDB )
- [pluie/libecho][10] ( ~288 MB ) Vala 0.34.2 pluie-echo-0.2
- [pluie/ubuntu][12] ( ~141 MB ) Ubuntu 18.04
- [pluie/libyaml][11] ( ~538 MB ) Vala 0.40.4 pluie-yaml-0.4
- [docker tips][5]
Extend pluie/alpine-apache-fpm.
if __/app/$WWW_DIR__ does not exits then __pluie/alpine-symfony__ install
the symfony framework with $SYMFONY_VERSION version on the /app directory
the symfony framework with `$SYMFONY_VERSION` version on the `/app` directory
## Image Size
- image ~ 82 MB
- image ~ 83 MB
## ENV variables
```
SYMFONY_VERSION=3.1 # symfony version
SYMFONY_VERSION=3.1 # symfony version
```
### Inherit ENV variables
@ -46,17 +51,23 @@ the symfony framework with $SYMFONY_VERSION version on the /app directory
chdir to your project directory
```
$ docker run --name symfony -it --link=mysql:db1 -v $(pwd):/app pluie/alpine-symfony
$ docker run --name symfony -it --link=mysql:db -v $(pwd):/app pluie/alpine-symfony
```
or
```
$ docker run --name symfony -d --link=mysql:db1 -e HTTP_SERVER_NAME=yourServerName -v $(pwd):/app pluie/alpine-symfony
$ docker run --name symfony -d --link=mysql:db -e HTTP_SERVER_NAME=yourServerName -v $(pwd):/app pluie/alpine-symfony
```
## Connect to container
```
$ docker exec -it symfony bash
```
## Run the console
```
$ docker exec -it symfony php /app/bin/console --ansi
```
[1]: https://github.com/pluie-org/docker-images
@ -66,3 +77,8 @@ $ docker exec -it symfony bash
[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
[10]: https://github.com/pluie-org/docker-images/tree/master/pluie/libecho
[11]: https://github.com/pluie-org/docker-images/tree/master/pluie/libyaml
[12]: https://github.com/pluie-org/docker-images/tree/master/pluie/ubuntu

Binary file not shown.

View File

@ -2,6 +2,6 @@
# @app pluie/alpine-symfony
# @author a-Sansara https://git.pluie.org/pluie/docker-images
apk -U add php5-iconv php5-intl php5-posix
apk add php5-iconv php5-intl php5-posix
curl -LsS https://symfony.com/installer -o /usr/bin/symfony
chmod +x /usr/bin/symfony

View File

@ -2,13 +2,14 @@
# @app pluie/alpine-symfony
# @author a-Sansara https://git.pluie.org/pluie/docker-images
if [ ! -d /app/$WWW_DIR ]; then
if [ ! -z "$CREATE_WWW_DIR" ]; then
cd /tmp
mkdir $WWW_DIR
symfony new app $SYMFONY_VERSION
mv app/* /app/
rm -rf /app/web
mv -f app/* /app/
chown -R 1000:apache /app/
chown -R 1000:nogroup /app/var
chmod -R 777 /app/var
chmod -R g+w /app
CTN_IP=$(ip route | cut -d ' ' -f3 | head -n1)
sed -i "/::1/s//::1', '$CTN_IP/" /app/web/app_dev.php
fi

View File

@ -1,7 +1,7 @@
# @app pluie/alpine
# @author a-Sansara https://git.pluie.org/pluie/docker-images
FROM alpine:3.4
FROM alpine:3.5
MAINTAINER a-Sansara https://github.com/a-sansara

View File

@ -1,11 +1,16 @@
# pluie/alpine
- [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-mysql][4] ( ~172 MB ) MariaDb/10.1.14
- [pluie/alpine][2] ( ~ 9 MB ) Alpine/3.5
- [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.25 Php/5.6.30
- [pluie/alpine-apache-fpm][7] ( ~ 51 MB ) Apache/2.4.25 Php/5.6.30 Fpm
- [pluie/alpine-symfony][6] ( ~ 83 MB ) Symfony2.8 or 3.2
- [pluie/alpine-apache-php7][8] ( ~ 45 MB ) Apache/2.4.25 Php/7.0.16
- [pluie/alpine-symfony-php7][9] ( ~ 77 MB ) Symfony2.8 or 3.2 Php/7.0.16
- [pluie/alpine-mysql][4] ( ~181 MB ) Mysql/5.6 ( MariaDB )
- [pluie/libecho][10] ( ~288 MB ) Vala 0.34.2 pluie-echo-0.2
- [pluie/ubuntu][12] ( ~141 MB ) Ubuntu 18.04
- [pluie/libyaml][11] ( ~538 MB ) Vala 0.40.4 pluie-yaml-0.4
- [docker tips][5]
This Image provide a Linux Alpine distribution with :
@ -14,7 +19,7 @@ This Image provide a Linux Alpine distribution with :
- curl
- nano as editor
Base image : [alpine:3.4] (https://hub.docker.com/_/alpine/)
Base image : [alpine:3.5](https://hub.docker.com/_/alpine/)
This project come with a structure to facilitate further images (like pluie/alpine-apache & pluie/alpine-mysql)
@ -25,7 +30,7 @@ apk add ca-certificates wget && update-ca-certificates
## Image Size
- very small image < 10 MB
- very small image ~ 9 MB
## Image Usage
@ -57,13 +62,13 @@ project/
```
you can easily create your own images based on this structure.
keep an eye to pluie/alpine-apache & pluie/alpine-mysql wich extend pluie/alpine
keep an eye to pluie/alpine-apache, pluie/alpine-apache-php7 & pluie/alpine-mysql wich extend pluie/alpine
## Extend pluie/alpine Image
RUN instructions are minimized
on extended image you can only use :
on extended image you only need to use :
```
RUN bash /scripts/install.sh
```
@ -91,7 +96,7 @@ ENV SHENV_NAME=Apache \
WWW_DIR=www \
WWW_INDEX=index.php \
FIX_OWNERSHIP=1 \
TZ=Europe/Paris
TZ=Europe/Paris
EXPOSE 80
@ -105,3 +110,8 @@ RUN bash /scripts/install.sh
[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
[10]: https://github.com/pluie-org/docker-images/tree/master/pluie/libecho
[11]: https://github.com/pluie-org/docker-images/tree/master/pluie/libyaml
[12]: https://github.com/pluie-org/docker-images/tree/master/pluie/ubuntu

Binary file not shown.

View File

@ -5,7 +5,6 @@
if [ ! -z "$TZ" ] && [ -f "/usr/share/zoneinfo/$TZ" ]; then
echo "$TZ" > /etc/TZ
cp "/usr/share/zoneinfo/$TZ" "/etc/localtime"
apk del tzdata
if [ ! "${TZ///*/}" = "$TZ" ]; then
mkdir -p "/usr/share/zoneinfo/${TZ///*/}"
fi
@ -13,6 +12,7 @@ if [ ! -z "$TZ" ] && [ -f "/usr/share/zoneinfo/$TZ" ]; then
echo -e "\033[1;38;5;203mTIMEZONE : $TZ"
date
echo -en "\033[m"
apk del tzdata
else
echo -e "\033[1;38;5;203mNO DEFINED TIMEZONE"
fi

View File

@ -0,0 +1,7 @@
#!/bin/bash
if [ "$TZ" != "Europe/Paris" ]; then
apk -U add tzdata
. /scripts/install.d/30-tz.sh
. /scripts/install.d/40-fix.sh
fi

14
pluie/libecho/Dockerfile Normal file
View File

@ -0,0 +1,14 @@
# @app pluie/alpine-apache
# @author a-Sansara https://git.pluie.org/pluie/docker-images
FROM pluie/alpine
MAINTAINER a-Sansara https://github.com/a-sansara
ADD files.tar /scripts
ENV SHENV_NAME=libecho \
SHENV_COLOR=32 \
TZ=Europe/Paris
RUN bash /scripts/install.sh

47
pluie/libecho/README.md Normal file
View File

@ -0,0 +1,47 @@
# pluie/libecho
- [index][1]
- [pluie/alpine][2] ( ~ 9 MB ) Alpine/3.5
- [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.25 Php/5.6.30
- [pluie/alpine-apache-fpm][7] ( ~ 51 MB ) Apache/2.4.25 Php/5.6.30 Fpm
- [pluie/alpine-symfony][6] ( ~ 83 MB ) Symfony2.8 or 3.2
- [pluie/alpine-apache-php7][8] ( ~ 45 MB ) Apache/2.4.25 Php/7.0.16
- [pluie/alpine-symfony-php7][9] ( ~ 77 MB ) Symfony2.8 or 3.2 Php/7.0.16
- [pluie/alpine-mysql][4] ( ~181 MB ) Mysql/5.6 ( MariaDB )
- [pluie/libecho][10] ( ~288 MB ) Vala 0.34.2 pluie-echo-0.2
- [pluie/ubuntu][12] ( ~141 MB ) Ubuntu 18.04
- [pluie/libyaml][11] ( ~538 MB ) Vala 0.40.4 pluie-yaml-0.4
- [docker tips][5]
demo image demonstrating libpluie-echo, a small vala shared library managing tracing, display formatting and ansi-extended colors on stdout & stderror.
you can run a container with :
```
docker run --rm -it pluie/libecho
```
## repository
https://github.com/pluie-org/libpluie-echo
## samples
![Sample 1 code](https://www.meta-tech.academy/img/libpluie-echo_sample_code1.png?tmp=1)
![Sample 1 output](https://www.meta-tech.academy/img/libpluie-echo_sample1.png)
![Sample 2 code](https://www.meta-tech.academy/img/libpluie-echo_sample_code2.png?tmp=1)
![Sample 2 output](https://www.meta-tech.academy/img/libpluie-echo_sample2.png)
[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
[10]: https://github.com/pluie-org/docker-images/tree/master/pluie/libecho
[11]: https://github.com/pluie-org/docker-images/tree/master/pluie/libyaml
[12]: https://github.com/pluie-org/docker-images/tree/master/pluie/ubuntu

22
pluie/libecho/build Executable file
View File

@ -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
"
sudo docker build --force-rm -t ${DOCKREPO}/${DOCKBUILD}:${DOCKTAG} . | sed "s/^/${indent}/"
cd $TMPPWD

BIN
pluie/libecho/files.tar Normal file

Binary file not shown.

View File

@ -0,0 +1,10 @@
#!/bin/bash
# @app pluie/alpine-apache
# @author a-Sansara https://git.pluie.org/pluie/docker-images
apk add git vala gcc musl-dev python3 ninja \
&& pip3 install meson \
&& git clone https://github.com/pluie-org/libpluie-echo.git \
&& cd libpluie-echo/ \
&& meson --prefix=/usr ./ build \
&& ninja install -C build

8
pluie/libecho/main.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
# @app pluie/libecho
# @author a-Sansara https://git.pluie.org/pluie/docker-images
. /scripts/common.sh
initTitle "Vala shared lib pluie-echo-0.2" "Sample"
/libpluie-echo/samples/pluie-outputFormatter

View File

@ -0,0 +1,2 @@
cd /libpluie-echo/samples
valac --pkg pluie-echo-0.2 pluie-outputFormatter.vala \

14
pluie/libyaml/Dockerfile Normal file
View File

@ -0,0 +1,14 @@
# @app pluie/libyaml
# @author a-Sansara https://git.pluie.org/pluie/docker-images
FROM pluie/ubuntu
MAINTAINER a-Sansara https://github.com/a-sansara
ADD files.tar /scripts
ENV SHENV_NAME=libyaml \
SHENV_COLOR=36 \
TZ=Europe/Paris
RUN /bin/bash /scripts/install.sh

63
pluie/libyaml/README.md Normal file
View File

@ -0,0 +1,63 @@
# pluie/libyaml
- [index][1]
- [pluie/alpine][2] ( ~ 9 MB ) Alpine/3.5
- [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.25 Php/5.6.30
- [pluie/alpine-apache-fpm][7] ( ~ 51 MB ) Apache/2.4.25 Php/5.6.30 Fpm
- [pluie/alpine-symfony][6] ( ~ 83 MB ) Symfony2.8 or 3.2
- [pluie/alpine-apache-php7][8] ( ~ 45 MB ) Apache/2.4.25 Php/7.0.16
- [pluie/alpine-symfony-php7][9] ( ~ 77 MB ) Symfony2.8 or 3.2 Php/7.0.16
- [pluie/alpine-mysql][4] ( ~181 MB ) Mysql/5.6 ( MariaDB )
- [pluie/libecho][10] ( ~288 MB ) Vala 0.34.2 pluie-echo-0.2
- [pluie/ubuntu][12] ( ~141 MB ) Ubuntu 18.04
- [pluie/libyaml][11] ( ~538 MB ) Vala 0.40.4 pluie-yaml-0.4
- [docker tips][5]
demo image demonstrating pluie-yaml, a shared vala library managing yaml files (v 1.2) and yaml nodes in vala language.
As json is now a valid subset of yaml, you can use this lib to load json files too
you can run a container with :
```
docker run --rm -it pluie/libyaml
```
then execute any samples :
./yaml-loader
./json-loader
./yaml-config
./yaml-traversing
./yaml-finder
./yaml-imports
./yaml-node
## repository
https://github.com/pluie-org/lib-yaml
## samples
./yaml-config source code
![Sample yaml-config code](https://www.meta-tech.academy/img/lib-yaml-config-code.png?tmp=1)
./yaml-config output
![Sample yaml-config output1](https://www.meta-tech.academy/img/lib-yaml-docker-config1.png?tmp=1)
![Sample yaml-config output2](https://www.meta-tech.academy/img/lib-yaml-docker-config2.png?tmp=1)
[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
[10]: https://github.com/pluie-org/docker-images/tree/master/pluie/libecho
[11]: https://github.com/pluie-org/docker-images/tree/master/pluie/libyaml
[12]: https://github.com/pluie-org/docker-images/tree/master/pluie/ubuntu

22
pluie/libyaml/build Executable file
View File

@ -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
"
sudo docker build --force-rm -t ${DOCKREPO}/${DOCKBUILD}:${DOCKTAG} . | sed "s/^/${indent}/"
cd $TMPPWD

BIN
pluie/libyaml/files.tar Normal file

Binary file not shown.

View File

@ -0,0 +1,14 @@
#!/bin/bash
# @app pluie/libyaml
# @author a-Sansara https://git.pluie.org/pluie/docker-images
export DEBCONF_NONINTERACTIVE_SEEN=true
export DEBIAN_FRONTEND=noninteractive
echo "Updating system..."
apt install -y glib-2.0-dev libgee-0.8-dev libyaml-dev git gcc valac meson
mkdir /home/repo; cd $_;
echo "Installing pluie-echo dependency"
git clone https://git.pluie.org/pluie/libpluie-echo.git
cd libpluie-echo
meson --prefix=/usr ./ build
ninja install -C build
pkg-config --libs pluie-echo-0.2

10
pluie/libyaml/main.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
# @app pluie/libyaml
# @author a-Sansara https://git.pluie.org/pluie/docker-images
. /scripts/common.sh
cd /home/repo/lib-yaml
echo "try any samples"
bash

View File

@ -0,0 +1,4 @@
cd /home/repo
git clone https://git.pluie.org/pluie/lib-yaml.git
cd lib-yaml
./build.sh

20
pluie/ubuntu/Dockerfile Normal file
View File

@ -0,0 +1,20 @@
# @app pluie/libyaml
# @author a-Sansara https://git.pluie.org/pluie/docker-images
FROM ubuntu:latest
MAINTAINER a-Sansara https://github.com/a-sansara
ADD files.tar /scripts
ENV TERM=xterm \
SHENV_NAME=ubuntu \
SHENV_COLOR=97 \
SHENV_CTX=LOCAL \
TZ=Europe/Paris
VOLUME /app
RUN /bin/bash /scripts/install.sh
ENTRYPOINT ["/scripts/main.sh"]

105
pluie/ubuntu/README.md Normal file
View File

@ -0,0 +1,105 @@
# pluie/ubuntu
- [index][1]
- [pluie/alpine][2] ( ~ 9 MB ) Alpine/3.5
- [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.25 Php/5.6.30
- [pluie/alpine-apache-fpm][7] ( ~ 51 MB ) Apache/2.4.25 Php/5.6.30 Fpm
- [pluie/alpine-symfony][6] ( ~ 83 MB ) Symfony2.8 or 3.2
- [pluie/alpine-apache-php7][8] ( ~ 45 MB ) Apache/2.4.25 Php/7.0.16
- [pluie/alpine-symfony-php7][9] ( ~ 77 MB ) Symfony2.8 or 3.2 Php/7.0.16
- [pluie/alpine-mysql][4] ( ~181 MB ) Mysql/5.6 ( MariaDB )
- [pluie/libecho][10] ( ~288 MB ) Vala 0.34.2 pluie-echo-0.2
- [pluie/ubuntu][12] ( ~141 MB ) Ubuntu 18.04
- [pluie/libyaml][11] ( ~538 MB ) Vala 0.40.4 pluie-yaml-0.4
- [docker tips][5]
This Image provide a Linux Ubuntu LTS distribution base image.
Base image : [ubuntu](https://hub.docker.com/_/ubuntu/)
This project come with a structure to facilitate further images (like pluie/libyaml)
## Image Size
- 141 MB
## Image Usage
```
$ docker run --name ubuntu -it pluie/ubuntu
```
## Image Structure
```
project/
|
|-- install.d/ # deployed in /scripts on target container
| | # launch on docker image building process
| | # XX-name.sh - low XX are run first
| |-- 00-util.sh
| |-- 40-fix.sh
|
|-- pre-init.d/ # deployed in /scripts on target container
| | # launch on docker container running process
| |-- 50-builder.sh
|
|-- build # build docker image : ./build [TAG]
|-- common.sh # don't modify - sourced by main.sh to execute pre-init.d scripts first
|-- install.sh # don't modify - execute install.d scripts on docker building process
|-- main.sh # source common.sh then execute entry point instruction
|-- util.sh # sourced by common.sh
```
you can easily create your own images based on this structure.
keep an eye to pluie/libyalm wich extend pluie/ubuntu
## Extend pluie/ubuntu Image
RUN instructions are minimized
on extended image you only need to use :
```
RUN bash /scripts/install.sh
```
add your packages in a script in install.d directory
keep name below 40 because install.d/40-fix.sh clean package repository
each extended image inherit install.d && pre-init.d scripts
extended images doesn't need to define ENTRYPOINT
you can keep intact build script in each extended project
manage your install & init instruction in install.d & pre-init.d directory
and write your own main.sh script
Docker file example (from pluie/libyaml)
```
# @app pluie/libyaml
# @author a-Sansara https://git.pluie.org/pluie/docker-images
FROM pluie:ubuntu
MAINTAINER a-Sansara https://github.com/a-sansara
ADD files.tar /scripts
ENV SHENV_NAME=libyaml \
SHENV_COLOR=36 \
TZ=Europe/Paris
RUN bash /scripts/install.sh
```
[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
[10]: https://github.com/pluie-org/docker-images/tree/master/pluie/libecho
[11]: https://github.com/pluie-org/docker-images/tree/master/pluie/libyaml
[12]: https://github.com/pluie-org/docker-images/tree/master/pluie/ubuntu

22
pluie/ubuntu/build Executable file
View File

@ -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
"
sudo docker build --force-rm -t ${DOCKREPO}/${DOCKBUILD}:${DOCKTAG} . | sed "s/^/${indent}/"
cd $TMPPWD

10
pluie/ubuntu/common.sh Normal file
View File

@ -0,0 +1,10 @@
#!/bin/bash
# @app pluie/ubuntu
# @author a-Sansara https://git.pluie.org/pluie/docker-images
. /scripts/util.sh
# execute any pre-init scripts wich is useful for images based on this image
# /scripts/pre-init.d/XX-name.sh
# low XX are run first
preInit "/scripts/pre-init.d"

BIN
pluie/ubuntu/files.tar Normal file

Binary file not shown.

View File

@ -0,0 +1,4 @@
export DEBCONF_NONINTERACTIVE_SEEN=true
export DEBIAN_FRONTEND=noninteractive
apt update
apt install -y nano curl tzdata

View File

@ -0,0 +1,13 @@
#!/bin/bash
# @app pluie/alpine
# @author a-Sansara https://git.pluie.org/pluie/docker-images
if [ ! -f /root/.bash_ps1 ]; then
cat <<EOF >> /root/.bashrc
if [ -f ~/.bash_ps1 ]; then
. ~/.bash_ps1
fi
EOF
sed -n '1,22 p' /scripts/util.sh > /root/.bash_ps1
echo "bash_prompt" >> /root/.bash_ps1
fi

View File

@ -0,0 +1,17 @@
#!/bin/bash
# @app pluie/alpine
# @author a-Sansara https://git.pluie.org/pluie/docker-images
if [ ! -z "$TZ" ] && [ -f "/usr/share/zoneinfo/$TZ" ]; then
echo "$TZ" > /etc/TZ
cp "/usr/share/zoneinfo/$TZ" "/etc/localtime"
if [ ! "${TZ///*/}" = "$TZ" ]; then
mkdir -p "/usr/share/zoneinfo/${TZ///*/}"
fi
cp /etc/localtime "/usr/share/zoneinfo/$TZ"
echo -e "\033[1;38;5;203mTIMEZONE : $TZ"
date
echo -en "\033[m"
else
echo -e "\033[1;38;5;203mNO DEFINED TIMEZONE"
fi

View File

@ -0,0 +1,6 @@
#!/bin/bash
# @app pluie/alpine
# @author a-Sansara https://git.pluie.org/pluie/docker-images
apt clean
chown -R root:root /scripts/

6
pluie/ubuntu/install.sh Normal file
View File

@ -0,0 +1,6 @@
#!/bin/bash
# @app pluie/ubuntu
# @author a-Sansara https://git.pluie.org/pluie/docker-images
. /scripts/util.sh
preInit "/scripts/install.d"

6
pluie/ubuntu/main.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
# @app pluie/alpine
# @author a-Sansara https://git.pluie.org/pluie/docker-images
. /scripts/common.sh
bash

View File

@ -0,0 +1,5 @@
#!/bin/bash
# @app pluie/ubuntu
# @author a-Sansara https://git.pluie.org/pluie/docker-images
echo -e "\ncontainer builded by \033[1;38;5;209mpluie.org\033[m - \033[1;38;5;32mhttps://git.pluie.org/pluie/docker-images\033[m\n"

40
pluie/ubuntu/util.sh Normal file
View File

@ -0,0 +1,40 @@
#!/bin/bash
# @app pluie/alpine
# @author a-Sansara https://git.pluie.org/pluie/docker-images
function bash_prompt() {
local Cenvcode="243"
if [ "$SHENV_CTX" = "INT" ]; then
local Cenvcode="202"
elif [ "$SHENV_CTX" = "PROD" ]; then
local Cenvcode="160"
fi
local Cdate="\[\033[1;33m\]"
local Cctx="\[\033[1;48;5;${Cenvcode}m\]"
local Cname="\[\033[1;48;5;${SHENV_COLOR}m\]"
local Cpath="\[\033[1;38;5;36m\]"
local Cwhite="\[\033[1;38;5;15m\]"
local Chost="\[\033[1;38;5;15m\]"
local Csymbol="\[\033[1;38;5;15m\]"
local Cuser="\[\033[1;38;5;203m\]"
local Coff="\[\033[m\]"
export PS1="${Cdate}\t ${Cwhite}${Cctx} DOCKER ${SHENV_CTX} ${Cname} ${SHENV_NAME} ${Coff} ${Cuser}\u${Chost}@\h ${Cpath}\w ${Csymbol}\$ ${Coff}"
}
function initTitle(){
local data=${1:-''}
if [ ! -z "$2" ]; then
data="$data\033[1;38;5;97m $2 "
fi
echo -e "\n\033[1;33m[[ \033[1;38;5;30m$data\033[1;33m]]\033[m"
}
function preInit(){
for i in ls $1/*.sh
do
if [ -e "${i}" ]; then
initTitle "Processing" "$i"
. "${i}"
fi
done
}