Skip to content

Commit 9765ba0

Browse files
committed
Added PHP 8.0 images
1 parent 695e37d commit 9765ba0

File tree

7 files changed

+3963
-23
lines changed

7 files changed

+3963
-23
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
### Added
9+
- Added PHP 8.0 images
810

911
## [1.3.0] - 2021-02-14
1012
### Changes

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
REPOSITORY?=jsunier/php-symfony-test
22
BUILD_DATE="$(shell date -u +"%Y-%m-%dT%H:%m:%SZ")"
33
COMPOSER_VERSION=2
4-
VERSIONS=7.4 7.3 7.2 7.1
5-
LATEST_VERSION=7.4
4+
VERSIONS=8.0 7.4 7.3 7.2 7.1
5+
LATEST_VERSION=8.0
66

77
.PHONY: build
88
build: build-mysql build-postgresql

README.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# jsunier/php-symfony-test
22

3-
Docker image to run PHPUnit with Symfony 3.x/4.x/5.x on PHP `7.1`/`7.2`/`7.3`/`7.4`.
3+
Docker image to run PHPUnit with Symfony 3.x/4.x/5.x on PHP `7.1`/`7.2`/`7.3`/`7.4`/`8.0`.
44

55
Docker container allowing you to build and test your PHP projects.
66

77
## Supported tags and respective `Dockerfile` links
88

