News > May updates: MySQL 8.0, Alpine changes

May 2nd, 2017

A few minor updates:

  • MySQL 8.0 was released recently, we now support it as default for MySQL installations
  • Switched more containers to official Alpine images where available
  • Some background on why we continue offering our own PHP base images

 

Alpine images and PHPDocker.io base images

A question that repeats regularly from users of PHPDocker.io is why aren't we using official alpine images for everything. When I started off PHPDocker over a year ago, most official images did not offer Alpine builds and were based usually on Debian Jessie. Upstream breakage was happening on a weekly basis leaving users with broken environments, and Alpine itself had serious issues with DNS resolution due to underlying issues with uclibc. I decided then to stabilise things for our own users by building our own base images, based on Debian Jessie.

A year and a half later, the panorama is very different. Most official apps now offer Alpine builds, and Alpine has fixed itself up to the point that it's a viable way to run applications on top of. Thus, I've slowly been replacing all container images with their official Alpine builds where available. I have finalised this transition with the last release of the site.

The old phpdockerio/* container images still exist on Docker Hub, and are automagically built every so often, so your existing environments will work for the foreseeable.

How about the PHP base image? Why not switch to the official PHP images?

I have decided to continue offering our own PHP images, based on Debian Jessie (for PHP5 and 7.0) and Ubuntu (PHP 7.1) for the foresseable. Why not use the official images? This is something I get asked a lot. The reason is simplicity. If you've used at some point the official PHP images, you've probably noticed all extensions need to be compiled via a tool they provide. Not only that, this tool is essentially a wrapper around phpize and doesn't deal with the build dependencies required to compile that given extension. Do you want pdo_mysql? You need libmysqlclient-dev. Do you need ImageMagick? The list of dev dependencies is even bigger. Maintaining a list of dev-dependencies, and binary libraries (which need to be installed via apt) on a per-extension basis is a great deal of work, as each extension needs to be tested manually to track down which dev packages they require. Not only that, some of these are optional, and missing them out means certain functionality is not available through the extension. Every now and again, extensions evolve and require even newer dev dependencies. Once these are worked out, per extension, they need installing via apt anyway, the PHP extension compiled, then uninstalled afterwards every time the php image needs rebuilding. In addition to this, compilation of these extensions can be rather time consuming, especially on platforms that do not run docker natively (macOS and Windows - these run under OS provided virtualisation technology).

Now multiply this by two, since that only covers extensions distributed with PHP's sources. PECL extensions are distributed separately and have their own dependencies, which are not always resolvable in Debian Jessie (PHP official's base) and for which you need to devise alternative means of installation.

This became clear rather early on PHPDocker.io's development, so I decided initially to maintain the Debian Jessie core and add PHP 7.0 via dotdeb packages. These packages were backported from Debian Unstable, packages provided by our good man Ondřej Surý to Debian in the first place. Starting with PHP 7.1, we switched to Ubuntu 16.04 and Ondřej's PPA. All that work is already done for us by the very same maintainer of PHP on Debian, simplifying and speeding up container builds and generally making my life, and yours, a lot easier.

If you'd like to know what goes into the base images your containers build on top of, head off to PHPDocker.io's base image repository and have a quick look at the Dockerfiles.

Comments

Thank you for all the work, we use this all the time at work, as a base for our development environments as well as for deploying our apps.
Quick question, are phpdocker php images are good for production?
You should be good to go on production with these base images if you wish, as a base to build your containers with.

Leave a reply