ihneo/php

By ihneo

Updated 5 months ago

PHP Dockerfiles with additional libraries (mainly for our needs)

Image
Languages & frameworks
0

6.8K

ihneo/php repository overview

PHP

PHP Dockerfiles with additional libraries (mainly for our needs)

Example of Usage

Move to the folder containing the desired Dockerfile.

Build the image

docker build -t <dockertag> .

Create a shell script called php<version>.sh with this content :

#!/bin/bash
docker run --rm --interactive --tty \
  --workdir /usr/src/myapp \
  --volume $PWD:/usr/src/myapp \
  --user $(id -u):$(id -g) \
  <dockertag> php "$@"

Dockerhub

All images are available at : https://hub.docker.com/r/ihneo/php

You can pull all images with the command :

docker pull ihneo/php:<dockertag>

Example of usage with the images available at Dockerhub

#!/bin/bash
docker run --rm --interactive --tty \
  --workdir /usr/src/myapp \
  --volume $PWD:/usr/src/myapp \
  --user $(id -u):$(id -g) \
  ihneo/php:<dockertag> php "$@"

Composer

Composer is also available in all images

To use composer in version 1, command is composer

To use composer in version 2, command is composer2

An example to use the docker image as a composer binary :

#!/bin/bash
docker run --rm --interactive --tty \
  --env COMPOSER_HOME=/tmp/composer/config \
  --env COMPOSER_CACHE_DIR=/tmp/composer/cache \
  --workdir /app \
  --volume $PWD:/app \
  --volume ${COMPOSER_HOME:-$HOME/.config/composer}:/tmp/composer/config \
  --volume ${COMPOSER_CACHE_DIR:-$HOME/.cache/composer}:/tmp/composer/cache \
  --user $(id -u):$(id -g) \
  ihneo/php:<dockertag> composer "$@"

Tag summary

Content type

Image

Digest

sha256:13c225b5f

Size

290 MB

Last updated

5 months ago

docker pull ihneo/php:8.5-cli-alpine