aegir-project / dockerfiles

Official dockerfiles for Aegir.
https://hub.docker.com/r/aegir/hostmaster/
MIT License
21 stars 11 forks source link

Reason for hard coded DB container name in docker-entrypoint.sh #9

Closed alexshepherd-hydrant closed 8 years ago

alexshepherd-hydrant commented 8 years ago

In developing something that builds upon this, I found that I could only use a DB host called "database", but it's only due to the mysql_ready method having it hardcoded, making it impossible to override.

I tried out swapping "database" for "$AEGIR_DATABASE_SERVER" on line 16 of docker-entrypoint.sh, and then overriding AEGIR_DATABASE_SERVER with a custom DB container name in my own docker-compose.yml worked as expected.

Without this change, it loops forever with "waiting for mysql ..." every 3 seconds.

Is there any deliberate reason it's hardcoded instead of using the AEGIR_DATABASE_SERVER environment variable, or is this a bug?

helmo commented 8 years ago

I guess that there just hasn't been a need for that ... let see what travis thinks ... #11

jonpugh commented 8 years ago

you are right in that the only reason it's hardcoded is to fit the docker compose yml.

If not I guess it's not bad for us to provide a default AEGIR_DATABASE_SERVER as long as typical users don't have to set the environment var.