Skip to content

Instantly share code, notes, and snippets.

@amitasthana
Forked from ebuildy/Dockerfile
Created April 5, 2017 04:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amitasthana/5fb35b3c26fd089874f8fe3ac3c799f3 to your computer and use it in GitHub Desktop.
Save amitasthana/5fb35b3c26fd089874f8fe3ac3c799f3 to your computer and use it in GitHub Desktop.
Install Php 7 with MongoDB driver on Docker from Ubuntu trusty base image.
FROM ubuntu:trusty
ENV HOME /root
ENV LC_ALL C.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
RUN add-apt-repository ppa:ondrej/php && \
apt-get update
RUN apt-get -y install php7.0-fpm php7.0-mysql php7.0-curl php7.0-mcrypt php7.0-cli php7.0-dev php-pear libsasl2-dev
RUN mkdir -p /usr/local/openssl/include/openssl/ && \
ln -s /usr/include/openssl/evp.h /usr/local/openssl/include/openssl/evp.h && \
mkdir -p /usr/local/openssl/lib/ && \
ln -s /usr/lib/x86_64-linux-gnu/libssl.a /usr/local/openssl/lib/libssl.a && \
ln -s /usr/lib/x86_64-linux-gnu/libssl.so /usr/local/openssl/lib/
RUN pecl install mongodb
RUN echo "extension=mongodb.so" > /etc/php/7.0/fpm/conf.d/20-mongodb.ini && \
echo "extension=mongodb.so" > /etc/php/7.0/cli/conf.d/20-mongodb.ini && \
echo "extension=mongodb.so" > /etc/php/7.0/mods-available/mongodb.ini
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment