在php5-fpm-alpine docker容器中安装php-gd依赖于alpine linux

前端之家收集整理的这篇文章主要介绍了在php5-fpm-alpine docker容器中安装php-gd依赖于alpine linux前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
试图在docker中的alpine linux上安装GD依赖项.

我正在构建PHP5-fpm-alpine图像.

FROM PHP:5-fpm-alpine
RUN docker-PHP-ext-install MysqLi
RUN apk upgrade --update && apk add \
        libfreetype6-dev \
        libjpeg62-turbo-dev \
        libmcrypt-dev \
        libpng12-dev \
    && docker-PHP-ext-install -j$(nproc) mcrypt \
    && docker-PHP-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
    && docker-PHP-ext-install -j$(nproc) gd

我收到错误

ERROR: unsatisfiable constraints:
  libfreetype6-dev (missing):
    required by: world[libfreetype6-dev]
  libjpeg62-turbo-dev (missing):
    required by: world[libjpeg62-turbo-dev]
  libpng12-dev (missing):
    required by: world[libpng12-dev]

我对高山发行的经验有限.它似乎不是很受欢迎,ergo信息很少或根本没有通过谷歌.

docker hub示例中的软件包名称适用于debian版本.你必须使用alpine的包裹.您可以在这里搜索高山包裹: https://pkgs.alpinelinux.org/packages.

以下应该有效:

FROM PHP:5-fpm-alpine
RUN docker-PHP-ext-install MysqLi
RUN apk upgrade --update && apk add \
  coreutils \
  freetype-dev \
  libjpeg-turbo-dev \
  libltdl \
  libmcrypt-dev \
  libpng-dev \
&& docker-PHP-ext-install -j$(nproc) iconv mcrypt \
&& docker-PHP-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-PHP-ext-install -j$(nproc) gd

猜你在找的PHP相关文章