Skip to content

Instantly share code, notes, and snippets.

@zz
Last active March 19, 2018 05:44
Show Gist options
  • Save zz/e48067228c5e3f674d7156ca2ab5cb6e to your computer and use it in GitHub Desktop.
Save zz/e48067228c5e3f674d7156ca2ab5cb6e to your computer and use it in GitHub Desktop.
Dockerfile for PHP7 memcache and Redis ext and zmq https://hub.docker.com/r/zhuzhu/php/
FROM php:7.1-fpm
ENV LIBEVENT_VERSION=2.0.22
RUN apt-get -y update && \
apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev \
libpng12-dev libmemcached-dev libmysqlclient-dev libicu-dev libcurl4-nss-dev \
libzmq-dev libpq-dev libyaml-dev zlib1g-dev \
curl git wget netcat && \
rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install iconv mcrypt && \
docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \
docker-php-ext-install gd && \
docker-php-ext-install curl && \
docker-php-ext-install mbstring && \
docker-php-ext-install mysqli && \
docker-php-ext-install pdo_mysql && \
docker-php-ext-install intl && \
docker-php-ext-install pdo_pgsql && \
docker-php-ext-install bcmath && \
docker-php-ext-install pcntl sockets && \
pecl install zmq-beta && \
docker-php-ext-enable zmq && \
curl -L -o /tmp/memcached.tar.gz "https://github.com/php-memcached-dev/php-memcached/archive/php7.tar.gz" && \
mkdir -p /usr/src/php/ext/memcached && \
tar -C /usr/src/php/ext/memcached -zxvf /tmp/memcached.tar.gz --strip 1 && \
docker-php-ext-configure memcached && \
docker-php-ext-install memcached && \
rm /tmp/memcached.tar.gz && \
mkdir -p /usr/src/php/ext/redis && \
curl -L https://github.com/phpredis/phpredis/archive/3.0.0.tar.gz | tar xvz -C /usr/src/php/ext/redis --strip 1 && \
echo 'redis' >> /usr/src/php-available-exts && \
docker-php-ext-install redis && \
cd /tmp && \
curl -L 'https://github.com/EasyFreeHost/pecl-memcache/archive/81b1267413662dfc276f4530122cd1e7aba5c1fc.tar.gz' | tar xz && \
cd pecl-memcache-81b1267413662dfc276f4530122cd1e7aba5c1fc && \
phpize && \
./configure && make && make install && cd .. && rm -Rf pecl-memcache-81b1267413662dfc276f4530122cd1e7aba5c1fc && \
docker-php-ext-enable memcache && \
wget https://github.com/libevent/libevent/releases/download/release-$LIBEVENT_VERSION-stable/libevent-$LIBEVENT_VERSION-stable.tar.gz && \
tar -xvzf libevent-$LIBEVENT_VERSION-stable.tar.gz && rm *.gz && cd libevent-$LIBEVENT_VERSION-stable && \
./configure && make && make install && pecl install event && echo "extension=event.so" > /usr/local/etc/php/conf.d/event.ini && \
pecl install ev && docker-php-ext-enable ev && \
pecl install yaml-2.0.0 && docker-php-ext-enable yaml && \
git clone --depth=1 git://github.com/phalcon/cphalcon.git && \
cd cphalcon/build && ./install && docker-php-ext-enable phalcon && \
rm -rf /tmp/*
RUN /bin/sh -c echo "Asia/Shanghai" > /etc/timezone; dpkg-reconfigure -f noninteractive tzdata
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment