|
@@ -78,12 +78,6 @@ $ docker run --name some-%%REPO%% -v /my/custom:/etc/mysql/conf.d -e MYSQL_ROOT_
|
|
|
|
|
|
This will start a new container `some-%%REPO%%` where the MariaDB instance uses the combined startup settings from `/etc/mysql/my.cnf` and `/etc/mysql/conf.d/config-file.cnf`, with settings from the latter taking precedence.
|
|
|
|
|
|
-Note that users on host systems with SELinux enabled may see issues with this. The current workaround is to assign the relevant SELinux policy type to your new config file so that the container will be allowed to mount it:
|
|
|
-
|
|
|
-```console
|
|
|
-$ chcon -Rt svirt_sandbox_file_t /my/custom
|
|
|
-```
|
|
|
-
|
|
|
### Configuration without a `cnf` file
|
|
|
|
|
|
Many configuration options can be passed as flags to `mysqld`. This will give you the flexibility to customize the container without needing a `cnf` file. For example, if you want to change the default encoding and collation for all tables to use UTF-8 (`utf8mb4`) just run the following:
|
|
@@ -158,12 +152,6 @@ The Docker documentation is a good starting point for understanding the differen
|
|
|
|
|
|
The `-v /my/own/datadir:/var/lib/mysql` part of the command mounts the `/my/own/datadir` directory from the underlying host system as `/var/lib/mysql` inside the container, where MySQL by default will write its data files.
|
|
|
|
|
|
-Note that users on host systems with SELinux enabled may see issues with this. The current workaround is to assign the relevant SELinux policy type to the new data directory so that the container will be allowed to access it:
|
|
|
-
|
|
|
-```console
|
|
|
-$ chcon -Rt svirt_sandbox_file_t /my/own/datadir
|
|
|
-```
|
|
|
-
|
|
|
## No connections until MySQL init completes
|
|
|
|
|
|
If there is no database initialized when the container starts, then a default database will be created. While this is the expected behavior, this means that it will not accept incoming connections until such initialization completes. This may cause issues when using automation tools, such as `docker-compose`, which start several containers simultaneously.
|