LoginSignup
14
14

More than 5 years have passed since last update.

PHP7.0のDocker Imageを作る方法

Posted at

https://github.com/php/php-srcmasterの最新版から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
14
14
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
14