Sign inSign up

hdcore/docker-php

By hdcore

Updated 20 days ago

PHP image with phpunit for use in CI

Image
Developer tools
0

6.3K

hdcore/docker-php repository overview

HDCore - docker-php

Introduction

This is a small container image that contains a php environment with composer and phpunit. This container is very usefull for automatic testing during CI.

Image usage

  • Run phpunit:
docker run --rm -v /path/to/code:/code hdcore/docker-php:<version> phpunit --coverage-text
  • Run shell:
docker run -it --rm -v /path/to/code:/code hdcore/docker-php:<version> /bin/sh
  • Use in .gitlab-ci.yml:
image: hdcore/docker-php:<version>
script: phpunit --coverage-text
Add http proxy on startup
  • Set the http_proxy (lowercase) environment variable
Add extra CA certificates on startup
  • Add the *.crt to the /certificates/ folder.
  • Set the CACERT_FILE_XXXX environment variable who points to local filename
  • Set the CACERT_VAR_XXX environment variable with the content of the certificate
Add extra SSH KEY on startup
  • Set the SSH_PRIVATE_KEY environment variable to the private key content:
Add composer access tokens
  • Set the COMPOSER_AUTH environment variable with the JSON content

Available tags

  • hdcore/docker-php:8.4
  • hdcore/docker-php:8.5

Container Registries

The image is stored on multiple container registries at dockerhub and gitlab:

  • Docker Hub:
    • hdcore/docker-php
  • Gitlab:
    • registry.gitlab.com/hdcore-docker/docker-php

Building image

Build:

docker compose build local-php-8.4
docker compose build local-php-8.5

Running the image

Default
docker compose run --rm local-php-8.4
docker compose run --rm local-php-8.5

Tag summary

Content type

Image

Digest

sha256:6bf008632

Size

236.3 MB

Last updated

20 days ago

docker pull hdcore/docker-php:8.5