Alpine images are frequently used with Docker because they provide a very small final Docker image size. This has an advantage when pulling base images from Docker registry, and when pushing them to the registry or production.
Alpine Linux provides apk tool for managing packages.
Alpine already offers a very good PHP packages in their official repository.
In Docker, you can install the PHP very easily with apk:
FROM alpine:3.6
RUN apk add --no-cache php7Keep in mind that there is a separate repository for each PHP extension. For example,
if you'll need session extension, you'll need to add the php7-session package:
FROM alpine:3.6
RUN apk add --no-cache php7 php7-session