【发布时间】:2019-03-28 11:05:08
【问题描述】:
这些扩展程序已在 Google App Engine php 容器上预安装并启用:
- APCu
- Bzip2
- 卷曲
- FPM
- GMP
- mbstring
- mcrypt
- 库钠
- 内存缓存
- MySQL(PDO)(使用 mysqlnd)
- MySQLi(使用 mysqlnd)
- OPcache
- OpenSSL
- pcntl
- PostgreSQL
- PostgreSQL (PDO)
- 阅读热线
- 重新编码
- sem
- 套接字
- 邮编
- Zlib
它们使用 php 编译并默认启用(如您在此处看到的 https://github.com/GoogleCloudPlatform/php-docker/blob/master/package-builder/debian/rules.in)
我怎样才能禁用其中的一些呢?例如 MySQL,因为我使用的是 postgres。
到目前为止,这是我的 Dockerfile:
FROM gcr.io/google-appengine/php72:latest
ARG ENABLE_XDEBUG
ARG COMPOSER_FLAGS='--no-scripts --no-dev --prefer-dist'
ENV COMPOSER_FLAGS=${COMPOSER_FLAGS}
RUN apt-get update -y
RUN apt-get install unzip -y
RUN apt-get install autoconf -y
RUN apt-get install build-essential -y
# php-decimal
RUN apt-get install libmpdec-dev -y
RUN pecl install decimal
# Swoole
RUN pecl install swoole-4.2.13
COPY . $APP_DIR
RUN chown -R www-data.www-data $APP_DIR
RUN /bin/bash /build-scripts/move-config-files.sh
RUN /build-scripts/composer.sh;
ENTRYPOINT ["/build-scripts/entrypoint.sh"]
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
# Option to install xdebug
RUN echo "Will enable XDEBUG: $ENABLE_XDEBUG"
RUN if [ "$ENABLE_XDEBUG" = "true" ]; then pecl install xdebug; fi
RUN if [ "$ENABLE_XDEBUG" = "true" ]; then echo "zend_extension=/opt/php72/lib/x86_64-linux-gnu/extensions/no-debug-non-zts-20170718/xdebug.so" >> /opt/php72/lib/php.ini; fi
EXPOSE 8080
【问题讨论】:
标签: php google-app-engine