Skip to content

Commit 5611f1b

Browse files
committed
fix xdebug on php 7.1
1 parent b20db3b commit 5611f1b

13 files changed

Lines changed: 74 additions & 11 deletions

File tree

7.1-prod/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ RUN adduser -D -u 1337 kool \
5353
xml \
5454
zip \
5555
&& pecl install imagick \
56-
&& pecl install redis \
56+
&& pecl install redis \
5757
&& docker-php-ext-enable imagick \
5858
&& docker-php-ext-enable redis \
5959
&& cp "/usr/local/etc/php/php.ini-production" "/usr/local/etc/php/php.ini" \

7.1/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ RUN adduser -D -u 1337 kool \
5353
xml \
5454
zip \
5555
&& pecl install imagick \
56-
&& pecl install redis xdebug \
56+
&& pecl install redis \
57+
&& pecl install xdebug-2.9.8 \
5758
&& docker-php-ext-enable imagick \
5859
&& docker-php-ext-enable redis \
5960
&& cp "/usr/local/etc/php/php.ini-development" "/usr/local/etc/php/php.ini" \

7.2-prod/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ RUN adduser -D -u 1337 kool \
5353
xml \
5454
zip \
5555
&& pecl install imagick \
56-
&& pecl install redis \
56+
&& pecl install redis \
5757
&& docker-php-ext-enable imagick \
5858
&& docker-php-ext-enable redis \
5959
&& cp "/usr/local/etc/php/php.ini-production" "/usr/local/etc/php/php.ini" \

7.2/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ RUN adduser -D -u 1337 kool \
5353
xml \
5454
zip \
5555
&& pecl install imagick \
56-
&& pecl install redis xdebug \
56+
&& pecl install redis \
57+
&& pecl install xdebug \
5758
&& docker-php-ext-enable imagick \
5859
&& docker-php-ext-enable redis \
5960
&& cp "/usr/local/etc/php/php.ini-development" "/usr/local/etc/php/php.ini" \

7.3-prod/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ RUN adduser -D -u 1337 kool \
5353
xml \
5454
zip \
5555
&& pecl install imagick \
56-
&& pecl install redis \
56+
&& pecl install redis \
5757
&& docker-php-ext-enable imagick \
5858
&& docker-php-ext-enable redis \
5959
&& cp "/usr/local/etc/php/php.ini-production" "/usr/local/etc/php/php.ini" \

7.3/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ RUN adduser -D -u 1337 kool \
5353
xml \
5454
zip \
5555
&& pecl install imagick \
56-
&& pecl install redis xdebug \
56+
&& pecl install redis \
57+
&& pecl install xdebug \
5758
&& docker-php-ext-enable imagick \
5859
&& docker-php-ext-enable redis \
5960
&& cp "/usr/local/etc/php/php.ini-development" "/usr/local/etc/php/php.ini" \

7.4-prod/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ RUN adduser -D -u 1337 kool \
5050
xml \
5151
zip \
5252
&& pecl install imagick \
53-
&& pecl install redis \
53+
&& pecl install redis \
5454
&& docker-php-ext-enable imagick \
5555
&& docker-php-ext-enable redis \
5656
&& cp "/usr/local/etc/php/php.ini-production" "/usr/local/etc/php/php.ini" \

7.4/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ RUN adduser -D -u 1337 kool \
5050
xml \
5151
zip \
5252
&& pecl install imagick \
53-
&& pecl install redis xdebug \
53+
&& pecl install redis \
54+
&& pecl install xdebug \
5455
&& docker-php-ext-enable imagick \
5556
&& docker-php-ext-enable redis \
5657
&& cp "/usr/local/etc/php/php.ini-development" "/usr/local/etc/php/php.ini" \

8.0-nginx-prod/entrypoint

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/sh
2+
set -e
3+
4+
5+
# Run as current user
6+
CURRENT_USER=${ASUSER:-${UID:-0}}
7+
8+
if [ ! -z "$CURRENT_USER" ] && [ "$CURRENT_USER" != "0" ]; then
9+
usermod -u $CURRENT_USER kool
10+
fi
11+
12+
dockerize -template /kool/kool.tmpl:/usr/local/etc/php/conf.d/kool.ini -template /kool/zz-docker.tmpl:/usr/local/etc/php-fpm.d/zz-docker.conf -template /kool/default.tmpl:/etc/nginx/conf.d/default.conf
13+
14+
# Run entrypoint if provided
15+
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
16+
bash $ENTRYPOINT
17+
fi
18+
19+
if [ "$1" = "sh" ] || [ "$1" = "bash" ] || [ "$1" = "php-fpm" ] || [ "$1" = "nginx" ] || [ "$1" = "supervisord" ]; then
20+
exec "$@"
21+
else
22+
exec su-exec kool "$@"
23+
fi

8.0-nginx/entrypoint

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/sh
2+
set -e
3+
4+
if [ "$ENABLE_XDEBUG" == "true" ]; then
5+
docker-php-ext-enable xdebug >> /dev/null 2>&1
6+
7+
if [ $? != "0" ]; then
8+
echo "[ERROR] An error happened enabling xdebug"
9+
10+
exit 1
11+
fi
12+
fi
13+
14+
# Run as current user
15+
CURRENT_USER=${ASUSER:-${UID:-0}}
16+
17+
if [ ! -z "$CURRENT_USER" ] && [ "$CURRENT_USER" != "0" ]; then
18+
usermod -u $CURRENT_USER kool
19+
fi
20+
21+
dockerize -template /kool/kool.tmpl:/usr/local/etc/php/conf.d/kool.ini -template /kool/zz-docker.tmpl:/usr/local/etc/php-fpm.d/zz-docker.conf -template /kool/default.tmpl:/etc/nginx/conf.d/default.conf
22+
23+
# Run entrypoint if provided
24+
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
25+
bash $ENTRYPOINT
26+
fi
27+
28+
if [ "$1" = "sh" ] || [ "$1" = "bash" ] || [ "$1" = "php-fpm" ] || [ "$1" = "nginx" ] || [ "$1" = "supervisord" ]; then
29+
exec "$@"
30+
else
31+
exec su-exec kool "$@"
32+
fi

0 commit comments

Comments
 (0)