Mysql – How to tune MariaDB/MySQL in a docker container


I understand that it's easy to get a MariaDB docker container up and running, and using nsenter to edit config files is possible. But how can I tune the config files in this container, e.g. the official MariaDB image, in a docker way? That is, the config would not be lost after upgrading the container, or affected by most container operations.

Best Answer

Create the container as

docker run -d -v /path/to/my/config:/etc/mysql

The config files would be on the host.