I apologise if this is a duplicate, but none of the already posted question’s answers helped me.
Recently, the Dockerfile for our php5.6-apache
doesn’t want to build anymore. The line where it fails is when imagick
is trying to be installed via pecl
.
# Enable imagick
RUN apt-get update && apt-get install -y libmagickwand-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
RUN yes '' | pecl install -vvv imagick-beta
Running this line fails due to the following error:
> [12/25] RUN yes '' | pecl -vvv install imagick-beta:
#0 1.354
#0 1.354 Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages:
#0 1.354 error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in PEAR/Proxy.php on line 183
#0 1.355
#0 1.355 Warning: fsockopen(): Failed to enable crypto in PEAR/Proxy.php on line 183
#0 1.357
#0 1.357 Warning: fsockopen(): unable to connect to ssl://pecl.php.net:443 (Unknown error) in PEAR/Proxy.php on line 183
#0 1.359 No releases available for package "pecl.php.net/imagick"
#0 1.360 Cannot initialize 'channel://pecl.php.net/imagick-beta', invalid or missing package file
#0 1.362 Package "channel://pecl.php.net/imagick-beta" is not valid
#0 1.366 install failed
------
failed to solve: process "/bin/sh -c yes '' | pecl -vvv install imagick-beta" did not complete successfully: exit code: 1
The only recent post I found about someone having the same issue is this bug report but I’m not sure about the channel where I’d see any updates on fixing this bug. In the bug report the last person states the following:
Certificate expiry is set to yesterday. I’m thinking about all docker build pipelines currently failing all over the world <3
Does he mean about php.net
‘s SSL certificate? Because when I checked it it looks valid so I don’t understand why it can not connect.
line 183 of PEAR/proxy.php
is the following:
$fp = @fsockopen($host, $port, $errno, $errstr);
So if I understand correctly, the docker container can not establish a proper connection via pecl.php.net:443
? Has anyone encountered the same issue?
Thanks in advance for any (constructive) answers!
2
Answers
As I see it indicates that the
SSL
certificate verification failed, to fix it you can try disabling SSL certificate verification in the Dockerfile by adding this line before thepecl
install command!or you can also updating the
SSL
certificate forpecl.php.net
good luck!
I was able to get around this problem by installing the packages directly from the project’s git repository.