Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When we implemented support for cleartext authentication plugin, we had to check in the (arch-dependent)
auth_test_plugin.so
files since the defaultmysql
docker images doesn't ship with that plugin. I filed an issue with the MySQL docker repo to see if they'd be open to building and tagging amysql-community-test
package variant. They said no, and suggested that we build our own MySQL image. This PR does just that.Here's how we do it:
Add another Dockerfile for MySQL, called
Dockerfile.mysql
, that takesMYSQL_VERSION
as a build argument. We use a multi-stage build to installmysql-community-test
package on top of the official image. Then we we copy all the plugins from/usr/lib/mysql/plugin/
to the final image that simply inherits from the official image. This means that we're deciding to not build a final image that hasmysql-community-test
but only its plugins. The reason for this is that when we install themysql-community-test
package, it initializes the database and writes data to/var/lib/mysql
. If you boot the image as is, it won't be set up properly since the entrypoint looks for/var/lib/mysql
to decide whether or not to do the full setup. This is why the official Docker build deletes/var/lib/mysql
. Since we don't want to own/duplicate the intricacies of setting up a clean-slate MySQL image, it's better that we just copy over what we need to the official image.