9-
- `php7.4-mysql`, `php7.4-mariadb`, `latest`, `latest-mysql` ([php7.4/mysql/Dockerfile](https://github.com/jsunier/php-symfony-test/blob/master/php7.4/mysql/Dockerfile))
10-
- `php7.3-mysql`, `php7.3-mariadb`, ([php7.3/mysql/Dockerfile](https://github.com/jsunier/php-symfony-test/blob/master/php7.3/mysql/Dockerfile))
9+
- `php8.0-mysql`, `php8.0-mariadb`, `latest`, `latest-mysql` ([php8.0/mysql/Dockerfile](https://github.com/jsunier/php-symfony-test/blob/master/php8.0/mysql/Dockerfile))
10+
- `php7.4-mysql`, `php7.4-mariadb` ([php7.4/mysql/Dockerfile](https://github.com/jsunier/php-symfony-test/blob/master/php7.4/mysql/Dockerfile))
11+
- `php7.3-mysql`, `php7.3-mariadb` ([php7.3/mysql/Dockerfile](https://github.com/jsunier/php-symfony-test/blob/master/php7.3/mysql/Dockerfile))
1112
- `php7.2-mysql`, `php7.2-mariadb` ([php7.2/mysql/Dockerfile](https://github.com/jsunier/php-symfony-test/blob/master/php7.2/mysql/Dockerfile))
1213
- `php7.1-mysql`, `php7.1-mariadb` ([php7.1/mysql/Dockerfile](https://github.com/jsunier/php-symfony-test/blob/master/php7.1/mysql/Dockerfile))
1314
- `php7.4-postgresql`, `latest-postgresql` ([php7.3/postgresql/Dockerfile](https://github.com/jsunier/php-symfony-test/blob/master/php7.3/postgresql/Dockerfile))
@@ -34,23 +35,23 @@ Every images include the latest version of [composer](https://getcomposer.org) i
3435

3536
List of PHP extensions installed:
3637

37-
| Extension / PHP version | 7.1 | 7.2 | 7.3 | 7.4 |
38-
|------------------------------------------------------------------------------|-----|-----|-----|-----|
39-
| `mbstring` |||||
40-
| `zip` |||||
41-
| `iconv` |||||
42-
| `opcache` |||||
43-
| `bcmath` |||||
44-
| `pdo_mysql` (mysql/mariadb) / `pdo_pgsql` (postgresql) |||||
45-
| `pdo` |||||
46-
| `imagick` |||||
47-
| `sockets` |||||
48-
| `xdebug` (2.6.1 for PHP 7.1 and 7.2 / 2.7.1 for PHP 7.3 / 2.9.0 for PHP 7.4) |||||
49-
| `gd` |||||
50-
| `soap` |||||
51-
| `mcrypt` |||||
52-
| `oci8` |||||
53-
| `redis` |||||
38+
| Extension / PHP version | 7.1 | 7.2 | 7.3 | 7.4 | 8.0 |
39+
| ------------------------------------------------------------------------------------------------ | --- | --- | --- | --- | --- |
40+
| `mbstring` ||||||
41+
| `zip` ||||||
42+
| `iconv` ||||||
43+
| `opcache` ||||||
44+
| `bcmath` ||||||
45+
| `pdo_mysql` (mysql/mariadb) / `pdo_pgsql` (postgresql) ||||||
46+
| `pdo` ||||||
47+
| `imagick` ||||||
48+
| `sockets` ||||||
49+
| `xdebug` (2.6.1 for PHP 7.1 and 7.2 / 2.7.1 for PHP 7.3 / 2.9.0 for PHP 7.4 / 3.0.4 for PHP 8.0) | |||||
50+
| `gd` ||||||
51+
| `soap` ||||||
52+
| `mcrypt` ||||||
53+
| `oci8` ||||||
54+
| `redis` ||||||
5455

5556
## Examples
5657

@@ -122,6 +123,6 @@ To build these images, just go into the folder of you choice and run `docker bui
122123

123124
Example:
124125
```
125-
# cd php7.4/mysql
126+
# cd php8.0/mysql
126127
# docker build . -t my-awesome-phpunit-image
127128
```

php8.0/mysql/Dockerfile

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
ARG COMPOSER_VERSION=latest
2+
3+
FROM composer:${COMPOSER_VERSION} as composer_image
4+
5+
FROM php:8.0-cli
6+
7+
ARG BUILD_DATE
8+
ARG XDEBUG_VERSION=3.0.4
9+
10+
LABEL maintainer="Joël Sunier <jsunier@stogon.io>" \
11+
php.version="8.0" \
12+
php.pdo_connector="MySQL" \
13+
php.xdebug_version=${XDEBUG_VERSION} \
14+
org.label-schema.build-date=${BUILD_DATE}
15+
16+
RUN apt-get update && apt-get install -yqq git curl libmcrypt-dev libjpeg-dev libpng-dev libfreetype6-dev libbz2-dev libxml2-dev libmagickwand-dev libpq-dev libzip-dev libwebp-dev unzip && \
17+
docker-php-ext-install pdo_mysql zip opcache bcmath sockets soap && \
18+
docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp && \
19+
docker-php-ext-install gd && \
20+
pecl install imagick xdebug-${XDEBUG_VERSION} redis && \
21+
docker-php-ext-enable imagick xdebug redis && \
22+
apt-get clean
23+
24+
COPY php.ini $PHP_INI_DIR/php.ini
25+
COPY --from=composer_image /usr/bin/composer /usr/bin/composer
26+
27+
WORKDIR /app
28+
29+
# Create a "symfony" user
30+
RUN groupadd --gid 1000 symfony \
31+
&& useradd --uid 1000 --gid symfony --shell /bin/bash --create-home symfony
32+
33+
# Install the Symfony CLI
34+
RUN curl -sS https://get.symfony.com/cli/installer | bash && \
35+
mv /root/.symfony/bin/symfony /usr/local/bin/symfony
36+
37+
# Fix permissions issues
38+
RUN chmod -R a+wrx /app
39+
RUN chmod a+wrx /usr/bin/composer
40+
41+
# Fix Imagick rights for PDF
42+
RUN rm /etc/ImageMagick-6/policy.xml
43+
44+
VOLUME [ "/app" ]
45+
46+
USER symfony
47+
48+
CMD [ "/app/bin/console" ]

0 commit comments

Comments
 (0)