From cbb6d79082c733a6b5f2c96518424dcf01ce8a0c Mon Sep 17 00:00:00 2001 From: Rafael Mello Date: Mon, 4 Apr 2016 21:30:33 -0300 Subject: [PATCH] Repository structure --- 5.6/Dockerfile | 98 ++++++++++++++++++++++++++++++++++++ Dockerfile => 7.0/Dockerfile | 29 ++++++++--- README.md | 2 +- build/pgdg.list | 1 - 4 files changed, 122 insertions(+), 8 deletions(-) create mode 100644 5.6/Dockerfile rename Dockerfile => 7.0/Dockerfile (84%) delete mode 100644 build/pgdg.list diff --git a/5.6/Dockerfile b/5.6/Dockerfile new file mode 100644 index 0000000..26c1dff --- /dev/null +++ b/5.6/Dockerfile @@ -0,0 +1,98 @@ +FROM php:5.6-fpm + +# Get repository and install wget and vim +RUN apt-get update && apt-get install --no-install-recommends -y \ + wget \ + vim \ + git \ + unzip + +# Add PostgreSQL repository +RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main" > /etc/apt/sources.list.d/pgdg.list +RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \ + apt-key add - + +# Install Oracle Instantclient +RUN mkdir /opt/oracle \ + && cd /opt/oracle \ + && wget https://s3.amazonaws.com/merofile/instantclient-basic-linux.x64-12.1.0.2.0.zip \ + && wget https://s3.amazonaws.com/merofile/instantclient-sdk-linux.x64-12.1.0.2.0.zip \ + && unzip /opt/oracle/instantclient-basic-linux.x64-12.1.0.2.0.zip -d /opt/oracle \ + && unzip /opt/oracle/instantclient-sdk-linux.x64-12.1.0.2.0.zip -d /opt/oracle \ + && ln -s /opt/oracle/instantclient_12_1/libclntsh.so.12.1 /opt/oracle/instantclient_12_1/libclntsh.so \ + && ln -s /opt/oracle/instantclient_12_1/libclntshcore.so.12.1 /opt/oracle/instantclient_12_1/libclntshcore.so \ + && ln -s /opt/oracle/instantclient_12_1/libocci.so.12.1 /opt/oracle/instantclient_12_1/libocci.so \ + && rm -rf /opt/oracle/*.zip + + +# Install PHP extensions deps +RUN apt-get update \ + && apt-get install --no-install-recommends -y \ + postgresql-server-dev-9.5 \ + libfreetype6-dev \ + libjpeg62-turbo-dev \ + libmcrypt-dev \ + libpng12-dev \ + zlib1g-dev \ + libicu-dev \ + g++ \ + unixodbc-dev \ + libxml2-dev \ + libaio-dev \ + libmemcached-dev \ + freetds-dev + +# Install Composer +RUN curl -sS https://getcomposer.org/installer | php -- \ + --install-dir=/usr/local/bin \ + --filename=composer + +# Install PHP extensions +RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ + && echo 'instantclient,/opt/oracle/instantclient_12_1/' | pecl install oci8-2.0.10 \ + && pecl install apcu-4.0.10 \ + && pecl install redis \ + && pecl install memcached \ + && docker-php-ext-configure pdo_oci --with-pdo-oci=instantclient,/opt/oracle/instantclient_12_1,12.1 \ + && docker-php-ext-configure pdo_dblib --with-libdir=/lib/x86_64-linux-gnu \ + && docker-php-ext-install \ + iconv \ + mbstring \ + intl \ + mcrypt \ + gd \ + pgsql \ + mysqli \ + pdo_pgsql \ + pdo_mysql \ + pdo_oci \ + pdo_dblib \ + soap \ + sockets \ + zip \ + pcntl \ + && docker-php-ext-enable \ + oci8 \ + apcu \ + memcached \ + redis \ + opcache + +# Clean repository +RUN apt-get clean \ + && apt-get remove -y \ + postgresql-server-dev-9.5 \ + libfreetype6-dev \ + libjpeg62-turbo-dev \ + libmcrypt-dev \ + libpng12-dev \ + zlib1g-dev \ + libicu-dev \ + g++ \ + unixodbc-dev \ + libxml2-dev \ + libaio-dev \ + libmemcached-dev \ + freetds-dev \ + && apt-get autoremove -y \ + && rm -rf /var/lib/apt/lists/* diff --git a/Dockerfile b/7.0/Dockerfile similarity index 84% rename from Dockerfile rename to 7.0/Dockerfile index da2d590..20b926f 100644 --- a/Dockerfile +++ b/7.0/Dockerfile @@ -8,7 +8,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ unzip # Add PostgreSQL repository -ADD build/pgdg.list /etc/apt/sources.list.d/ +RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main" > /etc/apt/sources.list.d/pgdg.list RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \ apt-key add - @@ -24,8 +24,10 @@ RUN mkdir /opt/oracle \ && ln -s /opt/oracle/instantclient_12_1/libocci.so.12.1 /opt/oracle/instantclient_12_1/libocci.so \ && rm -rf /opt/oracle/*.zip + # Install PHP extensions deps -RUN apt-get update && apt-get install --no-install-recommends -y \ +RUN apt-get update \ + && apt-get install --no-install-recommends -y \ postgresql-server-dev-9.5 \ libfreetype6-dev \ libjpeg62-turbo-dev \ @@ -40,10 +42,6 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ libmemcached-dev \ freetds-dev -# Clean repository -RUN apt-get clean \ - && rm -rf /var/lib/apt/lists/* - # Install Composer RUN curl -sS https://getcomposer.org/installer | php -- \ --install-dir=/usr/local/bin \ @@ -83,3 +81,22 @@ RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-di oci8 \ apcu \ opcache + +# Clean repository +RUN apt-get clean \ + && apt-get remove -y \ + postgresql-server-dev-9.5 \ + libfreetype6-dev \ + libjpeg62-turbo-dev \ + libmcrypt-dev \ + libpng12-dev \ + zlib1g-dev \ + libicu-dev \ + g++ \ + unixodbc-dev \ + libxml2-dev \ + libaio-dev \ + libmemcached-dev \ + freetds-dev \ + && apt-get autoremove -y \ + && rm -rf /var/lib/apt/lists/* diff --git a/README.md b/README.md index 36009c1..f9a6033 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Docker: PHP, extensions and PHP-FPM =================================== -Docker image with PHP, extensions and PHP-FPM. +Official [PHP docker image](https://hub.docker.com/_/php/) with additional extensions. Extensions ---------- diff --git a/build/pgdg.list b/build/pgdg.list deleted file mode 100644 index 580fbed..0000000 --- a/build/pgdg.list +++ /dev/null @@ -1 +0,0 @@ -deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main \ No newline at end of file