Skip to content
A Dockerfile to create a Docker image with nginx and php5-fpm
Branch: master
Clone or download
This branch is 22 commits behind ishakuta:master.

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.


A Dockerfile to create a Docker image with nginx and php5-fpm

This was created using this blog post and lots of Googling.

It's posted on the Docker INDEX at ishakuta/docker-nginx-php5

Some size research on docker folders: docker folders size with this image and stackbrew base images

To build:

git clone
cd docker-nginx-php5
docker build -t <yournamehere>/nginx .

You can then run the built image: docker run -d <yournamehere>/nginx-php5-fpm

You should see a running image if you run docker ps

vagrant@ubuntu-13:~$ docker run -d <yournamehere>/nginx-php5-fpm
vagrant@ubuntu-13:~$ docker ps
ID                  IMAGE                 COMMAND                CREATED             STATUS              PORTS
6592bc4c0193        <yournamehere>/docker-nginx-php5:latest   /bin/sh -c service p   2 seconds ago       Up 1 seconds        49153->80

To serve another site - you can layer on top of this - here's an example Dockerfile:

FROM ishakuta/docker-nginx-php5

# Build your new site here. 
RUN echo "Site 123 ABC" > /var/www/index.php
RUN echo "<?php phpinfo(); ?>" >> /var/www/index.php
CMD service php5-fpm start && nginx
You can’t perform that action at this time.