Skip to content

Commit 9614c01

Browse files
committed
Merge branch 'master' into php8
2 parents 3e0df5b + a326293 commit 9614c01

44 files changed

Lines changed: 413 additions & 83 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci-cd.yml

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: CI/CD
22

33
on: [push, workflow_dispatch]
44

5+
env:
6+
DOCKER_BUILDKIT: 1
7+
58
jobs:
69
build:
710
name: Build
@@ -15,45 +18,23 @@ jobs:
1518
- name: Checkout code
1619
uses: actions/checkout@v2
1720

18-
- name: Set up Docker Buildx
19-
uses: docker/setup-buildx-action@v1
20-
21-
- name: Cache Docker layers
22-
uses: actions/cache@v2
23-
with:
24-
path: /tmp/.buildx-cache
25-
key: docker-buildx-${{ matrix.version }}${{ matrix.type }}-${{ github.sha }}
26-
restore-keys: docker-buildx-${{ matrix.version }}${{ matrix.type }}-
27-
2821
- name: Build
2922
run: |
30-
docker buildx build \
31-
--cache-from type=local,src=/tmp/.buildx-cache/${{ matrix.version }}${{ matrix.type }} \
32-
--cache-to type=local,dest=/tmp/.buildx-cache/${{ matrix.version }}${{ matrix.type }} \
33-
--output type=docker \
23+
docker build \
3424
--tag kooldev/php:${{ matrix.version }}${{ matrix.type }} \
3525
${{ matrix.version }}${{ matrix.type }}
3626
37-
docker buildx build \
38-
--cache-from type=local,src=/tmp/.buildx-cache/${{ matrix.version }}-wkhtmltopdf${{ matrix.type }} \
39-
--cache-to type=local,dest=/tmp/.buildx-cache/${{ matrix.version }}-wkhtmltopdf${{ matrix.type }} \
40-
--output type=docker \
27+
docker build \
4128
--tag kooldev/php:${{ matrix.version }}-wkhtmltopdf${{ matrix.type }} \
4229
${{ matrix.version }}-wkhtmltopdf${{ matrix.type }}
4330
4431
- name: Build (nginx)
4532
run: |
46-
docker buildx build \
47-
--cache-from type=local,src=/tmp/.buildx-cache/${{ matrix.version }}-nginx${{ matrix.type }} \
48-
--cache-to type=local,dest=/tmp/.buildx-cache/${{ matrix.version }}-nginx${{ matrix.type }} \
49-
--output type=docker \
33+
docker build \
5034
--tag kooldev/php:${{ matrix.version }}-nginx${{ matrix.type }} \
5135
${{ matrix.version }}-nginx${{ matrix.type }}
5236
53-
docker buildx build \
54-
--cache-from type=local,src=/tmp/.buildx-cache/${{ matrix.version }}-nginx-wkhtmltopdf${{ matrix.type }} \
55-
--cache-to type=local,dest=/tmp/.buildx-cache/${{ matrix.version }}-nginx-wkhtmltopdf${{ matrix.type }} \
56-
--output type=docker \
37+
docker build \
5738
--tag kooldev/php:${{ matrix.version }}-nginx-wkhtmltopdf${{ matrix.type }} \
5839
${{ matrix.version }}-nginx-wkhtmltopdf${{ matrix.type }}
5940
@@ -62,8 +43,10 @@ jobs:
6243
for suffix in '' -wkhtmltopdf -nginx -nginx-wkhtmltopdf; do
6344
docker run kooldev/php:${{ matrix.version }}$suffix${{ matrix.type }} php -v
6445
docker run kooldev/php:${{ matrix.version }}$suffix${{ matrix.type }} composer -V
46+
docker run kooldev/php:${{ matrix.version }}$suffix${{ matrix.type }} composer2 -V
6547
docker run -e ASUSER=1000 kooldev/php:${{ matrix.version }}$suffix${{ matrix.type }} php -v
6648
docker run -e ASUSER=1000 kooldev/php:${{ matrix.version }}$suffix${{ matrix.type }} composer -V
49+
docker run -e ASUSER=1000 kooldev/php:${{ matrix.version }}$suffix${{ matrix.type }} composer2 -V
6750
docker run kooldev/php:${{ matrix.version }}$suffix${{ matrix.type }} php -m
6851
docker run -e ENABLE_XDEBUG=true kooldev/php:${{ matrix.version }}$suffix${{ matrix.type }} php -m
6952
done
@@ -98,6 +81,6 @@ jobs:
9881
uses: benc-uk/workflow-dispatch@v1.1
9982
if: github.ref == 'refs/heads/master' && github.repository == 'kool-dev/docker-php'
10083
with:
101-
workflow: CI
84+
workflow: CI/CD
10285
repo: kool-dev/docker-wordpress
10386
token: ${{ secrets.WORKFLOW_TOKEN }}

