How to install PHP Extensionson SourceGuardian on wordpress docker image? How to install PHP Extensionson SourceGuardian on wordpress docker image? wordpress wordpress

How to install PHP Extensionson SourceGuardian on wordpress docker image?


I update my Wordpress Dockerfile like this:

FROM wordpress:php7.2-apache# Install and enable Source Gaurdian loaderRUN PHP_VERSION=$(php -v | head -n1 | cut -d' ' -f2 | cut -d. -f1-2) \    && mkdir -p /tmp/sourceguardian \    && cd /tmp/sourceguardian \    && curl -Os https://www.sourceguardian.com/loaders/download/loaders.linux-x86_64.tar.gz \    && tar xzf loaders.linux-x86_64.tar.gz \    && cp ixed.${PHP_VERSION}.lin "$(php -i | grep '^extension_dir =' | cut -d' ' -f3)/sourceguardian.so" \    && echo "extension=sourceguardian.so" > /usr/local/etc/php/conf.d/15-sourceguardian.ini \    && rm -rf /tmp/sourceguardian

Now, everything is perfect!