Docker php:7.2-fpm and openssl extension
Março 12, 2018 Deixe um comentário
While running the installation of php 7.2 fpm of docker I ran into the issue caused by the installation of the extension openssl. Using docker-php-ext-install openssl resulted in a error config.m4 not found , I thought there would be a easy way to solve this but no.
I had to create a script based on docker-php-ext-install to just install the openssl extension by moving the mv config0.m4 to config.m4
https://stackoverflow.com/questions/43881834/php-openssl-in-ubuntu
In the Dockerfile where I’m building From php:7.2-ppm
COPY openssl.sh /
RUN chmod 0750 /openssl.sh && cd / && ./openssl.sh
In the openssl.sh file
#!/bin/bash
#!/bin/sh
set -e# prefer user supplied CFLAGS, but default to our PHP_CFLAGS
: ${CFLAGS:=$PHP_CFLAGS}
: ${CPPFLAGS:=$PHP_CPPFLAGS}
: ${LDFLAGS:=$PHP_LDFLAGS}
export CFLAGS CPPFLAGS LDFLAGSsrcExists=
if [ -d /usr/src/php ]; then
srcExists=1
fi
docker-php-source extract
if [ -z “$srcExists” ]; then
touch /usr/src/php/.docker-delete-me
ficd /usr/src/php/ext
pm=’unknown’
if [ -e /lib/apk/db/installed ]; then
pm=’apk’
fiapkDel=
if [ “$pm” = ‘apk’ ]; then
if [ -n “$PHPIZE_DEPS” ]; then
if apk info –installed .phpize-deps-configure > /dev/null; then
apkDel=’.phpize-deps-configure’
elif ! apk info –installed .phpize-deps > /dev/null; then
apk add –no-cache –virtual .phpize-deps $PHPIZE_DEPS
apkDel=’.phpize-deps’
fi
fi
fipopDir=”$PWD”
cd openssl
mv config0.m4 config.m4
[ -e Makefile ] || docker-php-ext-configure openssl
make
make install
find modules \
-maxdepth 1 \
-name ‘*.so’ \
-exec basename ‘{}’ ‘;’ \
| xargs -r docker-php-ext-enable
make clean
cd “$popDir”if [ “$pm” = ‘apk’ ] && [ -n “$apkDel” ]; then
apk del $apkDel
fiif [ -e /usr/src/php/.docker-delete-me ]; then
docker-php-source delete
fi
Deverá estar ligado para publicar um comentário.