How to use the proper version of MySQL with docker?

Viewed 522

I am a beginner to Docker. That said, I noted the following which I think is kind of weird.

After executed a docker pull mysql/mysql-server:5.6.23 in console and after I played a little bit with Docker and his getting started tutorial, I started the pulled MySQL v5.6.23 (don't ask me why such an old version) container and I realized that the welcome message was showing the wrong version of MySQL:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.24 MySQL Community Server (GPL)
(...)

Still playing with docker commands, I discovered the following:

$ docker container inspect bde088053099
(...)
         "Config": {
            "Hostname": "bde088053099",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": true,
            "AttachStderr": true,
            "ExposedPorts": {
                "3306/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "MYSQL_ROOT_PASSWORD=root",
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "PACKAGE_URL=https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.24-2.el7.x86_64.rpm"
            ],
            "Cmd": [
                "mysqld"
            ],
            "Image": "mysql/mysql-server:5.6.23",
            "Volumes": {
                "/var/lib/mysql": {}
            },
            "WorkingDir": "",
            "Entrypoint": [
                "/entrypoint.sh"
            ],
            "OnBuild": null,
            "Labels": {}
        },
(...)

The package url is pointing to the next subversion of MySQL instead of the one I am aiming to: "PACKAGE_URL=https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.24-2.el7.x86_64.rpm" though the image name contains the right version number "Image": "mysql/mysql-server:5.6.23".

1 Answers

First, YES, this issue could be reproduced, but with mysql/mysql-server:5.6.23, not mysql:5.6.23. Your description in your post is conflict, please double check.

Next, I think there should be build script issue in oracle team at the period of 5 years ago when doing 5.6x release (E.g. 5.6.24 also not ok), as other version is ok.

So, if you insist to use 5.6.23, I suggest you switch to docker pull mysql:5.6.23 which is ok (NOTE: not docker pull mysql/mysql-server:5.6.23):

$ docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -it mysql:5.6.23 
mysql --version
mysql  Ver 14.14 Distrib 5.6.23, for Linux (x86_64) using  EditLine wrapper

Finally, the difference of above 2 docker hub repo links:

They are all official image, just mysql:5.6.23 based on debian, while mysql/mysql-server:5.6.23 based on oracle linux.

Related