Browse Source

Add explanation to php for `docker-php-source`

Joe Ferguson 9 years ago
parent
commit
e684406d7e
1 changed files with 10 additions and 1 deletions
  1. 10 1
      php/content.md

+ 10 - 1
php/content.md

@@ -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