Skip to content

Dockerfile fails when installing imap : OpenSSL Library not found #924

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nanoninja opened this issue Dec 13, 2019 · 2 comments
Closed

Dockerfile fails when installing imap : OpenSSL Library not found #924

nanoninja opened this issue Dec 13, 2019 · 2 comments
Labels
question Usability question, not directly related to an error with the image

Comments

@nanoninja
Copy link

Hi,

I tried to build my php-fpm image but it fails when installing the imap extension with openssl.
No problem with versions lower than php 7.4.

There is no longer an error when I comment on the line relating to imap. The path to the openssl library was not found.

If anyone had an idea, it would be nice.

Dockerfile :

FROM php:7.4.0-fpm

LABEL maintainer="John Doe <[email protected]>"

RUN apt-get update && apt-get upgrade -y \
    && apt-get install -y \
    g++ \
    libbz2-dev \
    libc-client-dev \
    libcurl4-gnutls-dev \
    libedit-dev \
    libfreetype6-dev \
    libicu-dev \
    libjpeg62-turbo-dev \
    libkrb5-dev \
    libldap2-dev \
    libmagickwand-dev \
    libmcrypt-dev \
    libmemcached-dev \
    libpq-dev \
    libsqlite3-dev \
    libssl-dev \
    libreadline-dev \
    libkrb5-dev \
    libxslt1-dev \
    libzip-dev \
    memcached \
    wget \
    unzip \
    zlib1g-dev \
    && docker-php-ext-configure gd \
    --with-freetype-dir=/usr/include/ \
    --with-jpeg-dir=/usr/include/ \
    --with-png-dir=/usr/include/ \
    && docker-php-ext-install -j$(nproc) gd \
    && docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
    && docker-php-ext-install -j$(nproc) imap \
    && docker-php-ext-configure intl \
    && docker-php-ext-install -j$(nproc) intl \
    && docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \
    && docker-php-ext-install ldap \
    && docker-php-ext-install -j$(nproc) \
    bcmath \
    bz2 \
    calendar \
    exif \
    gettext \
    mysqli \
    opcache \
    pdo_mysql \
    pdo_pgsql \
    pgsql \
    soap \
    sockets \
    xmlrpc \
    xsl \
    && docker-php-ext-configure zip --with-libzip \
    && docker-php-ext-install zip \
    && pecl install xdebug && docker-php-ext-enable xdebug \
    && pecl install memcached && docker-php-ext-enable memcached \
    && pecl install mongodb && docker-php-ext-enable mongodb \
    && pecl install redis && docker-php-ext-enable redis \
    && yes '' | pecl install imagick && docker-php-ext-enable imagick \
    && docker-php-source delete \
    && apt-get remove -y g++ wget \
    && apt-get autoremove --purge -y && apt-get autoclean -y && apt-get clean -y \
    && rm -rf /var/lib/apt/lists/* \
    && rm -rf /tmp/* /var/tmp/*

logs :

Installing shared extensions:     /usr/local/lib/php/extensions/no-debug-non-zts-20190902/
Installing header files:          /usr/local/include/php/
find . -name \*.gcno -o -name \*.gcda | xargs rm -f
find . -name \*.lo -o -name \*.o | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.so | xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
rm -f libphp.la      modules/* libs/*
Configuring for:
PHP Api Version:         20190902
Zend Module Api No:      20190902
Zend Extension Api No:   320190902
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 pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
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 for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-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-20190902
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... no
checking if zts is enabled... no
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... yes
checking for IMAP SSL support... yes
checking for utf8_mime2text signature... new
checking for U8T_DECOMPOSE... yes
checking for pam_start in -lpam... yes
checking for crypt in -lcrypt... yes
checking for krb5-gssapi krb5... yes
configure: error: OpenSSL libraries not found.

      Check the path given to --with-openssl-dir and output in config.log)

Vincent.

@wglambert
Copy link

Duplicate of #891

imap isn't detecting --with-openssl properly, so setting PHP_OPENSSL=yes will workaround that

@wglambert wglambert added the question Usability question, not directly related to an error with the image label Dec 13, 2019
@wglambert
Copy link

I changed out all the --with-...-dir= for #918 and added libldb-dev for ldap libs

FROM php:7.4.0-fpm

LABEL maintainer="John Doe <[email protected]>"

RUN apt-get update && apt-get upgrade -y \
    && apt-get install -y \
    g++ \
    libbz2-dev \
    libc-client-dev \
    libcurl4-gnutls-dev \
    libedit-dev \
    libfreetype6-dev \
    libicu-dev \
    libjpeg62-turbo-dev \
    libkrb5-dev \
    libldap2-dev \
    libldb-dev \
    libmagickwand-dev \
    libmcrypt-dev \
    libmemcached-dev \
    libpq-dev \
    libsqlite3-dev \
    libssl-dev \
    libreadline-dev \
    libkrb5-dev \
    libxslt1-dev \
    libzip-dev \
    memcached \
    wget \
    unzip \
    zlib1g-dev \
    && docker-php-ext-configure gd \
    --with-freetype \
    --with-jpeg \
    && docker-php-ext-install -j$(nproc) gd \
    && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
    && docker-php-ext-install -j$(nproc) imap \
    && docker-php-ext-configure intl \
    && docker-php-ext-install -j$(nproc) intl \
    && docker-php-ext-configure ldap \
    && docker-php-ext-install ldap \
    && docker-php-ext-install -j$(nproc) \
    bcmath \
    bz2 \
    calendar \
    exif \
    gettext \
    mysqli \
    opcache \
    pdo_mysql \
    pdo_pgsql \
    pgsql \
    soap \
    sockets \
    xmlrpc \
    xsl \
    && docker-php-ext-configure zip \
    && docker-php-ext-install zip \
    && pecl install xdebug && docker-php-ext-enable xdebug \
    && pecl install memcached && docker-php-ext-enable memcached \
    && pecl install mongodb && docker-php-ext-enable mongodb \
    && pecl install redis && docker-php-ext-enable redis \
    && yes '' | pecl install imagick && docker-php-ext-enable imagick \
    && docker-php-source delete \
    && apt-get remove -y g++ wget \
    && apt-get autoremove --purge -y && apt-get autoclean -y && apt-get clean -y \
    && rm -rf /var/lib/apt/lists/* \
    && rm -rf /tmp/* /var/tmp/*
$ docker build . -t php:test
Sending build context to Docker daemon  6.144kB
Step 1/3 : FROM php:7.4.0-fpm
 ---> 0203f6c79234
Step 2/3 : LABEL maintainer="John Doe <[email protected]>"
 ---> Using cache
 ---> e005c3dc2450
Step 3/3 : RUN apt-get update && apt-get upgrade -y     && apt-get install -y     g++     libbz2-dev     libc-client-dev     libcurl4-gnutls-dev     libedit-dev     libfreetype6-dev     libicu-dev     libjpeg62-turbo-dev     libkrb5-dev     libldap2-dev     libldb-dev     libmagickwand-dev     libmcrypt-dev     libmemcached-dev     libpq-dev     libsqlite3-dev     libssl-dev     libreadline-dev     libkrb5-dev     libxslt1-dev     libzip-dev     memcached     wget     unzip     zlib1g-dev     && docker-php-ext-configure gd     --with-freetype     --with-jpeg     && docker-php-ext-install -j$(nproc) gd     && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl     && docker-php-ext-install -j$(nproc) imap     && docker-php-ext-configure intl     && docker-php-ext-install -j$(nproc) intl     && docker-php-ext-configure ldap     && docker-php-ext-install ldap     && docker-php-ext-install -j$(nproc)     bcmath     bz2     calendar     exif     gettext     mysqli     opcache     pdo_mysql     pdo_pgsql     pgsql     soap     sockets     xmlrpc     xsl     && docker-php-ext-configure zip     && docker-php-ext-install zip     && pecl install xdebug && docker-php-ext-enable xdebug     && pecl install memcached && docker-php-ext-enable memcached     && pecl install mongodb && docker-php-ext-enable mongodb     && pecl install redis && docker-php-ext-enable redis     && yes '' | pecl install imagick && docker-php-ext-enable imagick     && docker-php-source delete     && apt-get remove -y g++ wget     && apt-get autoremove --purge -y && apt-get autoclean -y && apt-get clean -y     && rm -rf /var/lib/apt/lists/*     && rm -rf /tmp/* /var/tmp/*
 ---> Using cache
 ---> 46a56f6065a8
Successfully built 46a56f6065a8
Successfully tagged php:test

Closing since this is resolved, if you have other questions you could also try asking over at the Docker Community Forums, Docker Community Slack, or Stack Overflow. Since these repos aren't really a user-help forum

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Usability question, not directly related to an error with the image
Projects
None yet
Development

No branches or pull requests

2 participants