title: docker php7.2-fpm can't install imap module
body: <p>I'm having problems trying to get imap working with my docker-compose.</p>
  
  <p>Here is what my php dockerfile looks like.</p>
  
  <pre><code>FROM php:7.2-fpm
  
  RUN apt-get update &amp;&amp; \
    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 \
      &amp;&amp; pecl install imagick \
      &amp;&amp; docker-php-ext-enable imagick \
      &amp;&amp; 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
  </code></pre>
  
  <p>But I keep getting the error </p>
  
  <pre><code>Call to undefined function imap_open()
  </code></pre>
  
  <p>I've been trying a lot of different ways of getting the imap to work, but nothing seems to be working for me. I need to keep using php7.2 so downgrading to php5 is not an option for me. </p>
  
  <p>My ideal outcome is to keep the current php version of fpm and find a nice solution to get imap working with the current dockerfile.</p>
  
  <p>Adding </p>
  
  <pre><code>Docker-php-ext-install imap 
  </code></pre>
  
  <p>inside the dockerfile does not seem to work and result with the following error: </p>
  
  <pre><code>configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.
  </code></pre>