service
docker service create --name test_mysql \
--env MYSQL_ROOT_PASSWORD=8NTVs5enkH7byuQS \
--config source=mysql.cnf,target=/etc/mysql/my.cnf \
mysql:8.4.0
config: mysql.cnf
errorLog
2024-06-12 15:03:50+08:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.0-1.el8 started.
2024-06-12 15:03:50+08:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2024-06-12 15:03:50+08:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.0-1.el8 started.
ls: cannot access '/docker-entrypoint-initdb.d/': Operation not permitted
info
Kernel Version: 3.10.0-957.el7.x86_64
CentOS Linux release 7.6.1810 (Core)
Docker Version: Server Version: 19.03.8
QA
When I remove --config, it can start normally. After adding it, even if mysql.cnf does not have any configuration, it cannot start.
Tried both mysql:8.4.0 and 8.4.0-oraclelinux8, same problem.
This problem was not discovered when some servers were deployed, but this problem was discovered when this older server was deployed.