docker-library / mysql

Docker Official Image packaging for MySQL Community Server
https://dev.mysql.com/
GNU General Public License v2.0
2.42k stars 2.18k forks source link

8.4.0 docker: ls: cannot access '/docker-entrypoint-initdb.d/': Operation not permitted #1067

Open CxistHans opened 2 weeks ago

CxistHans commented 2 weeks ago

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

# only test for empty

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.

tianon commented 2 weeks ago

This is likely seccomp -- you'll want to update Docker, libseccomp2, runc, etc on your host: https://github.com/docker-library/official-images/issues/16829

CxistHans commented 2 weeks ago

@tianon On another CentOS 7 machine, the docker version is the same, the libseccomp version is the same, and the kernel is slightly inconsistent. It is 3.10.0-1062.el7.x86_64. It started normally with 8.4.0-oraclelinux8. Is there any other way to support the deployment of 8.4.0 through docker service?