-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
50 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
ARG MYSQL_VERSION | ||
|
||
FROM mysql:${MYSQL_VERSION}-debian | ||
# Make all apt-get commands non-interactive. Setting this as an ARG will apply to the entire | ||
# build phase, but not leak into the final image and run phase. | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
# MySQL 5.7 has been EOL'd and is no longer being built by the official mysql docker maintainers: | ||
# https://github.com/docker-library/mysql/pull/1019 | ||
# As such, if we want to add to it, we'll need to update the keyring ourselves. | ||
RUN if [ "${MYSQL_MAJOR}" = "5.7" ]; then \ | ||
set -eux; \ | ||
# pub rsa4096 2023-10-23 [SC] [expires: 2025-10-22] | ||
# BCA4 3417 C3B4 85DD 128E C6D4 B7B3 B788 A8D3 785C | ||
# uid [ unknown] MySQL Release Engineering <mysql-build@oss.oracle.com> | ||
# sub rsa4096 2023-10-23 [E] [expires: 2025-10-22] | ||
key='BCA4 3417 C3B4 85DD 128E C6D4 B7B3 B788 A8D3 785C'; \ | ||
export GNUPGHOME="$(mktemp -d)"; \ | ||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ | ||
mkdir -p /etc/apt/keyrings; \ | ||
gpg --batch --export "$key" > /etc/apt/keyrings/mysql.gpg; \ | ||
gpgconf --kill all; \ | ||
rm -rf "$GNUPGHOME"; \ | ||
fi | ||
|
||
# Install the MySQL test package so that we can utilize test plugins. | ||
# https://github.com/docker-library/mysql/issues/1040 | ||
RUN set -eux \ | ||
# Install MySQL test package. | ||
&& apt-get update \ | ||
&& apt-get install --yes mysql-community-test \ | ||
# Clean up apt-get cache. | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
# Remove all data directories so that the entrypoint can initialize them. | ||
&& rm -rf /var/lib/mysql \ | ||
&& mkdir -p /var/lib/mysql /var/run/mysqld \ | ||
&& chown -R mysql:mysql /var/lib/mysql /var/run/mysqld \ | ||
&& chmod 1777 /var/run/mysqld /var/lib/mysql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.