Skip to content

Instantly share code, notes, and snippets.

@maxca
Forked from njxqlus/Dockerfile
Created March 28, 2021 16:29
Show Gist options
  • Save maxca/634f3f098d2ce769dd84a125273193ff to your computer and use it in GitHub Desktop.
Save maxca/634f3f098d2ce769dd84a125273193ff to your computer and use it in GitHub Desktop.
PHP + Oracle instantclient dockerfile
FROM php:fpm
# Install packages
RUN apt-get update
RUN apt-get install -y unzip
RUN apt-get install -y libaio1
# Oracle instantclient
ADD instantclient-basic-linux.x64-11.2.0.4.0.zip /tmp/
ADD instantclient-sdk-linux.x64-11.2.0.4.0.zip /tmp/
RUN unzip /tmp/instantclient-basic-linux.x64-11.2.0.4.0.zip -d /usr/local/
RUN unzip /tmp/instantclient-sdk-linux.x64-11.2.0.4.0.zip -d /usr/local/
RUN mv /usr/local/instantclient_11_2 /usr/local/instantclient
RUN ln -s /usr/local/instantclient/libclntsh.so.11.1 /usr/local/instantclient/libclntsh.so
RUN ln -s /usr/local/instantclient/libocci.so.11.1 /usr/local/instantclient/libocci.so
ENV LD_LIBRARY_PATH=/usr/local/instantclient
RUN echo 'instantclient,/usr/local/instantclient' | pecl install oci8
RUN docker-php-ext-configure pdo_oci --with-pdo-oci=instantclient,/usr/local/instantclient
RUN docker-php-ext-install pdo_oci
RUN docker-php-ext-enable oci8
# Composer
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
RUN php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
RUN php composer-setup.php
RUN php -r "unlink('composer-setup.php');"
RUN mv composer.phar /usr/local/bin/composer
RUN composer -V
RUN composer install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment