Skip to content

Commit

Permalink
build(containers/wordpress) correct comparison for PHP 7.4 version
Browse files Browse the repository at this point in the history
  • Loading branch information
lucatume committed Aug 15, 2023
1 parent 2cb8f76 commit d80c61e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions containers/wordpress/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ COPY ./php.ini /usr/local/etc/php/conf.d/999-slic.ini
ADD https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar /usr/local/bin/wp
RUN chmod a+rx /usr/local/bin/wp

# If PHP_VERSION is 7.4, the use wp-cli to update wordpress to version 6.2.
# No image is available for wordpress 6.2 with PHP 7.4: this works around the issue.
RUN if [ "${PHP_VERSION}" = "7.4" ]; then \
wp core update --version=6.2 --force; \
# No image for WordPress 6.2+ is available for PHP 7.4.
# If PHP_VERSION is 7.4, update WordPress to 6.2 using wp-cli.
# Weird syntax? POSIX compliant sh.
RUN if echo "${PHP_VERSION}" | grep -q '^7.4'; then \
wp --allow-root --path=/var/www/html core download --version=6.2 --force; \
fi

0 comments on commit d80c61e

Please sign in to comment.