Skip to content
/ php Public

PHP Dockerfiles with additional libraries

Notifications You must be signed in to change notification settings

ihneo/php

Repository files navigation

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>

Supported tags and respective Dockerfile links

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 "$@"

About

PHP Dockerfiles with additional libraries

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published