Is there any chance of moving the base image to php7 any time soon? It's now the stable version. Shall I submit a PR?
That depends on support and recommendation from upstream (which is likely
contingent on plugin support also). If Wordpress upstream recommends PHP
7, then I think we'd be remiss to _not_ switch, but right now I think PHP 7
is still likely too new for them to be comfortable making the jump right
away (although I could definitely be mistaken).
I would imagine that https://make.wordpress.org/core/tag/php7/ is probably
the right place to watch for upstream's stance, since given their last post
there I'd imagine they'd likely make a new one announcing how exicted they
are to have finally made it. :smile:
What about making an environment variable where we can define the PHP version? -e PHP_VERSION=7.0 which defaults to the recommended one?
Ok, thanks @tianon. Quoting from that post: "WordPress continues to encourage all users to run the latest and greatest versions of PHP, including PHP7 upon its release." But they do also mention they will have to support older versions too.
Making an environment variable seems like a viable option?
The problem with an environment variable is that we'd either have to
download/install different PHP versions on the fly at runtime, or bake
multiple copies into the image itself (which is going to be _really_ large).
Imagine this image layer being included multiple times:
https://github.com/docker-library/docs/blob/0539bf38d214564ab82c387785c665b095b276d6/php/tag-details.md#2acc984c8afd6b75dff809207aaa825cadfcac8daf4ecc13aff14e31fdef9fe5-1
(which is effectively what we're talking about)
That's 152.4 MB additional on-disk size for _each_ version of PHP.
(at least)
docker run --name some-wordpress --link some-mysql:mysql -d wordpress:apache-php7
In this case there are going to be tons of different combinations which is probably not good either
I ended up creating a php7 image with apache for my own use. I published it on the Docker Registry for others to use. It is based on this image and I will do my best to keep it updated when new pull requests are being added to this repo. You can find the image here: https://hub.docker.com/r/ahansson89/wordpress-php7/
ahansson89 I found your docker image https://hub.docker.com/r/ahansson89/wordpress-php7/ very useful. Is there a github location for the Dockerfile? Thanks.
I can't say it's right or even well done, but for the Joomla image, I took the step of using different tags (similar to the Apache/FPM thing) for PHP 5.6 and PHP 7. https://github.com/joomla/docker-joomla/commit/9525cc2871b97f02041c109f1d2bf3fc2be2f419
Is there any way we can get the image from @ahansson89 pulled in? Does someone more familiar have time to do this? I'm not sure I have the time right now to do this. -Mike
There's some really great upstream discussion in https://core.trac.wordpress.org/ticket/36484, especially the following comment (https://core.trac.wordpress.org/ticket/36484#comment:10):
This is remembering that we're talking about the _recommended_ PHP version. The recommended version should be providing an ideal experience for folks, we shouldn't be bumping to a bigger number just because it's there.
Given the PHP 5.6 support timeline, we'll be bumping it by WordPress 4.8 at the latest, so it'd be nice to use those intervening months to ensure the UX for the wider WordPress ecosystem under PHP 7 is solid.
I do think there's probably good cause to add multiple PHP versions here, however, likely similar to something like tomcat (which supports multiple versions of the JRE).
Most helpful comment
I ended up creating a php7 image with apache for my own use. I published it on the Docker Registry for others to use. It is based on this image and I will do my best to keep it updated when new pull requests are being added to this repo. You can find the image here: https://hub.docker.com/r/ahansson89/wordpress-php7/