Q: 利用docker-compose编排时 file not found [是根据这个仓库学习的 link]

A: 由于没有按照顺序来放 - ./wwwroot:/home/wwwroot 这个要放在php服务下

        volumes:
            - ./services/php/cron:/etc/cron.d
            - ./services/php/supervisor:/etc/supervisor/conf.d
            - ./wwwroot:/home/wwwroot

参考答案

Q: alpine安装PHP扩展

A: [1] 示例Dockerfile [2] 进入容器内

Q: php-alpine安装GD库

A: <更多>

FROM php:7-fpm-alpine
RUN apk add --no-cache freetype libpng libjpeg-turbo freetype-dev libpng-dev libjpeg-turbo-dev && \
  docker-php-ext-configure gd \
    --with-gd \
    --with-freetype-dir=/usr/include/ \
    --with-png-dir=/usr/include/ \
    --with-jpeg-dir=/usr/include/ && \
  NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) && \
  docker-php-ext-install -j${NPROC} gd && \
  apk del --no-cache freetype-dev libpng-dev libjpeg-turbo-dev

Q: php-alpine安装zip库

A:<更多>

RUN apk add docker-php-ext-configure --with-zlib-dir=/usr && docker-php-ext-install zip

参考镜像

alpine 制作LNMP

ubuntu制作LNMP

results matching ""

    No results matching ""