Docker pull mysql v mysql/mysql

By | November 15, 2020

Have you ever read articles where sometimes you see the docker command

docker pull mysql/mysql-server

and sometimes

docker pull mysql

and thought to yourself what is the difference?

You can find out the difference by going to Docker Hub at: https://hub.docker.com/r/mysql/mysql-server v https://hub.docker.com/_/mysql

Firstly, mysql is labeled the “official image” with over 1 billion downloads.

The mysql/mysql-server is an “Optimized MySQL Server Docker images. Created, maintained and supported by the MySQL team at Oracle”.

There is also a warning on the Oracle version stating that:

The MySQL Docker images maintained by the MySQL team are built specifically for Linux platforms. Other platforms are not supported, and users using these MySQL Docker images on them are doing so at their own risk. See the discussion here for some known limitations for running these containers on non-Linux operating systems.

Basically if you are using a non Linux platform, it is safer to go with the official image.

If you look deeper at the Docker files, you’ll find that the “official” image Docker file is based on Debian and Oracle’s image Docker file based on Oracle Linux.

Apparently the Oracle’s version is a fork of the official one with changes to the base image.

The documentation from the official image is much more detailed but the image is slightly larger coming in at 545.28MB v 405.01MB as can be seen from the Docker dashboard below.

One of the reasons why this can get confusing is when you start following articles on how to get MySQL running in Docker, you articles like this one that uses the Oracle version and runs the Docker command without setting the password like this:

docker run --name=[container_name] -d mysql/mysql-server:latest

Then you look at the docs for the official image and you see the command as:

docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:tag

Without understanding the differences, you’ll easily get confused.

Leave a Reply

Your email address will not be published.