Dockerfile for PHP
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
conf
tests_php
.gitignore
Dockerfile.7.0
Dockerfile.7.0-cli
Dockerfile.7.x
Dockerfile.7.x-cli
Dockerfile.7.x-composer
LICENCE
Makefile
README.md
config_msmtp.sh
entrypoint.sh
entrypoint_cli.sh

README.md

PHP docker images by bearstech

3 variants of PHP7 from Debian Stretch :

All variants are available as tag for PHP 7.0, 7.1 and 7.2

Dockerfiles

Dockerfiles are available at https://github.com/factorysh/docker-php

Usage

docker run --rm bearstech/php:7.2
docker run --rm bearstech/php-cli:7.2
docker run --rm bearstech/php-composer:7.2

User

fpm images needs a specific user, not root. In your Dockerfile, use something like :

RUN useradd alice --shell /bin/bash
COPY www /var/www/web
USER alice

If you are using a volume, be carefuls with uids :

ARG UID=1001
RUN useradd alice --uid ${UID} --shell /bin/bash
COPY www /var/www/web
USER alice

and build the image with a build-arg like :

--build-arg UID=`id -u`