7.1-nginx-prod/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/s
2121

2222
COPY supervisor.conf /kool/supervisor.conf
2323
COPY default.tmpl /kool/default.tmpl
24+
COPY entrypoint /kool/entrypoint
25+
RUN chmod +x /kool/entrypoint
2426

2527
EXPOSE 80
2628

27-
ENTRYPOINT [ "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", "/kool/entrypoint" ]
2829
CMD [ "supervisord", "-c", "/kool/supervisor.conf" ]

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

7.1-nginx/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/s
2121

2222
COPY supervisor.conf /kool/supervisor.conf
2323
COPY default.tmpl /kool/default.tmpl
24+
COPY entrypoint /kool/entrypoint
25+
RUN chmod +x /kool/entrypoint
2426

2527
EXPOSE 80
2628

27-
ENTRYPOINT [ "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", "/kool/entrypoint" ]
2829
CMD [ "supervisord", "-c", "/kool/supervisor.conf" ]

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

7.1-prod/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ RUN adduser -D -u 1337 kool \
6262
&& docker-php-ext-enable redis \
6363
&& cp "/usr/local/etc/php/php.ini-production" "/usr/local/etc/php/php.ini" \
6464
# composer
65-
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
65+
&& curl -sS https://getcomposer.org/installer | php -- --1 --install-dir=/usr/local/bin --filename=composer \
66+
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer2 \
67+
&& su-exec kool composer global require hirak/prestissimo \
6668
# cleanup
6769
&& apk del .build-deps \
6870
&& rm -rf /var/cache/apk/* /tmp/*
@@ -74,5 +76,5 @@ RUN chmod +x /kool/entrypoint
7476

7577
EXPOSE 9000
7678

77-
ENTRYPOINT [ "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", "/kool/entrypoint" ]
79+
ENTRYPOINT [ "/kool/entrypoint" ]
7880
CMD [ "php-fpm" ]

7.1-prod/entrypoint

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ if [ ! -z "$CURRENT_USER" ] && [ "$CURRENT_USER" != "0" ]; then
99
usermod -u $CURRENT_USER kool
1010
fi
1111

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
13+
1214
# Run entrypoint if provided
1315
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
1416
bash $ENTRYPOINT
1517
fi
1618

17-
if [ "$1" = "bash" ] || [ "$1" = "php-fpm" ] || [ "$1" = "nginx" ] || [ "$1" = "supervisord" ]; then
19+
if [ "$1" = "sh" ] || [ "$1" = "bash" ] || [ "$1" = "php-fpm" ] ; then
1820
exec "$@"
1921
else
2022
exec su-exec kool "$@"

7.1/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ RUN adduser -D -u 1337 kool \
6464
&& docker-php-ext-enable redis \
6565
&& cp "/usr/local/etc/php/php.ini-development" "/usr/local/etc/php/php.ini" \
6666
# composer
67-
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
67+
&& curl -sS https://getcomposer.org/installer | php -- --1 --install-dir=/usr/local/bin --filename=composer \
68+
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer2 \
69+
&& su-exec kool composer global require hirak/prestissimo \
6870
# cleanup
6971
&& apk del .build-deps \
7072
&& rm -rf /var/cache/apk/* /tmp/*
@@ -76,5 +78,5 @@ RUN chmod +x /kool/entrypoint
7678

7779
EXPOSE 9000
7880

79-
ENTRYPOINT [ "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", "/kool/entrypoint" ]
81+
ENTRYPOINT [ "/kool/entrypoint" ]
8082
CMD [ "php-fpm" ]

7.1/entrypoint

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ if [ ! -z "$CURRENT_USER" ] && [ "$CURRENT_USER" != "0" ]; then
1818
usermod -u $CURRENT_USER kool
1919
fi
2020

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
22+
2123
# Run entrypoint if provided
2224
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
2325
bash $ENTRYPOINT
2426
fi
2527

26-
if [ "$1" = "bash" ] || [ "$1" = "php-fpm" ] || [ "$1" = "nginx" ] || [ "$1" = "supervisord" ]; then
28+
if [ "$1" = "sh" ] || [ "$1" = "bash" ] || [ "$1" = "php-fpm" ] ; then
2729
exec "$@"
2830
else
2931
exec su-exec kool "$@"

7.2-nginx-prod/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/s
2121

2222
COPY supervisor.conf /kool/supervisor.conf
2323
COPY default.tmpl /kool/default.tmpl
24+
COPY entrypoint /kool/entrypoint
25+
RUN chmod +x /kool/entrypoint
2426

2527
EXPOSE 80
2628

27-
ENTRYPOINT [ "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", "/kool/entrypoint" ]
2829
CMD [ "supervisord", "-c", "/kool/supervisor.conf" ]

0 commit comments

Comments
 (0)