Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example docker-compose files contain wrong environment variable #2072

Closed
lucascherzer opened this issue Sep 24, 2023 · 2 comments
Closed

example docker-compose files contain wrong environment variable #2072

lucascherzer opened this issue Sep 24, 2023 · 2 comments
Labels
needs info Additional info needed to triage

Comments

@lucascherzer
Copy link

The docker-compose.yml files in .examples/docker-compose/insecure/ (both apache and fpm) contain the environment variable MYSQL_ROOT_PASSWORD which will not work as the database (mariadb) expects the value in MARIADB_ROOT_PASSWORD.

To fix this:
Change the variable name from MYSQL_ROOT_PASSWORD to MARIADB_ROOT_PASSWORD in the following files:

  • .examples/docker-compose/insecure/apache/docker-compose.yml
  • .examples/docker-compose/insecure/fpm/docker-compose.yml
@joshtrichards
Copy link
Member

Can you elaborate on what lead you to suspect this? If this is in fact occurring it's an issue that needs to be addressed in the MariaDB docker image repo because both variable prefixes are officially still documented by MariaDB:

https://hub.docker.com/_/mariadb/
https://github.com/docker-library/docs/tree/master/mariadb#environment-variables

It would be a tremendous breaking change to drop support for MYSQL_ entirely on their part so I suspect something else is going on here.

I see no indication in the history of their docker-entrypoint.sh that support has been dropped:

https://github.com/MariaDB/mariadb-docker/commits/master/docker-entrypoint.sh

@joshtrichards joshtrichards added the needs info Additional info needed to triage label Oct 3, 2023
@lucascherzer
Copy link
Author

I just investigated a little bit further. The error probably occurs because the env may not be empty. Whether it is called MARIADB_* or MYSQL_* does not make a difference as long as there is a value bound to it.

So for anyone who encounters the issue You need to specify one of MARIADB_ROOT_PASSWORD, MARIADB_ROOT_PASSWORD_HASH, MARIADB_ALLOW_EMPTY_ROOT_PASSWORD and MARIADB_RANDOM_ROOT_PASSWORD, all you have to do is to assign some value to the MYSQL_ROOT_PASSWORD

This concludes the PR, do not merge, the code is better as is (keeps MySQL compatibility)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs info Additional info needed to triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants