使用Dockerfile构建Swoole+php7环境

FROM php:7.2.7-cli

RUN apt-get update \
    && apt-get install -y libmemcached-dev zlib1g-dev
    
RUN pecl install redis-4.0.1 \
    && pecl install swoole-4.0.1 \
    && pecl install memcached-3.0.4 \
    && pecl install xdebug-2.6.0 \
    && docker-php-ext-enable redis swoole memcached xdebug
    
COPY . /usr/src/myapp
WORKDIR /usr/src/myapp
CMD [ "php", "-m" ]

构建完环境后,使用方法见:https://blog.haohtml.com/archives/17925