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
223 stars 102 forks source link

Cant set MYSQL_ROOT_HOST #96

Closed TheGreatDoc closed 2 years ago

TheGreatDoc commented 4 years ago

Hi,

Im trying to set MYSQL_ROOT_HOST but whatever I do it is always set to 127.0.0.1 and I thing its probably related to https://github.com/colinmollenhour/mariadb-galera-swarm/blob/8a1627360820a1b33cdbae9072a44234b5a49d7d/start.sh#L219

Shouldnt it be if ! [ -z "$MYSQL_ROOT_HOST" ]; then ?

So only if MYSQL_ROOT_HOST is empty it will be 127.0.0.1

colinmollenhour commented 4 years ago

The -z test is true if the string is zero length so I think that line is correct. Are you sure the environment variable is passing through properly?

csib commented 4 years ago

@TheGreatDoc Use it like this, it is works for me:

version: '3.4'

services:
  seed:
    image: colinmollenhour/mariadb-galera-swarm:10.4.11-2020-01-06
    environment:
[...]
      - MYSQL_ROOT_HOST=%
      - DEFAULT_TIME_ZONE=Europe/Budapest
      - NODE_ADDRESS=^10.0.*.*
    networks:
      - db_network
    command: seed
    volumes:
      - mysql-data:/var/lib/mysql