I'm using docker-compose v 1.27 and Docker v 19.03. I have this in my docker-compose.yml file ...
version: '3'
services:
mysql:
restart: always
image: mysql:8.0
cap_add:
- SYS_NICE # CAP_SYS_NICE
environment:
MYSQL_DATABASE: 'directory_data'
# So you don't have to use root, but you can if you like
MYSQL_USER: 'root'
# You can use whatever password you like
MYSQL_PASSWORD: 'password'
# Password for root access
MYSQL_ROOT_PASSWORD: 'password'
MYSQL_ROOT_HOST: '%'
ports:
- "3406:3306"
volumes:
- my-db:/var/lib/mysql
- ./mysql/mysqlconf:/etc/mysql/conf.d
command: ['mysqld', '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci']
Note that I have no Dockerfile (didn't think I needed it). My "my.cnf" file, is below
davea$ cat mysql/mysqlconf/my.cnf
bind-address = 0.0.0.0
From Docker, how do I set the permissions of the my.cnf file to be read-only? This comes into play on Windows 10 in which running "docker-compose up" results in this warning
mysqld: [Warning] World-writable config file '/etc/mysql/conf.d/my.cnf' is ignored.
Note, this answer -- https://mcmap.net/q/628086/-fixing-world-writable-mysql-error-in-docker, doesn't cut it, because it relies on setting th