https://github.com/php/php-src のmaster
の最新版からDocker Imageを作りました。
CentOS7がベースです。
Dockerfile
FROM centos:7
MAINTAINER DQNEO
RUN yum -y update; yum clean all;
RUN yum -y install epel-release; yum clean all
# install packages to build php-src
RUN yum -y install wget tar make gcc autoconf bison re2c; yum clean all
# install packages to build php extensions
RUN yum -y install libxml2-devel; yum clean all
WORKDIR /usr/local/src
RUN yum -y install git; yum clean all
RUN git clone --depth 1 https://github.com/php/php-src.git
WORKDIR /usr/local/src/php-src
RUN ./buildconf
RUN ./configure --prefix=/opt/php \
--enable-mbstring
RUN make && make install && make clean
ENV PATH /opt/php/bin:${PATH}
CMD ["php", "-v"]
使い方
Dockerhubに上げておいたのでご自由にお使いください。
https://registry.hub.docker.com/u/dqneo/phpbuild/
https://github.com/DQNEO/docker-phpbuild
$ docker run dqneo/phpbuild:7.0
PHP 7.0.0-dev (cli) (built: May 20 2015 09:25:14)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0-dev, Copyright (c) 1998-2015 Zend Technologies