From 005da9283844e7e45175fbfd8851cddb93d71c33 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Sat, 10 Dec 2016 08:52:07 -0800 Subject: [PATCH] Fix xcache example and add example of using docker-php-ext-* with an absolute path --- php/content.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/php/content.md b/php/content.md index c87f682ce..eb36e2ae5 100644 --- a/php/content.md +++ b/php/content.md @@ -111,7 +111,7 @@ RUN apt-get update && apt-get install -y libmemcached-dev \ Some extensions are not provided via either Core or PECL; these can be installed too, although the process is less automated: ```dockerfile -FROM php:7.0-apache +FROM php:5.6-apache RUN curl -fsSL 'https://xcache.lighttpd.net/pub/Releases/3.2.0/xcache-3.2.0.tar.gz' -o xcache.tar.gz \ && mkdir -p xcache \ && tar -xf xcache.tar.gz -C xcache --strip-components=1 \ @@ -127,6 +127,19 @@ RUN curl -fsSL 'https://xcache.lighttpd.net/pub/Releases/3.2.0/xcache-3.2.0.tar. && docker-php-ext-enable xcache ``` +The `docker-php-ext-*` scripts *can* accept an arbitrary path, but it must be absolute (to disambiguate from built-in extension names), so the above example could also be written as the following: + +```dockerfile +FROM php:5.6-apache +RUN curl -fsSL 'https://xcache.lighttpd.net/pub/Releases/3.2.0/xcache-3.2.0.tar.gz' -o xcache.tar.gz \ + && mkdir -p /tmp/xcache \ + && tar -xf xcache.tar.gz -C /tmp/xcache --strip-components=1 \ + && rm xcache.tar.gz \ + && docker-php-ext-configure /tmp/xcache --enable-xcache \ + && docker-php-ext-install /tmp/xcache \ + && rm -r /tmp/xcache +``` + ### Without a `Dockerfile` If you don't want to include a `Dockerfile` in your project, it is sufficient to do the following: