From 471fdbf0ad45ac594e155379c496110e568a88ef Mon Sep 17 00:00:00 2001 From: AaronJan Date: Wed, 31 Dec 2014 17:45:52 +0800 Subject: [PATCH 1/4] Add description for `docker-php-ext-install` --- php/content.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/php/content.md b/php/content.md index 5e61a3700..53daa9c7c 100644 --- a/php/content.md +++ b/php/content.md @@ -65,6 +65,27 @@ same commands to build and run: Where `src/` is the directory containing all your php code and `config/` contains your `php.ini` file. +### How to install more PHP extensions + +We provide a convenient script named `docker-php-ext-install`, you can use it to +easily install PHP extension. + +For example, if you want to have a PHP container with `gd` and `mcrypt` +extensions, you can write your own Dockerfile like this: + + FROM php:5.5.19-fpm + # Install modules + RUN apt-get update && apt-get install -y \ + apt-utils re2c g++ \ + zlib1g zlib1g-dbg zlib1g-dev zlibc \ + libpng12-0 libpng12-dev libpng3 \ + libjpeg9 libjpeg9-dbg libjpeg9-dev \ + libmcrypt-dev libmcrypt4 mcrypt \ + && docker-php-ext-install gd mcrypt + CMD ["php-fpm"] + +Remember, you must install dependencies for your extensions manually. + ### Without a `Dockerfile` If you don't want to include a `Dockerfile` in your project, it is sufficient to From d06efc45ccadf6b6c1674a5a70d64b6aa81f32cb Mon Sep 17 00:00:00 2001 From: AaronJan Date: Tue, 6 Jan 2015 18:03:31 +0800 Subject: [PATCH 2/4] Make this more clear --- php/content.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/php/content.md b/php/content.md index 53daa9c7c..7e8299e85 100644 --- a/php/content.md +++ b/php/content.md @@ -70,13 +70,14 @@ contains your `php.ini` file. We provide a convenient script named `docker-php-ext-install`, you can use it to easily install PHP extension. -For example, if you want to have a PHP container with `gd` and `mcrypt` -extensions, you can write your own Dockerfile like this: +For example, if you want to have a PHP-FPM image with `gd` and `mcrypt` +extensions, you can inheriting the base image that you like, and write your own +Dockerfile like this: FROM php:5.5.19-fpm # Install modules RUN apt-get update && apt-get install -y \ - apt-utils re2c g++ \ + apt-utils re2c \ zlib1g zlib1g-dbg zlib1g-dev zlibc \ libpng12-0 libpng12-dev libpng3 \ libjpeg9 libjpeg9-dbg libjpeg9-dev \ From 19c9cdcbb811dacbf20b91214fbbcdd7333cc955 Mon Sep 17 00:00:00 2001 From: AaronJan Date: Wed, 7 Jan 2015 09:56:45 +0800 Subject: [PATCH 3/4] Add backticks. --- php/content.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/content.md b/php/content.md index 7e8299e85..cd40025cd 100644 --- a/php/content.md +++ b/php/content.md @@ -72,7 +72,7 @@ easily install PHP extension. For example, if you want to have a PHP-FPM image with `gd` and `mcrypt` extensions, you can inheriting the base image that you like, and write your own -Dockerfile like this: +`Dockerfile` like this: FROM php:5.5.19-fpm # Install modules From 581049b1b41d9cb470237bc72045b0baa1b9c967 Mon Sep 17 00:00:00 2001 From: AaronJan Date: Thu, 15 Jan 2015 19:41:38 +0800 Subject: [PATCH 4/4] Make `Dockerfile` shorter and better --- php/content.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/php/content.md b/php/content.md index cd40025cd..a4947408d 100644 --- a/php/content.md +++ b/php/content.md @@ -67,25 +67,24 @@ contains your `php.ini` file. ### How to install more PHP extensions -We provide a convenient script named `docker-php-ext-install`, you can use it to +We provide two convenient scripts named `docker-php-ext-configure` and `docker-php-ext-install`, you can use them to easily install PHP extension. -For example, if you want to have a PHP-FPM image with `gd` and `mcrypt` +For example, if you want to have a PHP-FPM image with `iconv`, `mcrypt` and `gd` extensions, you can inheriting the base image that you like, and write your own `Dockerfile` like this: - FROM php:5.5.19-fpm + FROM php:5.5-fpm # Install modules RUN apt-get update && apt-get install -y \ - apt-utils re2c \ - zlib1g zlib1g-dbg zlib1g-dev zlibc \ - libpng12-0 libpng12-dev libpng3 \ - libjpeg9 libjpeg9-dbg libjpeg9-dev \ - libmcrypt-dev libmcrypt4 mcrypt \ - && docker-php-ext-install gd mcrypt + libmcrypt-dev libpng12-dev libfreetype6-dev libjpeg62-turbo-dev \ + && docker-php-ext-install iconv mcrypt \ + && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-gd-dir=/usr/include/ \ + && docker-php-ext-install gd CMD ["php-fpm"] -Remember, you must install dependencies for your extensions manually. +Remember, you must install dependencies for your extensions manually. If an extension needs custom `configure` arguments, +you can use the `docker-php-ext-configure` script like this example. ### Without a `Dockerfile`