Skip to content

Simplify configuration files tree #390

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
federico-razzoli opened this issue Mar 10, 2018 · 4 comments · Fixed by #680
Closed

Simplify configuration files tree #390

federico-razzoli opened this issue Mar 10, 2018 · 4 comments · Fixed by #680
Labels
Request Request for image modification or feature

Comments

@federico-razzoli
Copy link

A manual inspection to look for an option takes an unreasonable amount of time.

@yosifkit
Copy link
Member

Those are mostly inherited from the mysql packages for Debian; we only add docker.cnf:

mysql/5.7/Dockerfile

Lines 64 to 69 in 30bf2b7

# comment out a few problematic configuration values
&& find /etc/mysql/ -name '*.cnf' -print0 \
| xargs -0 grep -lZE '^(bind-address|log)' \
| xargs -rt -0 sed -Ei 's/^(bind-address|log)/#&/' \
# don't reverse lookup hostnames, they are usually another container
&& echo '[mysqld]\nskip-host-cache\nskip-name-resolve' > /etc/mysql/conf.d/docker.cnf

Most MySQL config can be specified later to override an earlier value:

$ docker run -d -e MYSQL_ROOT_PASSWORD=12345 mysql:5.7 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci

@federico-razzoli
Copy link
Author

This adds complexity, it's extremely error prone and it's hard to automate. It's better to reduce the number of files. But it would be nice if a simpler structure is provided by the image itself.

Ideally, from a user point of view, it would be even nicer to have the same structure in mysql image and mariadb image.

@ltangvald
Copy link
Collaborator

For the older versions, the structure was originally created in Debian because MariaDB also uses "mysql" file paths, so MySQL would have config in /etc/mysql/mysql.conf.d, MariaDB in /etc/mysql/mariadb.conf.d/, and shared options would be in /etc/mysql/conf.d/
So it's legacy of using the standard Debian packages, and I agree it's a bit much for the more self-contained Docker images.

However, the server itself only cares about /etc/mysql/my.cnf, so it's possible to change, and we did for 8.0.
The 8.0 images use the core packages that include no config, so we have a slightly simpler structure:
https://github.com/docker-library/mysql/tree/master/8.0/config

Does that look better to you?

@federico-razzoli
Copy link
Author

Of course, this looks good. It's also very good that you reduced the number of settings in the files.

Any plans to port this to 5.7?

@wglambert wglambert added the Request Request for image modification or feature label Apr 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Request Request for image modification or feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants