-
-
Notifications
You must be signed in to change notification settings - Fork 654
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
Use of Environment Variables MYSQL_DATABASE - has no effect #448
Comments
Think that the variable is just not present in the provided images: https://github.com/cytopia/docker-mysql-5.7 compared to the original mysql image on "Docker Hub" ... |
Yes, by the time I've done the initial work for the Devilbox, PerconaDB was not yet available as an official Docker image. As it is now, it is time to move MySQL, MariaDB and PerconaDB to official images. I first need to ensure that they do offer all the currently implemented functionality and have the same sets of injectable variable names, |
I see - thanks and greetings form Bremen to Berlin ... |
I had a look at all three Docker images (MySQL, MariaDB and PerconaDB), they are all built the same way and use the same set of Volumes and Variables. However I will have to create my own Docker Images out of those, simply by the way the tags are organized as I am unable to do something like this: #MYSQL_SERVER=mysql:5.5
#MYSQL_SERVER=mysql:5.6
#MYSQL_SERVER=mysql:5.7
#MYSQL_SERVER=mysql:8.0
#MYSQL_SERVER=mariadb:5.5
#MYSQL_SERVER=mariadb:10.0
#MYSQL_SERVER=mariadb:10.1
#MYSQL_SERVER=mariadb:10.2
MYSQL_SERVER=mariadb:10.3
#MYSQL_SERVER=percona:5.5
#MYSQL_SERVER=percona:5.6
#MYSQL_SERVER=percona:5.7 The issue is with the # Repository: devilbox/mysql
# Example Tag: percona-5.6
# Env file then as currently:
#MYSQL_SERVER=mysql-5.5
#MYSQL_SERVER=mysql-5.6
#MYSQL_SERVER=mysql-5.7
#MYSQL_SERVER=mysql-8.0
#MYSQL_SERVER=mariadb-5.5
#MYSQL_SERVER=mariadb-10.0
#MYSQL_SERVER=mariadb-10.1
#MYSQL_SERVER=mariadb-10.2
MYSQL_SERVER=mariadb-10.3
#MYSQL_SERVER=percona-5.5
#MYSQL_SERVER=percona-5.6
#MYSQL_SERVER=percona-5.7 This way I can preserve the same current structure I have. |
@fkaminski this one might be interesting to you how to add official MySQL to the stack and make use of the desired variables: #466 |
@fkaminski official MySQL images will be integrated into the Devilbox shortly. |
* Refs #175, Refs #382 Use Docker volumes instead of data directories * Ensure default values are used for mounted data directories as well * Update container versions * Remove unecessary data dirs * Ensure mail uses a Docker volume * Clean up docker-compose.yml * Adjust project files: CHANGELOG, CONTRIBUTING and UPDATING * Refs: #501 #448 Use Official MySQL, MariaDB and Percona images * Ensure Docker Compose examples use Docker volumes * Fix gitignore * Bump version * Update Changelog * Update container versions * Ensure mail uses a Docker volume * Refs: #501 #448 Use Official MySQL, MariaDB and Percona images * Ensure Docker Compose examples use Docker volumes * Fix gitignore * Bump version * Update Changelog * Fix Docker image update script * Remove obsolete configuration directories * Bump version date * Fix fetching Memcached keys * Show the usage of Docker volumes in intranet * Be more verbose on connection tests
@fkaminski could you try out the release branch: #416 Please pay special attention to the instructions in the PR description. |
@fkaminski please let me now if this works out for you now with the above mentioned branch. |
Hi, with this branch a database will be generated with the settings mentioned above ( tested with mysql 5.7 ). So this works now as expected. Thank you. I've set the Variable within the docker-compose-override.yml or within an own my-project1.yml file - see: However this only works once, or rather as long as no db Volume is present. |
That's good news. And yes I can confirm that this only works for a single database. It's a limitation of the official MySQL images, which I can't do anything about it. So I will close this issue then. |
ISSUE TYPE
SUMMARY
I am using the "docker-volumes" branch with "Docker Toolbox v18.09.0" -
tested with Windows 7/10 Home.
The "mysql-5.7" Server Image is set in the ".env" file.
For the mysql service the MYSQL_ROOT_PASSWORD is already in use.
I have tried to set the MYSQL_DATABASE variable in the docker-compose.yml for testing purpose like:
to create a default database on start,
so i do not need to create a database manually - see:
https://hub.docker.com/_/mysql
https://hub.docker.com/_/mariadb
Unfortunately, this has no effect at all.
When i start the container with "docker-compose up -d httpd php mysql"
there is no database "db_devilbox" created - checked via phpMyAdmin.
Goal
Use of the MYSQL_DATABASE variable in ".env" / "docker-compose.yml" for the mysql service to create a default database on container/service start.
The text was updated successfully, but these errors were encountered: