Skip to content
This repository was archived by the owner on Dec 11, 2018. It is now read-only.

Commit 6b1b63b

Browse files
committed
first init
0 parents  commit 6b1b63b

File tree

8 files changed

+237
-0
lines changed

8 files changed

+237
-0
lines changed

.env.example

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
PHP_XDEBUG_DEFAULT_ENABLE=0
2+
PHP_XDEBUG_REMOTE_ENABLE=0
3+
PHP_XDEBUG_REMOTE_HOST=127.0.0.1
4+
PHP_XDEBUG_REMOTE_PORT=9001
5+
PHP_XDEBUG_REMOTE_AUTO_START=0
6+
PHP_XDEBUG_REMOTE_CONNECT_BACK=0
7+
PHP_XDEBUG_IDEKEY=docker
8+
PHP_XDEBUG_PROFILER_ENABLE=0
9+
PHP_XDEBUG_PROFILER_OUTPUT_DIR=/tmp

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
old

Dockerfile

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
FROM php:7.3-fpm-alpine
2+
3+
ARG BUILD_DATE
4+
ARG VCS_REF
5+
6+
ENV COMPOSER_ALLOW_SUPERUSER 1
7+
ENV PHP_XDEBUG_DEFAULT_ENABLE ${PHP_XDEBUG_DEFAULT_ENABLE:-1}
8+
ENV PHP_XDEBUG_REMOTE_ENABLE ${PHP_XDEBUG_REMOTE_ENABLE:-1}
9+
ENV PHP_XDEBUG_REMOTE_HOST ${PHP_XDEBUG_REMOTE_HOST:-"127.0.0.1"}
10+
ENV PHP_XDEBUG_REMOTE_PORT ${PHP_XDEBUG_REMOTE_PORT:-9000}
11+
ENV PHP_XDEBUG_REMOTE_AUTO_START ${PHP_XDEBUG_REMOTE_AUTO_START:-1}
12+
ENV PHP_XDEBUG_REMOTE_CONNECT_BACK ${PHP_XDEBUG_REMOTE_CONNECT_BACK:-1}
13+
ENV PHP_XDEBUG_IDEKEY ${PHP_XDEBUG_IDEKEY:-docker}
14+
ENV PHP_XDEBUG_PROFILER_ENABLE ${PHP_XDEBUG_PROFILER_ENABLE:-0}
15+
ENV PHP_XDEBUG_PROFILER_OUTPUT_DIR ${PHP_XDEBUG_PROFILER_OUTPUT_DIR:-"/tmp"}
16+
17+
LABEL Maintainer="Zaher Ghaibeh <[email protected]>" \
18+
Description="Lightweight php 7.3 container based on alpine with xDebug enabled & composer installed." \
19+
org.label-schema.name="zaherg/php-7.3-xdebug-alpine" \
20+
org.label-schema.description="Lightweight php php 7.3 container based on alpine with xDebug enabled & composer installed." \
21+
org.label-schema.build-date=$BUILD_DATE \
22+
org.label-schema.vcs-url="https://github.com/linuxjuggler/php-7.3-xdebug-alpine.git" \
23+
org.label-schema.vcs-ref=$VCS_REF \
24+
org.label-schema.schema-version="1.0.0"
25+
26+
RUN set -ex \
27+
&& apk update \
28+
&& apk add --no-cache git mysql-client curl openssh-client icu libpng freetype libzip \
29+
libjpeg-turbo postgresql-dev libffi-dev libsodium \
30+
&& apk add --no-cache --virtual build-dependencies icu-dev libxml2-dev freetype-dev libzip-dev libpng-dev \
31+
libjpeg-turbo-dev g++ make autoconf libsodium-dev\
32+
&& mkdir /src && cd /src && git clone https://github.com/xdebug/xdebug.git \
33+
&& cd xdebug \
34+
&& sh ./rebuild.sh \
35+
&& docker-php-source extract \
36+
&& pecl install redis libsodium \
37+
&& docker-php-ext-enable xdebug redis sodium \
38+
&& docker-php-source delete \
39+
&& docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \
40+
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
41+
&& docker-php-ext-install -j$(nproc) pdo pgsql pdo_mysql pdo_pgsql intl zip gd \
42+
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
43+
&& cd / && rm -fr /src \
44+
&& apk del build-dependencies \
45+
&& rm -rf /tmp/*
46+
47+
COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug-dev.ini
48+
49+
USER www-data
50+
51+
WORKDIR /var/www
52+
CMD ["php-fpm"]

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Mhd Zaher Ghaibeh
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
[![Docker Pulls](https://img.shields.io/docker/pulls/zaherg/php-7.3-xdebug-alpine.svg)](https://hub.docker.com/r/zaherg/php-7.3-xdebug-alpine/) [![](https://images.microbadger.com/badges/image/zaherg/php-7.3-xdebug-alpine.svg)](https://microbadger.com/images/zaherg/php-7.2-xdebug-alpine "Get your own image badge on microbadger.com") [![](https://images.microbadger.com/badges/version/zaherg/php-7.3-xdebug-alpine.svg)](https://microbadger.com/images/zaherg/php-7.3-xdebug-alpine "Get your own version badge on microbadger.com") [![](https://images.microbadger.com/badges/commit/zaherg/php-7.3-rc-xdebug-alpine.svg)](https://microbadger.com/images/zaherg/php-7.3-xdebug-alpine "Get your own commit badge on microbadger.com")
2+
3+
4+
## Image description
5+
6+
This image contain php-7.3 based on alpine with xDebug, MySQL, PostgreSQL, Redis & GD enabled and Composer already installed
7+
8+
```
9+
PHP 7.3.0RC6 (cli) (built: Nov 27 2018 23:02:16) ( NTS )
10+
Copyright (c) 1997-2018 The PHP Group
11+
Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies
12+
with Xdebug v2.7.0beta2-dev, Copyright (c) 2002-2018, by Derick Rethans
13+
```
14+
15+
16+
__I've set it up to auto-build once the base image updated, but I cant be sure that it will work__
17+
18+
## Runing the image:
19+
20+
By default xdebug is enabled, to disable it you need to create a `.env` file which should contain the following variables, but remember to change the value based one what you want to achieve:
21+
22+
```
23+
PHP_XDEBUG_DEFAULT_ENABLE=0
24+
PHP_XDEBUG_REMOTE_ENABLE=0
25+
PHP_XDEBUG_REMOTE_HOST=127.0.0.1
26+
PHP_XDEBUG_REMOTE_PORT=9001
27+
PHP_XDEBUG_REMOTE_AUTO_START=0
28+
PHP_XDEBUG_REMOTE_CONNECT_BACK=0
29+
PHP_XDEBUG_IDEKEY=docker
30+
PHP_XDEBUG_PROFILER_ENABLE=0
31+
PHP_XDEBUG_PROFILER_OUTPUT_DIR=/tmp
32+
```
33+
34+
Then run the docker and specify the env file that you have created like this
35+
36+
```
37+
docker run --env-file .env -p 80:80 zaherg/php-7.3-rc-xdebug-alpine
38+
```
39+
40+
## Installed modules information
41+
42+
It has the following modules:
43+
44+
[PHP Modules]
45+
46+
1. Core
47+
1. ctype
48+
1. curl
49+
1. date
50+
1. dom
51+
1. fileinfo
52+
1. filter
53+
1. ftp
54+
1. gd
55+
1. hash
56+
1. iconv
57+
1. intl
58+
1. json
59+
1. libxml
60+
1. mbstring
61+
1. mysqlnd
62+
1. openssl
63+
1. pcre
64+
1. PDO
65+
1. pdo_mysql
66+
1. pdo_pgsql
67+
1. pdo_sqlite
68+
1. pgsql
69+
1. Phar
70+
1. posix
71+
1. readline
72+
1. redis
73+
1. Reflection
74+
1. session
75+
1. SimpleXML
76+
1. sodium
77+
1. SPL
78+
1. sqlite3
79+
1. standard
80+
1. tokenizer
81+
1. xdebug
82+
1. xml
83+
1. xmlreader
84+
1. xmlwriter
85+
1. zip
86+
1. zlib
87+
88+
[Zend Modules]
89+
90+
1. Xdebug
91+
92+
## GD information
93+
94+
```
95+
GD Support => enabled
96+
GD Version => bundled (2.1.0 compatible)
97+
FreeType Support => enabled
98+
FreeType Linkage => with freetype
99+
FreeType Version => 2.9.1
100+
GIF Read Support => enabled
101+
GIF Create Support => enabled
102+
JPEG Support => enabled
103+
libJPEG Version => 8
104+
PNG Support => enabled
105+
libPNG Version => 1.6.34
106+
WBMP Support => enabled
107+
XBM Support => enabled
108+
109+
Directive => Local Value => Master Value
110+
gd.jpeg_ignore_warning => 1 => 1
111+
```

build

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env sh
2+
set -e
3+
4+
echo "Build hook running"
5+
6+
TAG=$1
7+
TAG=${TAG:=latest}
8+
9+
export COMMIT_HASH=`git rev-parse --short HEAD`
10+
11+
export IMAGE=zaherg/php-7.3-rc-xdebug-alpine
12+
13+
export IMAGE_COMMIT=$IMAGE:$TAG-$COMMIT_HASH
14+
15+
export IMAGE_NAME=$IMAGE:$TAG && \
16+
docker build --no-cache --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
17+
--file Dockerfile \
18+
--build-arg VCS_REF=$COMMIT_HASH \
19+
--build-arg DOCKER_REPO=$DOCKER_REPO \
20+
--build-arg IMAGE_NAME=$IMAGE_NAME \
21+
--squash --force-rm --compress --rm \
22+
-t $IMAGE_NAME .

hooks/build

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
# $IMAGE_NAME var is injected into the build so the tag is correct.
4+
5+
echo "Build hook running"
6+
docker build --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
7+
--build-arg VCS_REF=`git rev-parse --short HEAD` \
8+
-t $IMAGE_NAME .

xdebug.ini

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[xdebug]
2+
xdebug.default_enable=${PHP_XDEBUG_DEFAULT_ENABLE}
3+
xdebug.remote_enable=${PHP_XDEBUG_REMOTE_ENABLE}
4+
xdebug.remote_handler=dbgp
5+
xdebug.remote_port=${PHP_XDEBUG_REMOTE_PORT}
6+
xdebug.remote_host=${PHP_XDEBUG_REMOTE_HOST}
7+
xdebug.remote_autostart=${PHP_XDEBUG_REMOTE_AUTO_START}
8+
xdebug.remote_connect_back=${PHP_XDEBUG_REMOTE_CONNECT_BACK}
9+
xdebug.idekey=${PHP_XDEBUG_IDEKEY}
10+
11+
; profiler
12+
xdebug.profiler_enable = ${PHP_XDEBUG_PROFILER_ENABLE}
13+
xdebug.profiler_output_dir = ${PHP_XDEBUG_PROFILER_OUTPUT_DIR}

0 commit comments

Comments
 (0)