|
|
@@ -68,6 +68,15 @@ Where `src/` is the directory containing all your php code and `config/` contain
|
|
|
|
|
|
We provide the helper scripts `docker-php-ext-configure`, `docker-php-ext-install`, and `docker-php-ext-enable` to more easily install PHP extensions.
|
|
|
|
|
|
+In order to keep the images smaller, the php source is kept in a compressed tar file. To facilitate linking of the php source with any extension, we also provide the helper script `docker-php-source` to easily extract the tar or delete the extracted source. Note: if you do use `docker-php-source` to extract the source, be sure to delete it in the same layer of the docker image.
|
|
|
+
|
|
|
+```Dockerfile
|
|
|
+FROM php:5-apache
|
|
|
+RUN docker-php-source extract \
|
|
|
+ # do important things \
|
|
|
+ && docker-php-source delete
|
|
|
+```
|
|
|
+
|
|
|
#### PHP Core Extensions
|
|
|
|
|
|
For example, if you want to have a PHP-FPM image with `iconv`, `mcrypt` and `gd` extensions, you can inherit the base image that you like, and write your own `Dockerfile` like this:
|
|
|
@@ -84,7 +93,7 @@ RUN apt-get update && apt-get install -y \
|
|
|
&& docker-php-ext-install -j$(nproc) gd
|
|
|
```
|
|
|
|
|
|
-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.
|
|
|
+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. There is no need to run `docker-php-source` manually in this case, since that is handled by the `configure` and `install` scripts.
|
|
|
|
|
|
#### PECL extensions
|
|
|
|