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
Work around database storage problems on Docker for Windows/Mac/Docker Toolbox #714
Comments
This definitely has potential. Shortcoming: A docker reset destroys all databases for all projects. If things have been stopped/rm-ed then this is OK, and probably not much lost anyway. We might be able to just use the tar-up-mysql approach since we use INNODB_FILE_PER_TABLE, and it would be much quicker than mysql import. |
Note that Mariadb 10.2 has this problem even on macOS. See https://jira.mariadb.org/browse/MDEV-16015, a never-ending set of problems with Mariadb. There's a good wrapup in wodby/docker4drupal#244 (comment) (solution suggested is same as here) and MariaDB/mariadb-docker#95 |
Note that the proposal here was actually implemented in #349 as a competing approach to the direct-mounting of the db. @beeradb 's comment at that time was
And that betting against docker stability is a pretty reasonable thing. If we go with volumes, a docker event can destroy everything. However, @cweagans suggests in this issue a backup dump, perhaps with xtrabackup. |
I'm taking an initial look at this to make sure I understand the territory. This may just be a short experimental phase to determine where we want to go with it. |
Sadly, docker volumes don't support anything but root mount permissions, moby/moby#2259 and docker/compose#3270 There is an interesting workaround (Run a temp container first that chowns the voume, and make the real container depend on that one (which exits right after chowning). |
We might be able to switch back to the start-as-root-and-sudo-to-correct-user approach, which uses an environment variable to specify the correct UID within the container. Or why not just add sudo into the mariadb container like we do in the web container, and let the startup script sudo the perms? |
What happened (or feature request):
MariaDB in a Debian-based container on Docker for Windows with a host-mounted volume for /var/lib/mysql fails to start (has trouble writing the data files to disk on the network mount).
MariaDB is also failing in new and fun ways with Docker Toolbox, which is the path toward supporting Windows 10 Home + older Macs.
To get around this, I propose that we do the following:
mysqldump
or similar)The last two points would be sort of optional, but very convenient. We could also not include them by default and document how to set up that behavior in the app's hooks.
This sidesteps the issue of keeping the mysql data directory on a network mount, and also allows for persisting the database contents on the host. It also allows us to not dive into mariadb's source and figure out complex problems that we don't have the time to fully understand.
What you expected to happen:
How to reproduce this:
Version: Please include the output of
ddev version
,docker version
and the project's .ddev/config.yaml.Anything else do we need to know:
Related source links or issues:
Please use a complexity rating of 1-5 (5 is high) for a feature request. (High complexity implies more PR planning)
The text was updated successfully, but these errors were encountered: