Skip to content

Dockerfiles for create images on php for run test. Images contains installed xdebug, composer. The file Dockerfile.dev can be used to run tests locally.

License

Notifications You must be signed in to change notification settings

i3bepb/php-images-for-test

Repository files navigation

Images php for run test

Dockerfiles for create images on php for run test. Images based on php:cli-alpine and contains xdebug, composer.

Build base image

php 7.2.34

  1. Build from root directory
docker build -f php7234/Dockerfile.base -t i3bepb/php-for-test:1.2.6-php-7.2.34-cli-alpine3.12 ./php7234
  1. So you can run, check
docker run --rm -it i3bepb/php-for-test:1.2.6-php-7.2.34-cli-alpine3.12 sh

php 7.3.33

  1. Build from root directory
docker build -f php7333/Dockerfile.base -t i3bepb/php-for-test:1.2.6-php-7.3.33-cli-alpine3.15 ./php7333
  1. So you can run, check
docker run --rm -it i3bepb/php-for-test:1.2.6-php-7.3.33-cli-alpine3.15 sh

php 7.4.33

  1. Build from root directory
docker build -f php7433/Dockerfile.base -t i3bepb/php-for-test:1.2.6-php-7.4.33-cli-alpine3.16 ./php7433
  1. So you can run, check
docker run --rm -it i3bepb/php-for-test:1.2.6-php-7.4.33-cli-alpine3.16 sh

php 8.0.30

  1. Build from root directory
docker build -f php8030/Dockerfile.base -t i3bepb/php-for-test:1.2.6-php-8.0.30-cli-alpine3.16 ./php8030
  1. So you can run, check
docker run --rm -it i3bepb/php-for-test:1.2.6-php-8.0.30-cli-alpine3.16 sh

php 8.1.31

  1. Build from root directory
docker build -f php8131/Dockerfile.base -t i3bepb/php-for-test:1.2.6-php-8.1.31-cli-alpine3.21 ./php8131
  1. So you can run, check
docker run --rm -it i3bepb/php-for-test:1.2.6-php-8.1.31-cli-alpine3.21 sh

php 8.2.27

  1. Build from root directory
docker build -f php8227/Dockerfile.base -t i3bepb/php-for-test:1.2.6-php-8.2.27-cli-alpine3.21 ./php8227
  1. So you can run, check
docker run --rm -it i3bepb/php-for-test:1.2.6-php-8.2.27-cli-alpine3.21 sh

php 8.3.16

  1. Build from root directory
docker build -f php8316/Dockerfile.base -t i3bepb/php-for-test:1.2.6-php-8.3.16-cli-alpine3.21 ./php8316
  1. So you can run, check
docker run --rm -it i3bepb/php-for-test:1.2.6-php-8.3.16-cli-alpine3.21 sh

php 8.4.16

  1. Build from root directory
docker build -f php8403/Dockerfile.base -t i3bepb/php-for-test:1.2.6-php-8.4.3-cli-alpine3.21 ./php8403
  1. So you can run, check
docker run --rm -it i3bepb/php-for-test:1.2.6-php-8.4.3-cli-alpine3.21 sh

How use on local

The file Dockerfile.dev can be used to run tests. Build a local image to map local user to user inside the container. For example user (1000:1000). Run from root directory.

docker build -f Dockerfile.dev -t php74-for-test:1.0.0 --build-arg MYAPP_IMAGE=i3bepb/php-for-test:1.2.6-php-7.4.33-cli-alpine3.16 --build-arg LOCAL_USER_ID_ARG=1000 --build-arg LOCAL_GROUP_ID_ARG=1000 .

Run container in interactive mode for tests

docker run -it --rm -v $(pwd):/home/www-data/application php74-for-test:1.0.0 sh

Inside container run

php vendor/bin/phpunit

or

php vendor/bin/testbench package:test

or

php vendor/bin/testbench package:test --coverage

etc.

About

Dockerfiles for create images on php for run test. Images contains installed xdebug, composer. The file Dockerfile.dev can be used to run tests locally.

Resources

License

Stars

Watchers

Forks

Packages

No packages published