Hướng dẫn php imap extension is required docker - phần mở rộng php imap là cần có docker

Tôi đang gặp vấn đề khi cố gắng để IMAP làm việc với Docker-Compose của mình.

Đây là những gì PHP Dockerfile của tôi trông như thế nào.

FROM php:7.2-fpm

RUN apt-get update && \
  apt-get install -y \
    curl \
    libmcrypt-dev \
    unzip \
    git 

# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install- 
dir=/usr/local/bin --filename=composer
RUN composer --version

# Set timezone to UTC
RUN rm /etc/localtime
RUN ln -s /usr/share/zoneinfo/UTC /etc/localtime
RUN "date"

RUN apt-get -y install libmagickwand-dev --no-install-recommends \
    && pecl install imagick \
    && docker-php-ext-enable imagick \
    && rm -r /var/lib/apt/lists/*

RUN /usr/local/bin/docker-php-ext-install pdo pdo_mysql

ADD ./scripts/entry.sh /root/init.sh

WORKDIR /var/www/insight

Nhưng tôi tiếp tục gặp lỗi

Call to undefined function imap_open()

Tôi đã thử rất nhiều cách khác nhau để đưa IMAP hoạt động, nhưng dường như không có gì làm việc cho tôi. Tôi cần tiếp tục sử dụng PHP7.2 để hạ cấp xuống PHP5 không phải là một lựa chọn đối với tôi.

Kết quả lý tưởng của tôi là giữ cho phiên bản PHP hiện tại của FPM và tìm một giải pháp tốt đẹp để IMAP làm việc với Dockerfile hiện tại.

Thêm

Docker-php-ext-install imap 

Bên trong Dockerfile dường như không hoạt động và dẫn đến lỗi sau:

configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.

Tệp này chứa văn bản unicode hai chiều có thể được giải thích hoặc biên dịch khác với những gì xuất hiện dưới đây. Để xem xét, hãy mở tệp trong một trình soạn thảo cho thấy các ký tự Unicode ẩn. Tìm hiểu thêm về các ký tự unicode hai chiều

Từ PHP: 5-apache php:5-apache
Chạy cập nhật apt-get && \ apt-get update && \
apt -get install -y \
libc-client-dev libkrb5-dev && \
rm -r/var/lib/apt/list/*
Chạy Docker-php-ext-Configure IMAP--with-kerberos-with-imap-ssl && \ docker-php-ext-configure imap --with-kerberos --with-imap-ssl && \
docker-php-ex-install -j $ (nProc) IMAP

FROM php:5.6-apache
RUN docker-php-ext-install imap

Step 0 : FROM php:5.6-apache
 ---> ae9aedc28129
Step 1 : RUN docker-php-ext-install imap
 ---> Running in 452efdbc7561
+ cd /usr/src/php/ext/imap
+ phpize
Configuring for:
PHP Api Version:         20131106
Zend Module Api No:      20131226
Zend Extension Api No:   220131226
+ ./configure
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr/local
checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20131226
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.13.5 (ok)
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking for IMAP support... yes, shared
checking for IMAP Kerberos support... no
checking for IMAP SSL support... no
checking for utf8_mime2text signature... new
checking for U8T_DECOMPOSE... 
configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.
The command '/bin/sh -c docker-php-ext-install imap mcrypt' returned a non-zero code: 1
Makefile:9: recipe for target 'build' failed
make: *** [build] Error 1