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

Build mysql test image for CI #174

Merged
merged 1 commit into from
Apr 8, 2024

Conversation

ngan
Copy link
Contributor

@ngan ngan commented Apr 5, 2024

When we implemented support for cleartext authentication plugin, we had to check in the (arch-dependent) auth_test_plugin.so files since the default mysql 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 a mysql-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 takes MYSQL_VERSION as a build argument. We use a multi-stage build to install mysql-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 has mysql-community-test but only its plugins. The reason for this is that when we install the mysql-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.

@ngan ngan force-pushed the build-mysql-image branch 4 times, most recently from 85a834a to 08f17d6 Compare April 6, 2024 02:12
@ngan ngan force-pushed the build-mysql-image branch 4 times, most recently from 39932f1 to f9e5c09 Compare April 7, 2024 20:35
@ngan ngan marked this pull request as ready for review April 8, 2024 14:30
@composerinteralia composerinteralia merged commit 14e7dbc into trilogy-libraries:main Apr 8, 2024
11 checks passed
@ngan ngan deleted the build-mysql-image branch April 8, 2024 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants