keinos/php7-alpine

By keinos

Updated about 4 years ago

Minimal PHP7 Alpine image. Usage: See repo.

Image

389

Dockerfile of PHP7-Alpine

Lightweight PHP7 Alpine docker image. (Only PHP core, no modules)

docker pull keinos/php7-alpine:latest

Usage

$ docker pull keinos/php7-alpine
...
$ # Sample of running `php --version` command
$ docker run --rm -it keinos/php7-alpine php --version
PHP 7.2.18 (cli) (built: May  4 2019 16:25:12) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

The below YAML is an example of Dockerfile. It prepares a PHP7 image with mbstringjsonctypeopenssl modules installed and copies the src/ directory in local to /app directory on the image.

FROM keinos/php7-alpine

RUN apk update \
    && apk add --update \
      php-mbstring@php \
      php-json@php \
      php-ctype@php \
      php-openssl@php \
    && rm -rf /var/cache/apk/*

COPY src/ /app/
WORKDIR /app
$ # Access container interactively via tty and setup
$ docker run -it -name my_sample_image keinos/php7-alpine /bin/sh
/ #
/ # apk update
...
/ # # Add mb-string module for latest PHP
/ # apk add php-mbstring@php
...
/ # # Add json module for latest PHP
/ # apk add php-json@php
...
...
/ # # Delete cache of apk
/ # rm -rf /var/cache/apk/*
...
/ # exit
$

Docker Pull Command

docker pull keinos/php7-alpine