MySQL in Dockerland

Around 18 months ago, we launched the first MySQL Linux package repos, marking an important milestone in our efforts to modernize and improve the way we package and deliver MySQL products to our user community. MySQL product development had gone through radical improvements in terms of quality, dependability and sheer output, but the way we delivered those products had quite frankly fallen way behind.

Now, with our repo offerings rapidly maturing, we have started looking at other new distribution and deployment technologies. We’re investigating how we can help make Puppet an even better tool for MySQL infrastructure deployment, we’re playing around with Ubuntu Snappy Core packaging of MySQL, and not least: we’re working as part of the Docker community to help make sure that the community maintained MySQL Docker images continue to be as wildly popular as they are now.

MySQL on Docker

whale-dolphin
>> Video: Whales and dolphins have been observed in playful company

The basic principle of Docker is extremely attractive: We can offer you a pre-configured image of a MySQL installation, and you can go from a blank system to a ready-to-use MySQL instance answering on port 3306 with one simple command line in the time it takes to finish a cup of coffee. Real world mileage may of course vary, but the core fact is that Docker can be a very useful alternative for many users and developers who deploy and run MySQL, either as part of a larger container based application infrastructure or as a general database service. And this is something that many of you have discovered: By early May of this year, the community maintained MySQL images had been pulled more than 4 million times. Basically: During its relatively brief existence, Docker has become an important way for many of our users to run MySQL.

MySQL and the Docker Community

When we started our adventure in Dockerland, we quickly discovered that it is in some ways quite similar to the Linux communities that we are working with: a large collection of people who are passionate about the underlying technology and the myriad uses it can be put to, and who are willing to put a lot of effort into building and improving stuff. And this is what we are gearing up to support: We want to help ensure that MySQL on Docker is as robust, easy to set up and well supported as possible.

As part of this, we’re also rolling our own, optimized Docker images. That allows us to take MySQL on Docker in some new directions, and lets us implement changes and improvements that may also be of value in the community maintained MySQL images. We will treat this as a regular release channel for MySQL Server, which means that we will apply a rigorous QA process and publish new images as part of our regular flow of update releases. We are seeing considerable interest in these images, and we’d like to say thank you to everyone who’ve taken them out for a spin.

For the community maintained images, our primary contribution so far has been revamped and much expanded documentation which aims to make MySQL deployment with Docker a more approachable task. Coming into Dockerland as relative newbies entailed climbing a learning curve that we’ve hopefully now made slightly less steep for others. We’ve also helped keep the images in sync with changes in the MySQL 5.7 development release series, and we have several other pull requests being queued up for discussion and possible inclusion into the community images.

How Docker improves MySQL

On the MySQL side, working with Docker has uncovered some areas that could use improvement. Our initialization on first startup is improving a lot in the upcoming MySQL 5.7, but we have more work to do in order to smoothly support the way Docker does things. The ability to set a far greater range of MySQL configuration parameters during runtime would also make MySQL run better inside Docker containers. Happily, we’re putting those things onto our engineering road map, so keep watching our development releases, and you should see improvements appearing.

Using Docker for Previewing and Testing MySQL

This brings us to another great use for Docker images, besides running regular production MySQL instances: testing out development releases in an isolated setting, alongside any other MySQL instances you may have running on your system. MySQL development milestone releases are of course available, and today we’re adding another image flavor: a so called MySQL Labs release. Labs releases are what we use when we have something experimental or particularly interesting to show the MySQL community in order to get very early feedback. The latest Labs release is based on the recent 5.7.7 development milestone and introduces a new data type for storing JSON data in MySQL tables, along with a range of new functions to access and manipulate JSON documents. The Docker image for this release is available in the MySQL Labs area on Docker Hub now, or for the very eager:

docker run --name my-container-name -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql/mysql-labs:5.7.7-json

Try it out and let us know what you think!

That was a whirlwind tour of what we’re doing with Docker and other new deployment and runtime environments these days. We’d be delighted to hear from you if you have ideas or suggestions for us. Please drop us a line in the comments section below, comment on our main page on Docker Hub, or in cause you (gasp) encounter issues: file a bug in the MySQL bug database.

Yngve Svendsen

About Yngve Svendsen

Yngve Svendsen has been part of the MySQL organization since 2008. Based in Trondheim, Norway, he is Senior Director of MySQL Engineering Services and responsible for Release Engineering, QA and development lab IT services for the MySQL org at Oracle. Back in the mists of time he majored in mathematics before the dot com wave swept him into the devops field, first at the database startup company Clustra Inc. and then for Sun Microsystems. In 2005 he joined the Dark Side by becoming a manager in Sun's Database Group which was merged into the MySQL org when Sun acquired MySQL in 2008.

4 thoughts on “MySQL in Dockerland

Leave a Reply

Your email address will not be published. Required fields are marked *

Please enter * Time limit is exhausted. Please reload the CAPTCHA.