Public Repository

Last pushed: 3 months ago
Short Description
PHP image with apache 2 and necessary drivers to connect to Oracle databases (with oci8 drivers).
Full Description

Dockerfile example of tag 5.6:

FROM php:5.6-apache

# Oracle
# copy oracle files
ADD oracle/instantclient-basic-linux.x64-12.1.0.2.0.zip /tmp/
ADD oracle/instantclient-sdk-linux.x64-12.1.0.2.0.zip /tmp/

RUN apt-get update \
    && apt-get install -y build-essential git zlib1g zlib1g-dev vim unzip libaio1 \
# Install xdebug
&& pecl install xdebug \
    && docker-php-ext-enable xdebug \
# Below extensions are expected to appear.
# If they appear commented out, they already exists on parent image
# Install opcache
&& docker-php-ext-install opcache \
# Install APCu (available only for PHP 7)
#&& pecl install apcu
#&& echo "extension=apcu.so" > /usr/local/etc/php/conf.d/apcu.ini
# Install iconv
#&& docker-php-ext-install iconv
# Install mbstring
#&& docker-php-ext-install mbstring
# Install curl
#&& apt-get install -y curl libcurl4-openssl-dev
#&& docker-php-ext-install curl
# Install tokenizer
#&& docker-php-ext-install tokenizer
# Install xmlrpc
&& apt-get install -y libxml2-dev \
&& docker-php-ext-install xmlrpc \
# Install soap
&& docker-php-ext-install soap \
# Install ctype
#&& docker-php-ext-install ctype
# Install zip
&& docker-php-ext-install zip \
# Install zlib
#&& docker-php-ext-install zlib
# Install gd
&& apt-get install -y libfreetype6-dev libpng-dev libjpeg-dev libwebp-dev libxpm-dev \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include \
  --with-png-dir=/usr/include --with-xpm-dir=/usr/include --with-webp-dir=/usr/include \
&& docker-php-ext-install gd \
&& apt-get purge -y libfreetype6-dev libpng-dev libjpeg-dev libwebp-dev libxpm-dev \
# Install simplexml
#&& docker-php-ext-install simplexml
# Install spl
#&& docker-php-ext-install spl
# Install pcre
#&& docker-php-ext-install pcre
# Install dom
#&& docker-php-ext-install dom
# Install xml
#&& docker-php-ext-install xml
# Install intl
&& apt-get install -y libicu-dev \
&& docker-php-ext-configure intl \
&& docker-php-ext-install intl \
&& apt-get purge -y libicu-dev \
# Install json
#&& docker-php-ext-install json
# Install hash
#&& docker-php-ext-install hash
# Install XSL
&& apt-get install -y libxslt-dev \
&& docker-php-ext-install xsl \
&& apt-get purge -y libxslt-dev \
# Install mysqli
&& docker-php-ext-install mysqli \
# Install pdo_mysql
&& docker-php-ext-install pdo_mysql \
# Install ldap
&& apt-get install -y libldap2-dev \
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu \
&& docker-php-ext-install ldap \
&& apt-get purge -y libldap2-dev \
# Purge none required header packages and clean it up in order to free some space.
&& apt-get purge -y build-essential zlib1g-dev && apt-get clean -y \
# Enable Apache2 modules
&& a2enmod rewrite \
&& curl -sS https://getcomposer.org/installer \
  | php -- --install-dir=/usr/local/bin --filename=composer \
# Oracle instantclient
# unzip them
&& unzip /tmp/instantclient-basic-linux.x64-12.1.0.2.0.zip -d /usr/local/ \
    && unzip /tmp/instantclient-sdk-linux.x64-12.1.0.2.0.zip -d /usr/local/ \
# Remove the unnecessary zips
&& rm /tmp/*.zip \
# install pecl
&& curl -O http://pear.php.net/go-pear.phar \
    ; /usr/local/bin/php -d detect_unicode=0 go-pear.phar \
# Prepare oci8
&& ln -s /usr/local/instantclient_12_1 /usr/local/instantclient \
    && ln -s /usr/local/instantclient/libclntsh.so.12.1 /usr/local/instantclient/libclntsh.so \
# Install the OCI8 PHP extension
&& echo 'instantclient,/usr/local/instantclient' | pecl install -f oci8-2.0.8 \
&& echo "extension=oci8.so" > /usr/local/etc/php/conf.d/oci8.ini \\
# Fix server date timezone to UTC
&& echo "date.timezeon = UTC" > /usr/local/etc/php/conf.d/datetimezone.ini

# Set up the Oracle environment variables
ENV LD_LIBRARY_PATH /usr/local/instantclient/
ENV ORACLE_HOME /usr/local/instantclient/
ENV TNS_ADMIN /usr/local/instantclient/
ENV ORACLE_BASE /usr/local/instantclient/
ENV NLS_LANG AMERICAN_AMERICA.WE8ISO8859P1

WORKDIR /var/www/html
Docker Pull Command
Owner
sred