From 4a65eb359cdbd7429b042cfa32d3beca25076ddf Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Wed, 22 Sep 2021 08:44:56 +0200 Subject: [PATCH] Improve installation instructions --- README.md | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 47689d6..c2ffe17 100644 --- a/README.md +++ b/README.md @@ -16,10 +16,12 @@ See also the notes in the [Special requirements](#special-requirements) section. You have two ways to use this script within your `Dockerfile`s: you can download the script on the fly, or you can grab it from the [`mlocati/php-extension-installer` Docker Hub image](https://hub.docker.com/r/mlocati/php-extension-installer). With the first method you are sure you'll always get the very latest version of the script, with the second method the process is faster since you'll use a local image. -For example, here are two `Dockerfile`s that install the GD and xdebug PHP extensions: +For example, here some `Dockerfile`s that install the GD and xdebug PHP extensions: ### Downloading the script on the fly +#### With the Dockerfile + ```Dockerfile FROM php:7.2-cli @@ -29,6 +31,18 @@ RUN chmod +x /usr/local/bin/install-php-extensions && \ install-php-extensions gd xdebug ``` +#### With curl + +```Dockerfile +FROM php:7.2-cli + +RUN curl -sSLf \ + -o /usr/local/bin/install-php-extensions \ + https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions && \ + chmod +x /usr/local/bin/install-php-extensions && \ + install-php-extensions gd xdebug +``` + ### Copying the script from a Docker image ```Dockerfile @@ -39,16 +53,13 @@ COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr RUN install-php-extensions gd xdebug ``` -#### *Beware* - -*When building locally, be sure you have the latest version of the `mlocati/php-extension-installer` image by running:* - -```sh -docker pull mlocati/php-extension-installer -``` - -*otherwise the `COPY` instruction could use a previously downloaded, outdated version of the image stored in the local docker cache.* - +> **Warning**: by using this method you may use an outdated version of the `mlocati/php-extension-installer` image. +> +> In order to be sure the `COPY` instruction uses the very latest version, you can run: +> +> ```sh +> docker pull mlocati/php-extension-installer +> ``` ### Installing specific versions of an extension @@ -402,7 +413,6 @@ Improve the GD and ZIP extensions Test: gd+zip ``` - If your pull request contains multiple commits, we'll check the "Test:" message of every commit. If you want to stop parsing next commits, add `-STOP-` in the "Test:" line, for example: