Skip to content

Instantly share code, notes, and snippets.

@ebuildy
Created January 25, 2016 10:25
Show Gist options
  • Save ebuildy/ba6820cbe1befaa229d2 to your computer and use it in GitHub Desktop.
Save ebuildy/ba6820cbe1befaa229d2 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
@zoombieuit
Copy link

Thanks you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment