jbergstroem / mariadb-alpine

A tiny and fast MariaDB container
MIT License
72 stars 19 forks source link

on Windows: Warning: World-writable config file '/etc/my.cnf.d/my.cnf' is ignored #63

Closed jones1008 closed 2 years ago

jones1008 commented 3 years ago

On windows under certain permission conditions (dependent on folder location) there is the following warning at container startup:

Warning: World-writable config file '/etc/my.cnf.d/my.cnf' is ignored

On Windows this should be reproducable with the following docker-compose.yml and under a path like C:\mariadb-alpine-permission-bug:

services:
  db:
    image: jbergstroem/mariadb-alpine:10.4.17
    container_name: dbserver
    environment:
      MYSQL_ROOT_PASSWORD: root
    volumes:
      - ./my.cnf:/etc/my.cnf.d/my.cnf

A possible solution would be to add a chmod 0444 /etc/my.cnf.d/my.cnf to the run.sh after line 11.

I might be file another PR to fix this, once my other PR (#57) is merged

jbergstroem commented 3 years ago

Just a quick update: I'm looking at getting CI going with windows runners so its easier for me to test these things.

jbergstroem commented 2 years ago

I think the better solution here is to mount it as read only. There is an example in the readme to accomplish this (notice the ro flag in the end)!

$ docker run -it --rm --name=mariadb -v $(pwd)/config/my.cnf:/etc/my.cnf.d/my.cnf:ro

Will close this for now, please let me know if the warning still persists.