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"]
网友评论