Skip to content

WordPress Docker Official Image

Anthony Fok edited this page Mar 23, 2022 · 1 revision

Understanding the wordpress:5.8-php7.4 Docker image for RiskProfiler

How it works

cd latest/php7.4/apache
docker build .

According to Dockerfile, WordPress itself is fetched as a tarball using curl, and extracted into /usr/src/wordpress.

According to docker-entrypoint.sh, at runtime:

  • if neither index.php nor wp-includes/version.php exists, then /usr/src/wordpress/.htaccess and /usr/src/wordpress/wp-content/// are copied over to /var/www/html
  • if wp-config.php does not exist, it is somehow generated from wp-config-docker.php which allows reading variables, I guess?

Trivia

  • PHP 7.4 is the default version because it is defined in generate-stackbrew-library.sh as defaultPhpVersion='php7.4' per upstream's updated recommendation at https://wordpress.org/about/requirements/, see commit cc4ec5941e2b5dddda488c507b636ac68ce54100

  • This WordPress Docker image is largely maintained by fellow Debian developer Tianon Gravi (@tianon)! So talented! And what a small world after all!