美文网首页Docker
扩展php-fpm官方镜像

扩展php-fpm官方镜像

作者: Rakutens | 来源:发表于2019-06-18 17:45 被阅读0次

    php的官方镜像经常少东西,想要连个数据库什么的真不方便,没办法只有自己建一个啦

    For Alpine:

    Dockerfile-pdo
    FROM php:5.6-fpm-alpine
    RUN apk update && apk add -y zlib zlib-dev \
    && docker-php-ext-install mysqli pdo pdo_mysql \
    && apk add --no-cache mysql-client
    
    CMD ["php-fpm"]
    
    Dockerfile-memcache
    FROM php:5.6-fpm-alpine
    RUN apk update && apk add -y zlib zlib-dev
    RUN apk add --update --no-cache --virtual .build-deps autoconf build-base \
    && pecl install memcache \
    && docker-php-ext-enable memcache \
    && apk del .build-deps \
    && rm -rf /usr/share/man /tmp/* /var/cache/apk/*
    CMD ["php-fpm"]
    
    Dockerfile-pdo-memcache
    FROM php:5.6-fpm-alpine
    RUN apk update && apk add -y zlib zlib-dev
    RUN apk add --update --no-cache --virtual .build-deps autoconf build-base \
    && pecl install memcache \
    && docker-php-ext-enable memcache \
    && apk del .build-deps \
    && rm -rf /usr/share/man /tmp/* /var/cache/apk/*
    RUN docker-php-ext-install pdo pdo_mysql
    RUN apk add --no-cache mysql-client
    RUN apk add --no-cache bash
    
    CMD ["php-fpm"]
    

    For Debian:

    Dockerfile-memcache
    FROM php:7-fpm-stretch
    RUN apt-get update && apt-get install -y zlib zlib-devel
    RUN pecl install memcache \
    && docker-php-ext-enable memcache
    CMD ["php-fpm"]
    

    相关文章

      网友评论

        本文标题:扩展php-fpm官方镜像

        本文链接:https://www.haomeiwen.com/subject/uahqqctx.html