colinmollenhour / mariadb-galera-swarm

MariaDb Galera Cluster container based on official mariadb image which can auto-bootstrap and recover cluster state.
https://hub.docker.com/r/colinmollenhour/mariadb-galera-swarm
Apache License 2.0
217 stars 102 forks source link

Hardcoded default-time-zone #29

Closed peter-slovak closed 6 years ago

peter-slovak commented 6 years ago

It would be great to be able to set --default-time-zone either via an environment variable (e.g. the commonly used TZ if we had populated the timezone tables, or a more specific one like MYSQL_DEFAULT_TIME_ZONE).

Currently, this option is not overridable in my.cnf because the CLI arguments take precedence. The only way to use other time zone is appending --default-time-zone=... to run command, which only works because it overwrites the previously declared argument --default-time-zone="+00:00".

Is there any reason why you don't keep the default SYSTEM timezone? Am I missing something?

colinmollenhour commented 6 years ago

I don't remember why exactly but I think I remember there being an issue specific to Docker.. Perhaps /etc/timezone inside the container depends on who buile the image rather than the system where the container runs? It was something like that.. Anyway, I am not opposed to allowing "+00:00" be overridden by a MYSQL_DEFAULT_TIME_ZONE environment variable. Would you like to try this and submit a PR?

peter-slovak commented 6 years ago

You're right, unless you set the timezone in your Dockerfile, it's determined by the parent image - in that case, "+00:00" is a sensible default. I'll look into the PR soon :+1: