Когда я пытался запустить mysql контейнер с изображением mysql / mysql -server: 5.7.17 с изменением my.cnf с использованием параметра runtime --volume, я получал сообщение об ошибке.
[myhome tmp]# docker run -it -v /tmp/mysql/my.cnf:/etc/mysql/my.cnf -e MYSQL_ROOT_PASSWORD=123456 mysql/mysql-server:5.7.17
error: could not run mysql. This could be caused by a misconfigured my.cnf
mysqld: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2 - No such file or directory)
mysqld: [ERROR] Fatal error in defaults handling. Program aborted!
Но когда то же самое я попробовал с mysql: последнее изображение, я смог запустить этот образ:
[myhome tmp]# docker run -it -v /tmp/mysql/my.cnf:/etc/mysql/my.cnf -e MYSQL_ROOT_PASSWORD=123456 mysql
2020-04-11 11:54:21+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.19-1debian10 started.
2020-04-11 11:54:21+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2020-04-11 11:54:21+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.19-1debian10 started.
2020-04-11 11:54:21+00:00 [Note] [Entrypoint]: Initializing database files
2020-04-11T11:54:21.949032Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2020-04-11T11:54:21.949185Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.19) initializing of server in progress as process 40
2020-04-11T11:54:27.882357Z 5 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
2020-04-11 11:54:32+00:00 [Note] [Entrypoint]: Database files initialized
2020-04-11 11:54:32+00:00 [Note] [Entrypoint]: Starting temporary server
mysqld will log errors to /var/lib/mysql/fc326f61d85d.err
mysqld is running as pid 92
2020-04-11 11:54:33+00:00 [Note] [Entrypoint]: Temporary server started.
Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it.
2020-04-11 11:54:38+00:00 [Note] [Entrypoint]: Stopping temporary server
2020-04-11 11:54:41+00:00 [Note] [Entrypoint]: Temporary server stopped
2020-04-11 11:54:41+00:00 [Note] [Entrypoint]: MySQL init process done. Ready for start up.
2020-04-11T11:54:41.972267Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2020-04-11T11:54:41.972310Z 0 [Warning] [MY-010097] [Server] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
2020-04-11T11:54:41.972376Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.19) starting as process 1
2020-04-11T11:54:42.834746Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2020-04-11T11:54:42.838151Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2020-04-11T11:54:42.872638Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.19' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server - GPL.
2020-04-11T11:54:42.992548Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/var/run/mysqld/mysqlx.sock' bind-address: '::' port: 33060
mbind: Operation not permitted
my.cnf
[mysqld]
pid-file=/var/run/mysqld/mysqld.pid
socket=/var/run/mysqld/mysqld.sock
datadir=/var/lib/mysql
secure-file-priv=""
server-id=100
user=mysql
symbolic-links=0
!includedir /etc/mysql/conf.d/
Пожалуйста, помогите меня .. Почему поведение обоих изображений не одинаково.