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

Use mysql:8.0-debian image tag for CI #175

Merged
merged 1 commit into from
Apr 8, 2024

Conversation

ngan
Copy link
Contributor

@ngan ngan commented Apr 6, 2024

The mysql:8-debian tag is deprecated and is no longer receiving updates. The recommendation is to use the more explicit mysql:8.0-debian tag. This was discovered during (and extracted from) my work in #174.

This is the reference to the discovery:
docker-library/mysql#1040 (comment)

Important

Landing this means that we'll also need to change the required checks for this repo since the name is now 8.0 instead of 8.

Breakdown of changes

This wasn't a simple "let's change 8 to 8.0"...

The newer implementation of mysql's entrypoint file does this thing where it checks to see if the data directory already exists. If it does, then the setup does nothing.
https://github.com/docker-library/mysql/blob/db3fdfbab4caa033f02126f525cb6dfb5a3c1b0c/docker-entrypoint.sh#L380-L381

This means that we can no longer mount a shared directory at /var/lib/mysql otherwise the entrypoint script will not initialize the database. The purpose of this shared mount between the db and the app services was so that the app has access to the certificate files that we generate within the db container.

My workaround for this was to mount the directory somewhere else (/mysql-certs) and then change our generate_keys.sh script to copy the generated certificates from /var/lib/mysql to /mysql-certs. Since generate_keys.sh is executed as the mysql user, instead of root, we have to do a docker trick where we ensure that the directory to be mounted is pre-created and chmod-ed with 777 before it's mounted.

@ngan ngan force-pushed the mysql-8.0-debian branch 8 times, most recently from 9ac3e66 to 40f7b77 Compare April 6, 2024 15:29
@ngan
Copy link
Contributor Author

ngan commented Apr 6, 2024

@composerinteralia this is ready for review. The PR check status is stuck in pending since the names of the required checks has changed. You’ll need to update that the required checks before landing this PR, I think.
image

@composerinteralia composerinteralia merged commit 1019a6f into trilogy-libraries:main Apr 8, 2024
11 checks passed
@ngan ngan deleted the mysql-8.0-debian branch April 8, 2024 15:32
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