From 8d14666ccf79919a2e9b70793d9a0d5f580d6d36 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Wed, 4 Mar 2015 09:28:01 +0100 Subject: [PATCH 001/386] Fixed security issue - File with root password in plaintext was readable from database the first time server was run --- 5.5/docker-entrypoint.sh | 62 ++++++++++++++++++++++++++++++-------- 5.6/docker-entrypoint.sh | 62 ++++++++++++++++++++++++++++++-------- 5.7/docker-entrypoint.sh | 64 ++++++++++++++++++++++++++++++++-------- 3 files changed, 149 insertions(+), 39 deletions(-) diff --git a/5.5/docker-entrypoint.sh b/5.5/docker-entrypoint.sh index 0a35e1d8c..79d79c3af 100755 --- a/5.5/docker-entrypoint.sh +++ b/5.5/docker-entrypoint.sh @@ -1,13 +1,24 @@ #!/bin/bash set -e +get_option () { + local section=$1 + local option=$2 + local default=$3 + ret=$(/usr/bin/my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2-) + [ -z $ret ] && ret=$default + echo $ret +} + if [ "${1:0:1}" = '-' ]; then set -- mysqld "$@" fi if [ "$1" = 'mysqld' ]; then - # read DATADIR from the MySQL config - DATADIR="$("$@" --verbose --help 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')" + # Get config + DATADIR="$("$@" --verbose --help 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')" + SOCKET=$(get_option mysqld socket "$datadir/mysql.sock") + PIDFILE=$(get_option mysqld pid-file "/var/run/mysqld/mysqld.pid") if [ ! -d "$DATADIR/mysql" ]; then if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" ]; then @@ -15,16 +26,29 @@ if [ "$1" = 'mysqld' ]; then echo >&2 ' Did you forget to add -e MYSQL_ROOT_PASSWORD=... ?' exit 1 fi - - echo 'Running mysql_install_db ...' - mysql_install_db --datadir="$DATADIR" --basedir=/usr/local/mysql + if [ ! -d "$DATADIR" ]; then + mkdir -p $DATADIR + fi + echo 'Running mysql_install_db' + mysql_install_db --user=mysql --datadir=$DATADIR --rpm echo 'Finished mysql_install_db' - + + mysqld --user=mysql --datadir=$DATADIR --skip-networking & + for i in $(seq 30 -1 0); do + [ -S $SOCKET ] && break + echo 'MySQL init process in progress...' + sleep 1 + done + if [ $i = 0 ]; then + echo >&2 'MySQL init process failed.' + exit 1 + fi + # These statements _must_ be on individual lines, and _must_ end with # semicolons (no line breaks or comments are permitted). # TODO proper SQL escaping on ALL the things D: - tempSqlFile='/tmp/mysql-first-time.sql' + tempSqlFile=$(mktemp /tmp/mysql-first-time.XXXXXX.sql) cat > "$tempSqlFile" <<-EOSQL DELETE FROM mysql.user ; CREATE USER 'root'@'%' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}' ; @@ -33,23 +57,35 @@ if [ "$1" = 'mysqld' ]; then EOSQL if [ "$MYSQL_DATABASE" ]; then - echo "CREATE DATABASE IF NOT EXISTS \`$MYSQL_DATABASE\` ;" >> "$tempSqlFile" + echo "CREATE DATABASE IF NOT EXISTS \`"$MYSQL_DATABASE"\` ;" >> "$tempSqlFile" fi if [ "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then - echo "CREATE USER '$MYSQL_USER'@'%' IDENTIFIED BY '$MYSQL_PASSWORD' ;" >> "$tempSqlFile" + echo "CREATE USER '"$MYSQL_USER"'@'%' IDENTIFIED BY '"$MYSQL_PASSWORD"' ;" >> "$tempSqlFile" if [ "$MYSQL_DATABASE" ]; then - echo "GRANT ALL ON \`$MYSQL_DATABASE\`.* TO '$MYSQL_USER'@'%' ;" >> "$tempSqlFile" + echo "GRANT ALL ON \`"$MYSQL_DATABASE"\`.* TO '"$MYSQL_USER"'@'%' ;" >> "$tempSqlFile" fi fi echo 'FLUSH PRIVILEGES ;' >> "$tempSqlFile" - set -- "$@" --init-file="$tempSqlFile" + chown -R mysql:mysql "$DATADIR" + mysql -uroot < $tempSqlFile + + rm -f $tempSqlFile + kill $(cat $PIDFILE) + for i in $(seq 30 -1 0); do + [ -S $SOCKET ] || break + echo 'MySQL init process in progress...' + sleep 1 + done + if [ $i = 0 ]; then + echo >&2 'MySQL hangs during init process.' + exit 1 + fi + echo 'MySQL init process done. Ready for start up.' fi - - chown -R mysql:mysql "$DATADIR" fi exec "$@" diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index 46f60d12c..803c35646 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -1,30 +1,54 @@ #!/bin/bash set -e +get_option () { + local section=$1 + local option=$2 + local default=$3 + ret=$(/usr/bin/my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2-) + [ -z $ret ] && ret=$default + echo $ret +} + if [ "${1:0:1}" = '-' ]; then set -- mysqld "$@" fi if [ "$1" = 'mysqld' ]; then - # read DATADIR from the MySQL config + # Get config DATADIR="$("$@" --verbose --help 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')" - + SOCKET=$(get_option mysqld socket "$datadir/mysql.sock") + PIDFILE=$(get_option mysqld pid-file "/var/run/mysqld/mysqld.pid") + if [ ! -d "$DATADIR/mysql" ]; then if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" ]; then echo >&2 'error: database is uninitialized and MYSQL_ROOT_PASSWORD not set' echo >&2 ' Did you forget to add -e MYSQL_ROOT_PASSWORD=... ?' exit 1 fi - - echo 'Running mysql_install_db ...' - mysql_install_db --datadir="$DATADIR" + if [ ! -d "$DATADIR" ]; then + mkdir -p $DATADIR + fi + echo 'Running mysql_install_db' + mysql_install_db --user=mysql --datadir=$DATADIR --rpm --keep-my-cnf echo 'Finished mysql_install_db' - + + mysqld --user=mysql --datadir=$DATADIR --skip-networking & + for i in $(seq 30 -1 0); do + [ -S $SOCKET ] && break + echo 'MySQL init process in progress...' + sleep 1 + done + if [ $i = 0 ]; then + echo >&2 'MySQL init process failed.' + exit 1 + fi + # These statements _must_ be on individual lines, and _must_ end with # semicolons (no line breaks or comments are permitted). # TODO proper SQL escaping on ALL the things D: - tempSqlFile='/tmp/mysql-first-time.sql' + tempSqlFile=$(mktemp /tmp/mysql-first-time.XXXXXX.sql) cat > "$tempSqlFile" <<-EOSQL DELETE FROM mysql.user ; CREATE USER 'root'@'%' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}' ; @@ -33,23 +57,35 @@ if [ "$1" = 'mysqld' ]; then EOSQL if [ "$MYSQL_DATABASE" ]; then - echo "CREATE DATABASE IF NOT EXISTS \`$MYSQL_DATABASE\` ;" >> "$tempSqlFile" + echo "CREATE DATABASE IF NOT EXISTS \`"$MYSQL_DATABASE"\` ;" >> "$tempSqlFile" fi if [ "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then - echo "CREATE USER '$MYSQL_USER'@'%' IDENTIFIED BY '$MYSQL_PASSWORD' ;" >> "$tempSqlFile" + echo "CREATE USER '"$MYSQL_USER"'@'%' IDENTIFIED BY '"$MYSQL_PASSWORD"' ;" >> "$tempSqlFile" if [ "$MYSQL_DATABASE" ]; then - echo "GRANT ALL ON \`$MYSQL_DATABASE\`.* TO '$MYSQL_USER'@'%' ;" >> "$tempSqlFile" + echo "GRANT ALL ON \`"$MYSQL_DATABASE"\`.* TO '"$MYSQL_USER"'@'%' ;" >> "$tempSqlFile" fi fi echo 'FLUSH PRIVILEGES ;' >> "$tempSqlFile" - set -- "$@" --init-file="$tempSqlFile" + chown -R mysql:mysql "$DATADIR" + mysql -uroot < $tempSqlFile + + rm -f $tempSqlFile + kill $(cat $PIDFILE) + for i in $(seq 30 -1 0); do + [ -S $SOCKET ] || break + echo 'MySQL init process in progress...' + sleep 1 + done + if [ $i = 0 ]; then + echo >&2 'MySQL hangs during init process.' + exit 1 + fi + echo 'MySQL init process done. Ready for start up.' fi - - chown -R mysql:mysql "$DATADIR" fi exec "$@" diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 356fd83d6..9788641ac 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -1,30 +1,54 @@ #!/bin/bash set -e +get_option () { + local section=$1 + local option=$2 + local default=$3 + ret=$(/usr/bin/my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2-) + [ -z $ret ] && ret=$default + echo $ret +} + if [ "${1:0:1}" = '-' ]; then set -- mysqld "$@" fi if [ "$1" = 'mysqld' ]; then - # read DATADIR from the MySQL config + # Get config DATADIR="$("$@" --verbose --help 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')" - + SOCKET=$(get_option mysqld socket "$datadir/mysql.sock") + PIDFILE=$(get_option mysqld pid-file "/var/run/mysqld/mysqld.pid") + if [ ! -d "$DATADIR/mysql" ]; then if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" ]; then echo >&2 'error: database is uninitialized and MYSQL_ROOT_PASSWORD not set' echo >&2 ' Did you forget to add -e MYSQL_ROOT_PASSWORD=... ?' exit 1 fi - - echo 'Running mysql_install_db ...' - mysql_install_db --datadir="$DATADIR" --mysqld-file="$(which "$1")" + if [ ! -d "$DATADIR" ]; then + mkdir -p $DATADIR + fi + echo 'Running mysql_install_db' + mysql_install_db --user=mysql --datadir=$DATADIR --insecure echo 'Finished mysql_install_db' - + + mysqld --user=mysql --datadir=$DATADIR --skip-networking & + for i in $(seq 30 -1 0); do + [ -S $SOCKET ] && break + echo 'MySQL init process in progress...' + sleep 1 + done + if [ $i = 0 ]; then + echo >&2 'MySQL init process failed.' + exit 1 + fi + # These statements _must_ be on individual lines, and _must_ end with # semicolons (no line breaks or comments are permitted). # TODO proper SQL escaping on ALL the things D: - tempSqlFile='/tmp/mysql-first-time.sql' + tempSqlFile=$(mktemp /tmp/mysql-first-time.XXXXXX.sql) cat > "$tempSqlFile" <<-EOSQL DELETE FROM mysql.user ; CREATE USER 'root'@'%' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}' ; @@ -33,23 +57,37 @@ if [ "$1" = 'mysqld' ]; then EOSQL if [ "$MYSQL_DATABASE" ]; then - echo "CREATE DATABASE IF NOT EXISTS \`$MYSQL_DATABASE\` ;" >> "$tempSqlFile" + echo "CREATE DATABASE IF NOT EXISTS \`"$MYSQL_DATABASE"\` ;" >> "$tempSqlFile" fi if [ "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then - echo "CREATE USER '$MYSQL_USER'@'%' IDENTIFIED BY '$MYSQL_PASSWORD' ;" >> "$tempSqlFile" + echo "CREATE USER '"$MYSQL_USER"'@'%' IDENTIFIED BY '"$MYSQL_PASSWORD"' ;" >> "$tempSqlFile" if [ "$MYSQL_DATABASE" ]; then - echo "GRANT ALL ON \`$MYSQL_DATABASE\`.* TO '$MYSQL_USER'@'%' ;" >> "$tempSqlFile" + echo "GRANT ALL ON \`"$MYSQL_DATABASE"\`.* TO '"$MYSQL_USER"'@'%' ;" >> "$tempSqlFile" fi fi echo 'FLUSH PRIVILEGES ;' >> "$tempSqlFile" - set -- "$@" --init-file="$tempSqlFile" + chown -R mysql:mysql "$DATADIR" + mysql -uroot < $tempSqlFile + sed -i -e '/^log-error/d' /etc/my.cnf + cat /etc/my.cnf + rm -f $tempSqlFile + kill $(cat $PIDFILE) + for i in $(seq 30 -1 0); do + [ -S $SOCKET ] || break + echo 'MySQL init process in progress...' + sleep 1 + done + if [ $i = 0 ]; then + echo >&2 'MySQL hangs during init process.' + exit 1 + fi + echo 'MySQL init process done. Ready for start up.' fi - - chown -R mysql:mysql "$DATADIR" fi exec "$@" + From 3682b465f45bbdabd5579dff24e0f22d0be9088e Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Mon, 9 Mar 2015 09:00:59 +0100 Subject: [PATCH 002/386] Changed to use oraclelinux as base image --- 5.5/Dockerfile | 56 ++++++----------------------------- 5.6/Dockerfile | 39 ++++++------------------ 5.7/Dockerfile | 39 ++++++------------------ 5.7/docker-entrypoint.sh | 3 ++ README.md | 7 +---- generate-stackbrew-library.sh | 31 ------------------- update.sh | 25 ---------------- 7 files changed, 31 insertions(+), 169 deletions(-) delete mode 100755 generate-stackbrew-library.sh delete mode 100755 update.sh diff --git a/5.5/Dockerfile b/5.5/Dockerfile index b5d611bb5..666a0546c 100644 --- a/5.5/Dockerfile +++ b/5.5/Dockerfile @@ -1,53 +1,14 @@ -FROM debian:wheezy +FROM oraclelinux:latest -# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added -RUN groupadd -r mysql && useradd -r -g mysql mysql +## -- The environment variables set using ENV will persist when a container +## -- is run from the resulting image. -- ## -# FATAL ERROR: please install the following Perl modules before executing /usr/local/mysql/scripts/mysql_install_db: -# File::Basename -# File::Copy -# Sys::Hostname -# Data::Dumper -RUN apt-get update && apt-get install -y perl --no-install-recommends && rm -rf /var/lib/apt/lists/* +ENV PACKAGE_URL='https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.42-2.el7.x86_64.rpm' -# mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory -RUN apt-get update && apt-get install -y libaio1 && rm -rf /var/lib/apt/lists/* - -# gpg: key 5072E1F5: public key "MySQL Release Engineering " imported -RUN gpg --keyserver pool.sks-keyservers.net --recv-keys A4A9406876FCBD3C456770C88C718D3B5072E1F5 - -ENV MYSQL_MAJOR 5.5 -ENV MYSQL_VERSION 5.5.42 - -# note: we're pulling the *.asc file from mysql.he.net instead of dev.mysql.com because the official mirror 404s that file for whatever reason - maybe it's at a different path? -RUN apt-get update && apt-get install -y curl --no-install-recommends && rm -rf /var/lib/apt/lists/* \ - && curl -SL "http://dev.mysql.com/get/Downloads/MySQL-$MYSQL_MAJOR/mysql-$MYSQL_VERSION-linux2.6-x86_64.tar.gz" -o mysql.tar.gz \ - && curl -SL "http://mysql.he.net/Downloads/MySQL-$MYSQL_MAJOR/mysql-$MYSQL_VERSION-linux2.6-x86_64.tar.gz.asc" -o mysql.tar.gz.asc \ - && apt-get purge -y --auto-remove curl \ - && gpg --verify mysql.tar.gz.asc \ - && mkdir /usr/local/mysql \ - && tar -xzf mysql.tar.gz -C /usr/local/mysql --strip-components=1 \ - && rm mysql.tar.gz* \ - && rm -rf /usr/local/mysql/mysql-test /usr/local/mysql/sql-bench \ - && rm -rf /usr/local/mysql/bin/*-debug /usr/local/mysql/bin/*_embedded \ - && find /usr/local/mysql -type f -name "*.a" -delete \ - && apt-get update && apt-get install -y binutils && rm -rf /var/lib/apt/lists/* \ - && { find /usr/local/mysql -type f -executable -exec strip --strip-all '{}' + || true; } \ - && apt-get purge -y --auto-remove binutils -ENV PATH $PATH:/usr/local/mysql/bin:/usr/local/mysql/scripts - -# replicate some of the way the APT package configuration works -# this is only for 5.5 since it doesn't have an APT repo, and will go away when 5.5 does -RUN mkdir -p /etc/mysql/conf.d \ - && { \ - echo '[mysqld]'; \ - echo '!includedir /etc/mysql/conf.d/'; \ - } > /etc/mysql/my.cnf \ - && { \ - echo '[mysqld]'; \ - echo 'user = mysql'; \ - echo 'datadir = /var/lib/mysql'; \ - } > /etc/mysql/conf.d/docker.cnf +# Install server +RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ + && yum install -y $PACKAGE_URL \ + && rm -rf /var/cache/yum/* VOLUME /var/lib/mysql @@ -56,3 +17,4 @@ ENTRYPOINT ["/entrypoint.sh"] EXPOSE 3306 CMD ["mysqld"] + diff --git a/5.6/Dockerfile b/5.6/Dockerfile index dbbd090b6..d230cd75e 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -1,36 +1,14 @@ -FROM debian:wheezy +FROM oraclelinux:latest -# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added -RUN groupadd -r mysql && useradd -r -g mysql mysql +## -- The environment variables set using ENV will persist when a container +## -- is run from the resulting image. -- ## -# FATAL ERROR: please install the following Perl modules before executing /usr/local/mysql/scripts/mysql_install_db: -# File::Basename -# File::Copy -# Sys::Hostname -# Data::Dumper -RUN apt-get update && apt-get install -y perl --no-install-recommends && rm -rf /var/lib/apt/lists/* +ENV PACKAGE_URL='https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.23-2.el7.x86_64.rpm' -# gpg: key 5072E1F5: public key "MySQL Release Engineering " imported -RUN apt-key adv --keyserver pool.sks-keyservers.net --recv-keys A4A9406876FCBD3C456770C88C718D3B5072E1F5 - -ENV MYSQL_MAJOR 5.6 -ENV MYSQL_VERSION 5.6.23 - -RUN echo "deb http://repo.mysql.com/apt/debian/ wheezy mysql-${MYSQL_MAJOR}" > /etc/apt/sources.list.d/mysql.list - -# the "/var/lib/mysql" stuff here is because the mysql-server postinst doesn't have an explicit way to disable the mysql_install_db codepath besides having a database already "configured" (ie, stuff in /var/lib/mysql/mysql) -# also, we set debconf keys to make APT a little quieter -RUN { \ - echo mysql-community-server mysql-community-server/data-dir select ''; \ - echo mysql-community-server mysql-community-server/root-pass password ''; \ - echo mysql-community-server mysql-community-server/re-root-pass password ''; \ - echo mysql-community-server mysql-community-server/remove-test-db select false; \ - } | debconf-set-selections \ - && apt-get update && apt-get install -y mysql-server="${MYSQL_VERSION}"* && rm -rf /var/lib/apt/lists/* \ - && rm -rf /var/lib/mysql && mkdir -p /var/lib/mysql - -# comment out a few problematic configuration values -RUN sed -Ei 's/^(bind-address|log)/#&/' /etc/mysql/my.cnf +# Install server +RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ + && yum install -y $PACKAGE_URL \ + && rm -rf /var/cache/yum/* VOLUME /var/lib/mysql @@ -39,3 +17,4 @@ ENTRYPOINT ["/entrypoint.sh"] EXPOSE 3306 CMD ["mysqld"] + diff --git a/5.7/Dockerfile b/5.7/Dockerfile index 650da8f0e..6ffc3d3cb 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -1,36 +1,14 @@ -FROM debian:wheezy +FROM oraclelinux:latest -# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added -RUN groupadd -r mysql && useradd -r -g mysql mysql +## -- The environment variables set using ENV will persist when a container +## -- is run from the resulting image. -- ## -# FATAL ERROR: please install the following Perl modules before executing /usr/local/mysql/scripts/mysql_install_db: -# File::Basename -# File::Copy -# Sys::Hostname -# Data::Dumper -RUN apt-get update && apt-get install -y perl --no-install-recommends && rm -rf /var/lib/apt/lists/* +ENV PACKAGE_URL='https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.5-0.3.m15.el7.x86_64.rpm' -# gpg: key 5072E1F5: public key "MySQL Release Engineering " imported -RUN apt-key adv --keyserver pool.sks-keyservers.net --recv-keys A4A9406876FCBD3C456770C88C718D3B5072E1F5 - -ENV MYSQL_MAJOR 5.7 -ENV MYSQL_VERSION 5.7.5-m15 - -RUN echo "deb http://repo.mysql.com/apt/debian/ wheezy mysql-${MYSQL_MAJOR}-dmr" > /etc/apt/sources.list.d/mysql.list - -# the "/var/lib/mysql" stuff here is because the mysql-server postinst doesn't have an explicit way to disable the mysql_install_db codepath besides having a database already "configured" (ie, stuff in /var/lib/mysql/mysql) -# also, we set debconf keys to make APT a little quieter -RUN { \ - echo mysql-community-server mysql-community-server/data-dir select ''; \ - echo mysql-community-server mysql-community-server/root-pass password ''; \ - echo mysql-community-server mysql-community-server/re-root-pass password ''; \ - echo mysql-community-server mysql-community-server/remove-test-db select false; \ - } | debconf-set-selections \ - && apt-get update && apt-get install -y mysql-server="${MYSQL_VERSION}"* && rm -rf /var/lib/apt/lists/* \ - && rm -rf /var/lib/mysql && mkdir -p /var/lib/mysql - -# comment out a few problematic configuration values -RUN sed -Ei 's/^(bind-address|log)/#&/' /etc/mysql/my.cnf +# Install server +RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ + && yum install -y $PACKAGE_URL \ + && rm -rf /var/cache/yum/* VOLUME /var/lib/mysql @@ -39,3 +17,4 @@ ENTRYPOINT ["/entrypoint.sh"] EXPOSE 3306 CMD ["mysqld"] + diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 9788641ac..0507e6559 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -76,6 +76,9 @@ if [ "$1" = 'mysqld' ]; then cat /etc/my.cnf rm -f $tempSqlFile kill $(cat $PIDFILE) + + # Wait to ensure server is stopped (below check doesn't work right for 5.7.5) + sleep 10 for i in $(seq 30 -1 0); do [ -S $SOCKET ] || break echo 'MySQL init process in progress...' diff --git a/README.md b/README.md index 4bc4ea1bd..655c773ff 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,3 @@ # About this Repo -This is the Git repo of the official Docker image for [mysql](https://registry.hub.docker.com/_/mysql/). See the -Hub page for the full readme on how to use the Docker image and for information -regarding contributing and issues. - -The full readme is generated over in [docker-library/docs](https://github.com/docker-library/docs), -specificially in [docker-library/docs/mysql](https://github.com/docker-library/docs/tree/master/mysql). +This is the Git repo for Dockerfiles and scripts for MySQL products, maintained by the MySQL team. diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh deleted file mode 100755 index 1a94a4282..000000000 --- a/generate-stackbrew-library.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -set -e - -declare -A aliases -aliases=( - [5.6]='5 latest' -) - -cd "$(dirname "$(readlink -f "$BASH_SOURCE")")" - -versions=( */ ) -versions=( "${versions[@]%/}" ) -url='git://github.com/docker-library/mysql' - -echo '# maintainer: InfoSiftr (@infosiftr)' - -for version in "${versions[@]}"; do - commit="$(git log -1 --format='format:%H' -- "$version")" - fullVersion="$(grep -m1 'ENV MYSQL_VERSION ' "$version/Dockerfile" | cut -d' ' -f3)" - versionAliases=() - while [ "$fullVersion" != "$version" -a "${fullVersion%[.-]*}" != "$fullVersion" ]; do - versionAliases+=( $fullVersion ) - fullVersion="${fullVersion%[.-]*}" - done - versionAliases+=( $version ${aliases[$version]} ) - - echo - for va in "${versionAliases[@]}"; do - echo "$va: ${url}@${commit} $version" - done -done diff --git a/update.sh b/update.sh deleted file mode 100755 index 48e41d9b7..000000000 --- a/update.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -set -e - -cd "$(dirname "$(readlink -f "$BASH_SOURCE")")" - -versions=( "$@" ) -if [ ${#versions[@]} -eq 0 ]; then - versions=( */ ) -fi -versions=( "${versions[@]%/}" ) - -for version in "${versions[@]}"; do - fullVersion="$(curl -sSL "https://dev.mysql.com/downloads/mysql/$version.html?os=2" \ - | grep '">(mysql-'"$version"'.*-linux.*-x86_64\.tar\.gz)<' \ - | sed -r 's!.*\(mysql-([^<)]+)-linux.*-x86_64\.tar\.gz\).*!\1!' \ - | sort -V | tail -1)" - - ( - set -x - sed -ri ' - s/^(ENV MYSQL_MAJOR) .*/\1 '"$version"'/; - s/^(ENV MYSQL_VERSION) .*/\1 '"$fullVersion"'/ - ' "$version/Dockerfile" - ) -done From 82e016da5d008888adf268ca614e975ba89b9172 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Wed, 11 Mar 2015 08:15:32 +0100 Subject: [PATCH 003/386] Updated for 5.7.6 --- 5.7/Dockerfile | 2 +- 5.7/docker-entrypoint.sh | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/5.7/Dockerfile b/5.7/Dockerfile index 6ffc3d3cb..6eb71d5d3 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -3,7 +3,7 @@ FROM oraclelinux:latest ## -- The environment variables set using ENV will persist when a container ## -- is run from the resulting image. -- ## -ENV PACKAGE_URL='https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.5-0.3.m15.el7.x86_64.rpm' +ENV PACKAGE_URL=http://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.6-0.3.m16.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 0507e6559..4ceaf1f03 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -29,10 +29,13 @@ if [ "$1" = 'mysqld' ]; then if [ ! -d "$DATADIR" ]; then mkdir -p $DATADIR fi - echo 'Running mysql_install_db' - mysql_install_db --user=mysql --datadir=$DATADIR --insecure - echo 'Finished mysql_install_db' - + # Workaround for bug related to --verbose --help + rm $DATADIR/ib_logfile0 + rm $DATADIR/ib_logfile1 + rm $DATADIR/ibdata1 + echo 'Initializing database' + mysqld --initialize-insecure=on --user=mysql --datadir=$DATADIR + echo 'Finished database init' mysqld --user=mysql --datadir=$DATADIR --skip-networking & for i in $(seq 30 -1 0); do [ -S $SOCKET ] && break From 2c54da148bee29119d5cfca1389336c1c5952c11 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Mon, 16 Mar 2015 09:32:54 +0100 Subject: [PATCH 004/386] * Fix whitespace inconsistencies * Removed hardcoded path from my_print_defaults command * Moved command for setting datadir ownership to before server is started Conflicts: 5.5/docker-entrypoint.sh 5.7/docker-entrypoint.sh --- 5.5/docker-entrypoint.sh | 69 ++++++++++++++++++++-------------------- 5.6/docker-entrypoint.sh | 65 ++++++++++++++++++------------------- 5.7/docker-entrypoint.sh | 69 ++++++++++++++++++++-------------------- 3 files changed, 103 insertions(+), 100 deletions(-) diff --git a/5.5/docker-entrypoint.sh b/5.5/docker-entrypoint.sh index 79d79c3af..760542448 100755 --- a/5.5/docker-entrypoint.sh +++ b/5.5/docker-entrypoint.sh @@ -2,12 +2,12 @@ set -e get_option () { - local section=$1 - local option=$2 - local default=$3 - ret=$(/usr/bin/my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2-) - [ -z $ret ] && ret=$default - echo $ret + local section=$1 + local option=$2 + local default=$3 + ret=$(my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2-) + [ -z $ret ] && ret=$default + echo $ret } if [ "${1:0:1}" = '-' ]; then @@ -16,10 +16,10 @@ fi if [ "$1" = 'mysqld' ]; then # Get config - DATADIR="$("$@" --verbose --help 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')" - SOCKET=$(get_option mysqld socket "$datadir/mysql.sock") - PIDFILE=$(get_option mysqld pid-file "/var/run/mysqld/mysqld.pid") - + DATADIR="$("$@" --verbose --help 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')" + SOCKET=$(get_option mysqld socket "$DATADIR/mysql.sock") + PIDFILE=$(get_option mysqld pid-file "/var/run/mysqld/mysqld.pid") + if [ ! -d "$DATADIR/mysql" ]; then if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" ]; then echo >&2 'error: database is uninitialized and MYSQL_ROOT_PASSWORD not set' @@ -29,25 +29,27 @@ if [ "$1" = 'mysqld' ]; then if [ ! -d "$DATADIR" ]; then mkdir -p $DATADIR fi + chown -R mysql:mysql "$DATADIR" + echo 'Running mysql_install_db' mysql_install_db --user=mysql --datadir=$DATADIR --rpm echo 'Finished mysql_install_db' mysqld --user=mysql --datadir=$DATADIR --skip-networking & - for i in $(seq 30 -1 0); do - [ -S $SOCKET ] && break - echo 'MySQL init process in progress...' - sleep 1 + for i in $(seq 30 -1 0); do + [ -S $SOCKET ] && break + echo 'MySQL init process in progress...' + sleep 1 done - if [ $i = 0 ]; then - echo >&2 'MySQL init process failed.' - exit 1 - fi - + if [ $i = 0 ]; then + echo >&2 'MySQL init process failed.' + exit 1 + fi + # These statements _must_ be on individual lines, and _must_ end with # semicolons (no line breaks or comments are permitted). # TODO proper SQL escaping on ALL the things D: - + tempSqlFile=$(mktemp /tmp/mysql-first-time.XXXXXX.sql) cat > "$tempSqlFile" <<-EOSQL DELETE FROM mysql.user ; @@ -55,35 +57,34 @@ if [ "$1" = 'mysqld' ]; then GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION ; DROP DATABASE IF EXISTS test ; EOSQL - + if [ "$MYSQL_DATABASE" ]; then echo "CREATE DATABASE IF NOT EXISTS \`"$MYSQL_DATABASE"\` ;" >> "$tempSqlFile" fi - + if [ "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then echo "CREATE USER '"$MYSQL_USER"'@'%' IDENTIFIED BY '"$MYSQL_PASSWORD"' ;" >> "$tempSqlFile" - + if [ "$MYSQL_DATABASE" ]; then echo "GRANT ALL ON \`"$MYSQL_DATABASE"\`.* TO '"$MYSQL_USER"'@'%' ;" >> "$tempSqlFile" fi fi - + echo 'FLUSH PRIVILEGES ;' >> "$tempSqlFile" - - chown -R mysql:mysql "$DATADIR" + mysql -uroot < $tempSqlFile rm -f $tempSqlFile kill $(cat $PIDFILE) - for i in $(seq 30 -1 0); do - [ -S $SOCKET ] || break - echo 'MySQL init process in progress...' - sleep 1 + for i in $(seq 30 -1 0); do + [ -S $SOCKET ] || break + echo 'MySQL init process in progress...' + sleep 1 done - if [ $i = 0 ]; then - echo >&2 'MySQL hangs during init process.' - exit 1 - fi + if [ $i = 0 ]; then + echo >&2 'MySQL hangs during init process.' + exit 1 + fi echo 'MySQL init process done. Ready for start up.' fi fi diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index 803c35646..00a8b8990 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -2,12 +2,12 @@ set -e get_option () { - local section=$1 - local option=$2 - local default=$3 - ret=$(/usr/bin/my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2-) - [ -z $ret ] && ret=$default - echo $ret + local section=$1 + local option=$2 + local default=$3 + ret=$(my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2-) + [ -z $ret ] && ret=$default + echo $ret } if [ "${1:0:1}" = '-' ]; then @@ -17,8 +17,8 @@ fi if [ "$1" = 'mysqld' ]; then # Get config DATADIR="$("$@" --verbose --help 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')" - SOCKET=$(get_option mysqld socket "$datadir/mysql.sock") - PIDFILE=$(get_option mysqld pid-file "/var/run/mysqld/mysqld.pid") + SOCKET=$(get_option mysqld socket "$datadir/mysql.sock") + PIDFILE=$(get_option mysqld pid-file "/var/run/mysqld/mysqld.pid") if [ ! -d "$DATADIR/mysql" ]; then if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" ]; then @@ -29,25 +29,27 @@ if [ "$1" = 'mysqld' ]; then if [ ! -d "$DATADIR" ]; then mkdir -p $DATADIR fi + chown -R mysql:mysql "$DATADIR" + echo 'Running mysql_install_db' mysql_install_db --user=mysql --datadir=$DATADIR --rpm --keep-my-cnf echo 'Finished mysql_install_db' mysqld --user=mysql --datadir=$DATADIR --skip-networking & - for i in $(seq 30 -1 0); do - [ -S $SOCKET ] && break - echo 'MySQL init process in progress...' - sleep 1 + for i in $(seq 30 -1 0); do + [ -S $SOCKET ] && break + echo 'MySQL init process in progress...' + sleep 1 done - if [ $i = 0 ]; then - echo >&2 'MySQL init process failed.' - exit 1 - fi - + if [ $i = 0 ]; then + echo >&2 'MySQL init process failed.' + exit 1 + fi + # These statements _must_ be on individual lines, and _must_ end with # semicolons (no line breaks or comments are permitted). # TODO proper SQL escaping on ALL the things D: - + tempSqlFile=$(mktemp /tmp/mysql-first-time.XXXXXX.sql) cat > "$tempSqlFile" <<-EOSQL DELETE FROM mysql.user ; @@ -55,35 +57,34 @@ if [ "$1" = 'mysqld' ]; then GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION ; DROP DATABASE IF EXISTS test ; EOSQL - + if [ "$MYSQL_DATABASE" ]; then echo "CREATE DATABASE IF NOT EXISTS \`"$MYSQL_DATABASE"\` ;" >> "$tempSqlFile" fi - + if [ "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then echo "CREATE USER '"$MYSQL_USER"'@'%' IDENTIFIED BY '"$MYSQL_PASSWORD"' ;" >> "$tempSqlFile" - + if [ "$MYSQL_DATABASE" ]; then echo "GRANT ALL ON \`"$MYSQL_DATABASE"\`.* TO '"$MYSQL_USER"'@'%' ;" >> "$tempSqlFile" fi fi - + echo 'FLUSH PRIVILEGES ;' >> "$tempSqlFile" - - chown -R mysql:mysql "$DATADIR" + mysql -uroot < $tempSqlFile rm -f $tempSqlFile kill $(cat $PIDFILE) - for i in $(seq 30 -1 0); do - [ -S $SOCKET ] || break - echo 'MySQL init process in progress...' - sleep 1 + for i in $(seq 30 -1 0); do + [ -S $SOCKET ] || break + echo 'MySQL init process in progress...' + sleep 1 done - if [ $i = 0 ]; then - echo >&2 'MySQL hangs during init process.' - exit 1 - fi + if [ $i = 0 ]; then + echo >&2 'MySQL hangs during init process.' + exit 1 + fi echo 'MySQL init process done. Ready for start up.' fi fi diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 4ceaf1f03..34bd9994f 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -2,12 +2,12 @@ set -e get_option () { - local section=$1 - local option=$2 - local default=$3 - ret=$(/usr/bin/my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2-) - [ -z $ret ] && ret=$default - echo $ret + local section=$1 + local option=$2 + local default=$3 + ret=$(my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2-) + [ -z $ret ] && ret=$default + echo $ret } if [ "${1:0:1}" = '-' ]; then @@ -17,8 +17,8 @@ fi if [ "$1" = 'mysqld' ]; then # Get config DATADIR="$("$@" --verbose --help 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')" - SOCKET=$(get_option mysqld socket "$datadir/mysql.sock") - PIDFILE=$(get_option mysqld pid-file "/var/run/mysqld/mysqld.pid") + SOCKET=$(get_option mysqld socket "$datadir/mysql.sock") + PIDFILE=$(get_option mysqld pid-file "/var/run/mysqld/mysqld.pid") if [ ! -d "$DATADIR/mysql" ]; then if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" ]; then @@ -29,6 +29,8 @@ if [ "$1" = 'mysqld' ]; then if [ ! -d "$DATADIR" ]; then mkdir -p $DATADIR fi + chown -R mysql:mysql "$DATADIR" + # Workaround for bug related to --verbose --help rm $DATADIR/ib_logfile0 rm $DATADIR/ib_logfile1 @@ -36,21 +38,23 @@ if [ "$1" = 'mysqld' ]; then echo 'Initializing database' mysqld --initialize-insecure=on --user=mysql --datadir=$DATADIR echo 'Finished database init' + mysqld --user=mysql --datadir=$DATADIR --skip-networking & - for i in $(seq 30 -1 0); do - [ -S $SOCKET ] && break - echo 'MySQL init process in progress...' - sleep 1 + for i in $(seq 30 -1 0); do + [ -S $SOCKET ] && break + echo 'MySQL init process in progress...' + sleep 1 done - if [ $i = 0 ]; then - echo >&2 'MySQL init process failed.' - exit 1 - fi - + + if [ $i = 0 ]; then + echo >&2 'MySQL init process failed.' + exit 1 + fi + # These statements _must_ be on individual lines, and _must_ end with # semicolons (no line breaks or comments are permitted). # TODO proper SQL escaping on ALL the things D: - + tempSqlFile=$(mktemp /tmp/mysql-first-time.XXXXXX.sql) cat > "$tempSqlFile" <<-EOSQL DELETE FROM mysql.user ; @@ -58,39 +62,36 @@ if [ "$1" = 'mysqld' ]; then GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION ; DROP DATABASE IF EXISTS test ; EOSQL - + if [ "$MYSQL_DATABASE" ]; then echo "CREATE DATABASE IF NOT EXISTS \`"$MYSQL_DATABASE"\` ;" >> "$tempSqlFile" fi - + if [ "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then echo "CREATE USER '"$MYSQL_USER"'@'%' IDENTIFIED BY '"$MYSQL_PASSWORD"' ;" >> "$tempSqlFile" - + if [ "$MYSQL_DATABASE" ]; then echo "GRANT ALL ON \`"$MYSQL_DATABASE"\`.* TO '"$MYSQL_USER"'@'%' ;" >> "$tempSqlFile" fi fi - + echo 'FLUSH PRIVILEGES ;' >> "$tempSqlFile" - - chown -R mysql:mysql "$DATADIR" + mysql -uroot < $tempSqlFile sed -i -e '/^log-error/d' /etc/my.cnf cat /etc/my.cnf rm -f $tempSqlFile kill $(cat $PIDFILE) - # Wait to ensure server is stopped (below check doesn't work right for 5.7.5) - sleep 10 - for i in $(seq 30 -1 0); do - [ -S $SOCKET ] || break - echo 'MySQL init process in progress...' - sleep 1 + for i in $(seq 30 -1 0); do + [ -S $SOCKET ] || break + echo 'MySQL init process in progress...' + sleep 1 done - if [ $i = 0 ]; then - echo >&2 'MySQL hangs during init process.' - exit 1 - fi + if [ $i = 0 ]; then + echo >&2 'MySQL hangs during init process.' + exit 1 + fi echo 'MySQL init process done. Ready for start up.' fi fi From 4cef759d5c4d1ed11f160148989e6d7fa714792e Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 17 Mar 2015 09:19:10 +0100 Subject: [PATCH 005/386] - Check if junk files are present before trying to delete - Check presence of pid-file instead of socket to see if server has shut down --- 5.5/docker-entrypoint.sh | 2 +- 5.6/docker-entrypoint.sh | 2 +- 5.7/docker-entrypoint.sh | 14 ++++++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/5.5/docker-entrypoint.sh b/5.5/docker-entrypoint.sh index 760542448..47810905a 100755 --- a/5.5/docker-entrypoint.sh +++ b/5.5/docker-entrypoint.sh @@ -77,7 +77,7 @@ if [ "$1" = 'mysqld' ]; then rm -f $tempSqlFile kill $(cat $PIDFILE) for i in $(seq 30 -1 0); do - [ -S $SOCKET ] || break + [ -f "$PIDFILE" ] || break echo 'MySQL init process in progress...' sleep 1 done diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index 00a8b8990..eaed34718 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -77,7 +77,7 @@ if [ "$1" = 'mysqld' ]; then rm -f $tempSqlFile kill $(cat $PIDFILE) for i in $(seq 30 -1 0); do - [ -S $SOCKET ] || break + [ -f "$PIDFILE" ] || break echo 'MySQL init process in progress...' sleep 1 done diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 34bd9994f..7e8d3bd70 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -32,9 +32,15 @@ if [ "$1" = 'mysqld' ]; then chown -R mysql:mysql "$DATADIR" # Workaround for bug related to --verbose --help - rm $DATADIR/ib_logfile0 - rm $DATADIR/ib_logfile1 - rm $DATADIR/ibdata1 + if [ -f "$DATADIR/ib_logfile0" ]; then + rm $DATADIR/ib_logfile0 + fi + if [ -f "$DATADIR/ib_logfile1" ]; then + rm $DATADIR/ib_logfile1 + fi + if [ -f "$DATADIR/ibdata1" ]; then + rm $DATADIR/ibdata1 + fi echo 'Initializing database' mysqld --initialize-insecure=on --user=mysql --datadir=$DATADIR echo 'Finished database init' @@ -84,7 +90,7 @@ if [ "$1" = 'mysqld' ]; then kill $(cat $PIDFILE) for i in $(seq 30 -1 0); do - [ -S $SOCKET ] || break + [ -f "$PIDFILE" ] || break echo 'MySQL init process in progress...' sleep 1 done From 1a3490b68fb908c0d08d52146a9115a03720288c Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 17 Mar 2015 15:49:14 +0100 Subject: [PATCH 006/386] Removed routing of error logging to std out --- 5.7/docker-entrypoint.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 7e8d3bd70..c494f9324 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -84,8 +84,7 @@ if [ "$1" = 'mysqld' ]; then echo 'FLUSH PRIVILEGES ;' >> "$tempSqlFile" mysql -uroot < $tempSqlFile - sed -i -e '/^log-error/d' /etc/my.cnf - cat /etc/my.cnf + rm -f $tempSqlFile kill $(cat $PIDFILE) From 054220929bffe031389a591597f31ea113a4d71d Mon Sep 17 00:00:00 2001 From: Roberto Polli Date: Thu, 2 Apr 2015 16:03:37 +0200 Subject: [PATCH 007/386] fix issue with fabric: http://bugs.mysql.com/bug.php?id=72281 Signed-off-by: Roberto Polli --- 5.6/docker-entrypoint.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index eaed34718..b3148e217 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -52,6 +52,8 @@ if [ "$1" = 'mysqld' ]; then tempSqlFile=$(mktemp /tmp/mysql-first-time.XXXXXX.sql) cat > "$tempSqlFile" <<-EOSQL + -- What's done in this file shouldn't be replicated + SET @@SESSION.SQL_LOG_BIN=0; DELETE FROM mysql.user ; CREATE USER 'root'@'%' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}' ; GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION ; From bc3e14ea465861af000d0b124a851ebc00772f7d Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Wed, 8 Apr 2015 07:42:19 +0200 Subject: [PATCH 008/386] Add change from #1 to other entrypoint scripts --- 5.5/docker-entrypoint.sh | 2 ++ 5.7/docker-entrypoint.sh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/5.5/docker-entrypoint.sh b/5.5/docker-entrypoint.sh index 47810905a..a69e220cf 100755 --- a/5.5/docker-entrypoint.sh +++ b/5.5/docker-entrypoint.sh @@ -52,6 +52,8 @@ if [ "$1" = 'mysqld' ]; then tempSqlFile=$(mktemp /tmp/mysql-first-time.XXXXXX.sql) cat > "$tempSqlFile" <<-EOSQL + -- What's done in this file shouldn't be replicated + SET @@SESSION.SQL_LOG_BIN=0; DELETE FROM mysql.user ; CREATE USER 'root'@'%' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}' ; GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION ; diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index c494f9324..4e453a6aa 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -63,6 +63,8 @@ if [ "$1" = 'mysqld' ]; then tempSqlFile=$(mktemp /tmp/mysql-first-time.XXXXXX.sql) cat > "$tempSqlFile" <<-EOSQL + -- What's done in this file shouldn't be replicated + SET @@SESSION.SQL_LOG_BIN=0; DELETE FROM mysql.user ; CREATE USER 'root'@'%' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}' ; GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION ; From 6883f95eac29ea8a6359f6e6891613027de31267 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Wed, 8 Apr 2015 07:56:00 +0200 Subject: [PATCH 009/386] Update to 5.5.43 and 5.6.24 --- 5.5/Dockerfile | 2 +- 5.6/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/5.5/Dockerfile b/5.5/Dockerfile index 666a0546c..f8f906718 100644 --- a/5.5/Dockerfile +++ b/5.5/Dockerfile @@ -3,7 +3,7 @@ FROM oraclelinux:latest ## -- The environment variables set using ENV will persist when a container ## -- is run from the resulting image. -- ## -ENV PACKAGE_URL='https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.42-2.el7.x86_64.rpm' +ENV PACKAGE_URL='https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.43-2.el7.x86_64.rpm' # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ diff --git a/5.6/Dockerfile b/5.6/Dockerfile index d230cd75e..a7d1741c9 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -3,7 +3,7 @@ FROM oraclelinux:latest ## -- The environment variables set using ENV will persist when a container ## -- is run from the resulting image. -- ## -ENV PACKAGE_URL='https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.23-2.el7.x86_64.rpm' +ENV PACKAGE_URL='https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.24-2.el7.x86_64.rpm' # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From 34227a31ae89686a52c4a4df302a57e2513c290c Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Wed, 8 Apr 2015 14:17:42 +0200 Subject: [PATCH 010/386] Updated to 5.7.7 RC --- 5.7/Dockerfile | 2 +- 5.7/docker-entrypoint.sh | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/5.7/Dockerfile b/5.7/Dockerfile index 6eb71d5d3..41d862897 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -3,7 +3,7 @@ FROM oraclelinux:latest ## -- The environment variables set using ENV will persist when a container ## -- is run from the resulting image. -- ## -ENV PACKAGE_URL=http://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.6-0.3.m16.el7.x86_64.rpm +ENV PACKAGE_URL=http://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.7-0.3.rc.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 4e453a6aa..bf3a9328b 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -41,6 +41,9 @@ if [ "$1" = 'mysqld' ]; then if [ -f "$DATADIR/ibdata1" ]; then rm $DATADIR/ibdata1 fi + if [ -f "$DATADIR/ib_buffer_pool" ]; then + rm $DATADIR/ib_buffer_pool + fi echo 'Initializing database' mysqld --initialize-insecure=on --user=mysql --datadir=$DATADIR echo 'Finished database init' From d7d54b7082c048398876ef792074b498d51240a2 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Thu, 9 Apr 2015 12:53:12 +0200 Subject: [PATCH 011/386] Changed ENV format to work with older versions of Docker Added note about bug reporting to README --- 5.5/Dockerfile | 2 +- 5.6/Dockerfile | 2 +- 5.7/Dockerfile | 2 +- README.md | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/5.5/Dockerfile b/5.5/Dockerfile index f8f906718..a9efec6fa 100644 --- a/5.5/Dockerfile +++ b/5.5/Dockerfile @@ -3,7 +3,7 @@ FROM oraclelinux:latest ## -- The environment variables set using ENV will persist when a container ## -- is run from the resulting image. -- ## -ENV PACKAGE_URL='https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.43-2.el7.x86_64.rpm' +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.43-2.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ diff --git a/5.6/Dockerfile b/5.6/Dockerfile index a7d1741c9..df3641e00 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -3,7 +3,7 @@ FROM oraclelinux:latest ## -- The environment variables set using ENV will persist when a container ## -- is run from the resulting image. -- ## -ENV PACKAGE_URL='https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.24-2.el7.x86_64.rpm' +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.24-2.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ diff --git a/5.7/Dockerfile b/5.7/Dockerfile index 41d862897..414bf8eb7 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -3,7 +3,7 @@ FROM oraclelinux:latest ## -- The environment variables set using ENV will persist when a container ## -- is run from the resulting image. -- ## -ENV PACKAGE_URL=http://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.7-0.3.rc.el7.x86_64.rpm +ENV PACKAGE_URL http://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.7-0.3.rc.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ diff --git a/README.md b/README.md index 655c773ff..20522ec32 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ # About this Repo This is the Git repo for Dockerfiles and scripts for MySQL products, maintained by the MySQL team. + +For bugs and issues, please submit a bug report at bugs.mysql.com under the category “MySQL Package Repos and Docker Images”. From aed197ab65a95fb55eedfa635170a7551f745e0f Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 2 Jun 2015 08:33:52 +0200 Subject: [PATCH 012/386] Version updates * Updated to 5.5.44 * Updated to 5.6.25 --- 5.5/Dockerfile | 2 +- 5.6/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/5.5/Dockerfile b/5.5/Dockerfile index a9efec6fa..cc1a3574d 100644 --- a/5.5/Dockerfile +++ b/5.5/Dockerfile @@ -3,7 +3,7 @@ FROM oraclelinux:latest ## -- The environment variables set using ENV will persist when a container ## -- is run from the resulting image. -- ## -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.43-2.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.44-2.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ diff --git a/5.6/Dockerfile b/5.6/Dockerfile index df3641e00..10a57c523 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -3,7 +3,7 @@ FROM oraclelinux:latest ## -- The environment variables set using ENV will persist when a container ## -- is run from the resulting image. -- ## -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.24-2.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.25-2.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From dda9ce89c417e8b0535f0662509d5cc60583ac9d Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 2 Jun 2015 09:53:40 +0200 Subject: [PATCH 013/386] Use --innodb-read-only to avoid writing junk files when parsing verbose help output to get datadir --- 5.7/docker-entrypoint.sh | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index bf3a9328b..8aa907e04 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -16,7 +16,7 @@ fi if [ "$1" = 'mysqld' ]; then # Get config - DATADIR="$("$@" --verbose --help 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')" + DATADIR="$("$@" --verbose --help --innodb-read-only 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')" SOCKET=$(get_option mysqld socket "$datadir/mysql.sock") PIDFILE=$(get_option mysqld pid-file "/var/run/mysqld/mysqld.pid") @@ -31,19 +31,6 @@ if [ "$1" = 'mysqld' ]; then fi chown -R mysql:mysql "$DATADIR" - # Workaround for bug related to --verbose --help - if [ -f "$DATADIR/ib_logfile0" ]; then - rm $DATADIR/ib_logfile0 - fi - if [ -f "$DATADIR/ib_logfile1" ]; then - rm $DATADIR/ib_logfile1 - fi - if [ -f "$DATADIR/ibdata1" ]; then - rm $DATADIR/ibdata1 - fi - if [ -f "$DATADIR/ib_buffer_pool" ]; then - rm $DATADIR/ib_buffer_pool - fi echo 'Initializing database' mysqld --initialize-insecure=on --user=mysql --datadir=$DATADIR echo 'Finished database init' From 7f9f87c043c7028a90d3874748b031b176d378fc Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Thu, 11 Jun 2015 08:28:20 +0200 Subject: [PATCH 014/386] More consistent variable quoting --- 5.5/docker-entrypoint.sh | 18 +++++++++--------- 5.6/docker-entrypoint.sh | 18 +++++++++--------- 5.7/docker-entrypoint.sh | 18 +++++++++--------- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/5.5/docker-entrypoint.sh b/5.5/docker-entrypoint.sh index a69e220cf..dc1ef3734 100755 --- a/5.5/docker-entrypoint.sh +++ b/5.5/docker-entrypoint.sh @@ -6,7 +6,7 @@ get_option () { local option=$2 local default=$3 ret=$(my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2-) - [ -z $ret ] && ret=$default + [ -z "$ret" ] && ret=$default echo $ret } @@ -27,17 +27,17 @@ if [ "$1" = 'mysqld' ]; then exit 1 fi if [ ! -d "$DATADIR" ]; then - mkdir -p $DATADIR + mkdir -p "$DATADIR" fi chown -R mysql:mysql "$DATADIR" echo 'Running mysql_install_db' - mysql_install_db --user=mysql --datadir=$DATADIR --rpm + mysql_install_db --user=mysql --datadir="$DATADIR" --rpm echo 'Finished mysql_install_db' - mysqld --user=mysql --datadir=$DATADIR --skip-networking & + mysqld --user=mysql --datadir="$DATADIR" --skip-networking & for i in $(seq 30 -1 0); do - [ -S $SOCKET ] && break + [ -S "$SOCKET" ] && break echo 'MySQL init process in progress...' sleep 1 done @@ -61,7 +61,7 @@ if [ "$1" = 'mysqld' ]; then EOSQL if [ "$MYSQL_DATABASE" ]; then - echo "CREATE DATABASE IF NOT EXISTS \`"$MYSQL_DATABASE"\` ;" >> "$tempSqlFile" + echo "CREATE DATABASE IF NOT EXISTS \`$MYSQL_DATABASE\` ;" >> "$tempSqlFile" fi if [ "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then @@ -74,10 +74,10 @@ if [ "$1" = 'mysqld' ]; then echo 'FLUSH PRIVILEGES ;' >> "$tempSqlFile" - mysql -uroot < $tempSqlFile + mysql -uroot < "$tempSqlFile" - rm -f $tempSqlFile - kill $(cat $PIDFILE) + rm -f "$tempSqlFile" + kill $(cat "$PIDFILE") for i in $(seq 30 -1 0); do [ -f "$PIDFILE" ] || break echo 'MySQL init process in progress...' diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index b3148e217..8a3a47271 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -6,7 +6,7 @@ get_option () { local option=$2 local default=$3 ret=$(my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2-) - [ -z $ret ] && ret=$default + [ -z "$ret" ] && ret=$default echo $ret } @@ -27,17 +27,17 @@ if [ "$1" = 'mysqld' ]; then exit 1 fi if [ ! -d "$DATADIR" ]; then - mkdir -p $DATADIR + mkdir -p "$DATADIR" fi chown -R mysql:mysql "$DATADIR" echo 'Running mysql_install_db' - mysql_install_db --user=mysql --datadir=$DATADIR --rpm --keep-my-cnf + mysql_install_db --user=mysql --datadir="$DATADIR" --rpm --keep-my-cnf echo 'Finished mysql_install_db' - mysqld --user=mysql --datadir=$DATADIR --skip-networking & + mysqld --user=mysql --datadir="$DATADIR" --skip-networking & for i in $(seq 30 -1 0); do - [ -S $SOCKET ] && break + [ -S "$SOCKET" ] && break echo 'MySQL init process in progress...' sleep 1 done @@ -61,7 +61,7 @@ if [ "$1" = 'mysqld' ]; then EOSQL if [ "$MYSQL_DATABASE" ]; then - echo "CREATE DATABASE IF NOT EXISTS \`"$MYSQL_DATABASE"\` ;" >> "$tempSqlFile" + echo "CREATE DATABASE IF NOT EXISTS \`$MYSQL_DATABASE\` ;" >> "$tempSqlFile" fi if [ "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then @@ -74,10 +74,10 @@ if [ "$1" = 'mysqld' ]; then echo 'FLUSH PRIVILEGES ;' >> "$tempSqlFile" - mysql -uroot < $tempSqlFile + mysql -uroot < "$tempSqlFile" - rm -f $tempSqlFile - kill $(cat $PIDFILE) + rm -f "$tempSqlFile" + kill $(cat "$PIDFILE") for i in $(seq 30 -1 0); do [ -f "$PIDFILE" ] || break echo 'MySQL init process in progress...' diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 8aa907e04..977a96ac6 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -6,7 +6,7 @@ get_option () { local option=$2 local default=$3 ret=$(my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2-) - [ -z $ret ] && ret=$default + [ -z "$ret" ] && ret=$default echo $ret } @@ -27,17 +27,17 @@ if [ "$1" = 'mysqld' ]; then exit 1 fi if [ ! -d "$DATADIR" ]; then - mkdir -p $DATADIR + mkdir -p "$DATADIR" fi chown -R mysql:mysql "$DATADIR" echo 'Initializing database' - mysqld --initialize-insecure=on --user=mysql --datadir=$DATADIR + mysqld --initialize-insecure=on --user=mysql --datadir="$DATADIR" echo 'Finished database init' - mysqld --user=mysql --datadir=$DATADIR --skip-networking & + mysqld --user=mysql --datadir="$DATADIR" --skip-networking & for i in $(seq 30 -1 0); do - [ -S $SOCKET ] && break + [ -S "$SOCKET" ] && break echo 'MySQL init process in progress...' sleep 1 done @@ -62,7 +62,7 @@ if [ "$1" = 'mysqld' ]; then EOSQL if [ "$MYSQL_DATABASE" ]; then - echo "CREATE DATABASE IF NOT EXISTS \`"$MYSQL_DATABASE"\` ;" >> "$tempSqlFile" + echo "CREATE DATABASE IF NOT EXISTS \`$MYSQL_DATABASE\` ;" >> "$tempSqlFile" fi if [ "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then @@ -75,10 +75,10 @@ if [ "$1" = 'mysqld' ]; then echo 'FLUSH PRIVILEGES ;' >> "$tempSqlFile" - mysql -uroot < $tempSqlFile + mysql -uroot < "$tempSqlFile" - rm -f $tempSqlFile - kill $(cat $PIDFILE) + rm -f "$tempSqlFile" + kill $(cat "$PIDFILE") for i in $(seq 30 -1 0); do [ -f "$PIDFILE" ] || break From 4b6dee8310141b580f673e43f23b79b73103971a Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Thu, 11 Jun 2015 08:29:26 +0200 Subject: [PATCH 015/386] Removed unnecessary directory check --- 5.5/docker-entrypoint.sh | 4 +--- 5.6/docker-entrypoint.sh | 4 +--- 5.7/docker-entrypoint.sh | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/5.5/docker-entrypoint.sh b/5.5/docker-entrypoint.sh index dc1ef3734..ee35f17b0 100755 --- a/5.5/docker-entrypoint.sh +++ b/5.5/docker-entrypoint.sh @@ -26,9 +26,7 @@ if [ "$1" = 'mysqld' ]; then echo >&2 ' Did you forget to add -e MYSQL_ROOT_PASSWORD=... ?' exit 1 fi - if [ ! -d "$DATADIR" ]; then - mkdir -p "$DATADIR" - fi + mkdir -p "$DATADIR" chown -R mysql:mysql "$DATADIR" echo 'Running mysql_install_db' diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index 8a3a47271..6373b288b 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -26,9 +26,7 @@ if [ "$1" = 'mysqld' ]; then echo >&2 ' Did you forget to add -e MYSQL_ROOT_PASSWORD=... ?' exit 1 fi - if [ ! -d "$DATADIR" ]; then - mkdir -p "$DATADIR" - fi + mkdir -p "$DATADIR" chown -R mysql:mysql "$DATADIR" echo 'Running mysql_install_db' diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 977a96ac6..adc6b0751 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -26,9 +26,7 @@ if [ "$1" = 'mysqld' ]; then echo >&2 ' Did you forget to add -e MYSQL_ROOT_PASSWORD=... ?' exit 1 fi - if [ ! -d "$DATADIR" ]; then - mkdir -p "$DATADIR" - fi + mkdir -p "$DATADIR" chown -R mysql:mysql "$DATADIR" echo 'Initializing database' From 6cc10f642185f37bf26307f9ddb090df748d3510 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 4 Aug 2015 11:35:02 +0200 Subject: [PATCH 016/386] Updated to versions 5.5.45, 5.6.26 and 5.7.8 --- 5.5/Dockerfile | 3 +-- 5.6/Dockerfile | 2 +- 5.7/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/5.5/Dockerfile b/5.5/Dockerfile index cc1a3574d..dcfebccb3 100644 --- a/5.5/Dockerfile +++ b/5.5/Dockerfile @@ -2,8 +2,7 @@ FROM oraclelinux:latest ## -- The environment variables set using ENV will persist when a container ## -- is run from the resulting image. -- ## - -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.44-2.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.45-2.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ diff --git a/5.6/Dockerfile b/5.6/Dockerfile index 10a57c523..9c035f909 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -3,7 +3,7 @@ FROM oraclelinux:latest ## -- The environment variables set using ENV will persist when a container ## -- is run from the resulting image. -- ## -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.25-2.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.26-2.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ diff --git a/5.7/Dockerfile b/5.7/Dockerfile index 414bf8eb7..444e10e16 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -3,7 +3,7 @@ FROM oraclelinux:latest ## -- The environment variables set using ENV will persist when a container ## -- is run from the resulting image. -- ## -ENV PACKAGE_URL http://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.7-0.3.rc.el7.x86_64.rpm +ENV PACKAGE_URL http://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.8-0.3.rc.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From 96b7fa6cef74f2cb1e2e0fe27349744126f17aee Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Thu, 13 Aug 2015 13:39:09 +0200 Subject: [PATCH 017/386] Added some very simple sanity check scripts for updating to new server versions --- test/README.md | 2 ++ test/testbuild.sh | 30 +++++++++++++++++++++++++ test/testserver.sh | 56 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 88 insertions(+) create mode 100644 test/README.md create mode 100755 test/testbuild.sh create mode 100755 test/testserver.sh diff --git a/test/README.md b/test/README.md new file mode 100644 index 000000000..4ffe43472 --- /dev/null +++ b/test/README.md @@ -0,0 +1,2 @@ +Some simple test scripts to check the image is built and running the correct version. Used during release +Run from the project root directory diff --git a/test/testbuild.sh b/test/testbuild.sh new file mode 100755 index 000000000..7d9b8b6bc --- /dev/null +++ b/test/testbuild.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +VERSION=$1 +DIRECTORY=$2 + +echo "Building image mysql/mysql-server:$VERSION" +docker build -t mysql/mysql-server:$VERSION $DIRECTORY +RES=$? +if [ $RES -eq 0 ]; +then + echo "Image built" +else + echo "Image build failed" + exit 0 +fi + + +IMAGELIST=$(docker images | grep $VERSION) +docker rmi "mysql/mysql-server:$VERSION" || : +versionregex="mysql/mysql-server $VERSION" +if [[ $IMAGELIST =~ $versionregex ]]; +then + echo "Test passed" + exit 0 +else + echo "Test failed. Image not in list" + exit 1 +fi + + diff --git a/test/testserver.sh b/test/testserver.sh new file mode 100755 index 000000000..9fed1c312 --- /dev/null +++ b/test/testserver.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +VERSION="$1" +SERVERSTART=0 +SERVERCONNECT=0 +SUCCESS=false +echo "Starting image with MySQL version $VERSION" +docker run -e MYSQL_ROOT_PASSWORD=rot --name=testserver -p 3306:3306 -d mysql/mysql-server:$VERSION +RES=$? +if [ ! $RES = 0 ]; then + echo "Server start failed with error code $RES" +else + SERVERSTART=1 +fi +echo "Connecting to server..." +if [ $SERVERSTART ]; +then + for i in $(seq 30 -1 0); do + OUTPUT="$(mysql -uroot -prot -h127.0.0.1 -P3306 < 'test/sql_version.sql')" + RES=$? + if [ $RES -eq 0 ]; then + SERVERCONNECT=1 + break + fi + sleep 1 + done + if [ $i = 0 ]; then + echo >&2 "Unable to connect to server." + fi +fi + +if [ $SERVERCONNECT ]; +then + versionregex="version $VERSION" + if [[ $OUTPUT =~ $versionregex ]]; + then + echo "Version check ok" + SUCCESS=true + else + echo "Expected to see version $VERSION. Actual output: $OUTPUT" + fi +fi + +echo "Running cleanup." +docker kill testserver +docker rm testserver +echo "Cleanup complete." +if [ $SUCCESS == true ]; +then + echo "Test passed" + exit 0 +else + echo "Test failed" + exit 1 +fi + From 1b0df6933d6a9a4bacb19b6771f295f8db34669e Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Fri, 21 Aug 2015 08:09:14 +0200 Subject: [PATCH 018/386] Update package url for new rpms --- 5.5/Dockerfile | 2 +- 5.6/Dockerfile | 2 +- 5.7/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/5.5/Dockerfile b/5.5/Dockerfile index cfa3b9afd..f92a63a2c 100644 --- a/5.5/Dockerfile +++ b/5.5/Dockerfile @@ -1,6 +1,6 @@ FROM oraclelinux:latest -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.45-2.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.45-3.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ diff --git a/5.6/Dockerfile b/5.6/Dockerfile index 149eb867a..9692406d8 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -1,6 +1,6 @@ FROM oraclelinux:latest -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.26-2.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.26-3.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ diff --git a/5.7/Dockerfile b/5.7/Dockerfile index 29cff46ba..561a180f3 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -1,6 +1,6 @@ FROM oraclelinux:latest -ENV PACKAGE_URL http://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.8-0.3.rc.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.8-0.4.rc.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From 23c46e288eea70c4e0cfa4f509799da5935330de Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Mon, 24 Aug 2015 10:21:52 +0200 Subject: [PATCH 019/386] Fixed support for empty password - Script was applying -p even if MYSQL_ROOT_PASSWORD wasn't set, causing init to fail --- 5.5/docker-entrypoint.sh | 4 +++- 5.6/docker-entrypoint.sh | 4 +++- 5.7/docker-entrypoint.sh | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/5.5/docker-entrypoint.sh b/5.5/docker-entrypoint.sh index eaaeb7fda..2eaba7a6f 100755 --- a/5.5/docker-entrypoint.sh +++ b/5.5/docker-entrypoint.sh @@ -52,7 +52,9 @@ if [ "$1" = 'mysqld' ]; then DROP DATABASE IF EXISTS test ; FLUSH PRIVILEGES ; EOSQL - mysql+=( -p"${MYSQL_ROOT_PASSWORD}" ) + if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then + mysql+=( -p"${MYSQL_ROOT_PASSWORD}" ) + fi if [ "$MYSQL_DATABASE" ]; then echo "CREATE DATABASE IF NOT EXISTS \`$MYSQL_DATABASE\` ;" | "${mysql[@]}" diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index 9a4ed57d2..e59d53f47 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -53,7 +53,9 @@ if [ "$1" = 'mysqld' ]; then DROP DATABASE IF EXISTS test ; FLUSH PRIVILEGES ; EOSQL - mysql+=( -p"${MYSQL_ROOT_PASSWORD}" ) + if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then + mysql+=( -p"${MYSQL_ROOT_PASSWORD}" ) + fi if [ "$MYSQL_DATABASE" ]; then echo "CREATE DATABASE IF NOT EXISTS \`$MYSQL_DATABASE\` ;" | "${mysql[@]}" diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 80a90c4f2..c01ed9efd 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -52,7 +52,9 @@ if [ "$1" = 'mysqld' ]; then DROP DATABASE IF EXISTS test ; FLUSH PRIVILEGES ; EOSQL - mysql+=( -p"${MYSQL_ROOT_PASSWORD}" ) + if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then + mysql+=( -p"${MYSQL_ROOT_PASSWORD}" ) + fi if [ "$MYSQL_DATABASE" ]; then echo "CREATE DATABASE IF NOT EXISTS \`$MYSQL_DATABASE\` ;" | "${mysql[@]}" From f59758aec8d4c8e3dffc7b2dabde4a9f2a49cf71 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Wed, 9 Sep 2015 10:28:31 +0200 Subject: [PATCH 020/386] Test script fix --- test/cleanup.sh | 9 +++++++++ test/testbuild.sh | 1 - test/testserver.sh | 4 ---- 3 files changed, 9 insertions(+), 5 deletions(-) create mode 100755 test/cleanup.sh diff --git a/test/cleanup.sh b/test/cleanup.sh new file mode 100755 index 000000000..9c6d578aa --- /dev/null +++ b/test/cleanup.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +VERSION=$1 +echo "Running cleanup" +docker kill testserver +docker rm testserver +docker rmi "mysql/mysql-server:$VERSION" +echo "Cleanup complete" + diff --git a/test/testbuild.sh b/test/testbuild.sh index 7d9b8b6bc..94eaea0d0 100755 --- a/test/testbuild.sh +++ b/test/testbuild.sh @@ -16,7 +16,6 @@ fi IMAGELIST=$(docker images | grep $VERSION) -docker rmi "mysql/mysql-server:$VERSION" || : versionregex="mysql/mysql-server $VERSION" if [[ $IMAGELIST =~ $versionregex ]]; then diff --git a/test/testserver.sh b/test/testserver.sh index 9fed1c312..0c1a2f03d 100755 --- a/test/testserver.sh +++ b/test/testserver.sh @@ -41,10 +41,6 @@ then fi fi -echo "Running cleanup." -docker kill testserver -docker rm testserver -echo "Cleanup complete." if [ $SUCCESS == true ]; then echo "Test passed" From aede72aba5468a06aa1f2280d5b1317a3fecd4dd Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Wed, 9 Sep 2015 10:35:09 +0200 Subject: [PATCH 021/386] Added missing test sql --- test/sql_version.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 test/sql_version.sql diff --git a/test/sql_version.sql b/test/sql_version.sql new file mode 100644 index 000000000..4ce0ef2d1 --- /dev/null +++ b/test/sql_version.sql @@ -0,0 +1 @@ +show variables like 'version'; From 600885338cfd58b6c9ba037828555f0180f83d38 Mon Sep 17 00:00:00 2001 From: Gipson Pulla Date: Thu, 1 Oct 2015 08:25:36 +0200 Subject: [PATCH 022/386] Updated 5.5 to 5.5.46 --- 5.5/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.5/Dockerfile b/5.5/Dockerfile index f92a63a2c..76e47a7f1 100644 --- a/5.5/Dockerfile +++ b/5.5/Dockerfile @@ -1,6 +1,6 @@ FROM oraclelinux:latest -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.45-3.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.46-2.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From e860e46e05708b744282521cce56b94577d29fa8 Mon Sep 17 00:00:00 2001 From: Hery Ramilison Date: Fri, 2 Oct 2015 11:27:52 +0200 Subject: [PATCH 023/386] Updated 5.6 to 5.6.27 --- 5.6/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.6/Dockerfile b/5.6/Dockerfile index 9692406d8..06c9d1ba6 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -1,6 +1,6 @@ FROM oraclelinux:latest -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.26-3.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.27-2.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From 59d2a1f88aafa2eae306ef7f89eff68689a8075b Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Thu, 22 Oct 2015 09:14:40 +0200 Subject: [PATCH 024/386] Updated 5.7 to 5.7.9 --- 5.7/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.7/Dockerfile b/5.7/Dockerfile index 561a180f3..d2ca8630f 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -1,6 +1,6 @@ FROM oraclelinux:latest -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.8-0.4.rc.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.9-1.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From 10f65e6775b939ea035c67184f4eff85cce5da2c Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Mon, 26 Oct 2015 11:31:30 +0100 Subject: [PATCH 025/386] Removed --innodb-read-only The option was added as a workaround for a server bug that caused file locks in datadir when mysqld --verbose --help is run. The bug has been fixed, so the workaround is no longer needed --- 5.7/docker-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index c01ed9efd..b493177eb 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -8,7 +8,7 @@ fi if [ "$1" = 'mysqld' ]; then # Get config - DATADIR="$("$@" --verbose --help --innodb-read-only 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')" + DATADIR="$("$@" --verbose --help 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')" if [ ! -d "$DATADIR/mysql" ]; then if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" ]; then From 07fbe135af656d0ef325e14b964b38f0b3a4491c Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 27 Oct 2015 09:01:14 +0100 Subject: [PATCH 026/386] Added workaround for MySQL Bug #78957 Adds --log-bin-index option to --verbose --help command to prevent errors when binary logging is enabled --- 5.7/docker-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index b493177eb..fdeef556c 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -8,7 +8,7 @@ fi if [ "$1" = 'mysqld' ]; then # Get config - DATADIR="$("$@" --verbose --help 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')" + DATADIR="$("$@" --verbose --help --log-bin-index=/tmp/tmp.index 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')" if [ ! -d "$DATADIR/mysql" ]; then if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" ]; then From fed8140e682b407b81775953e75aa1e74442e870 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Thu, 5 Nov 2015 08:05:50 +0100 Subject: [PATCH 027/386] Added security options * Added option for randomly generated root password * Added option to immediately expire root password --- 5.5/Dockerfile | 1 + 5.5/docker-entrypoint.sh | 14 +++++++++----- 5.6/Dockerfile | 1 + 5.6/docker-entrypoint.sh | 19 ++++++++++++++----- 5.7/Dockerfile | 2 +- 5.7/docker-entrypoint.sh | 18 +++++++++++++----- 6 files changed, 39 insertions(+), 16 deletions(-) diff --git a/5.5/Dockerfile b/5.5/Dockerfile index 76e47a7f1..93e5c72d0 100644 --- a/5.5/Dockerfile +++ b/5.5/Dockerfile @@ -5,6 +5,7 @@ ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mys # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ && yum install -y $PACKAGE_URL \ + && yum install -y libpwquality \ && rm -rf /var/cache/yum/* RUN mkdir /docker-entrypoint-initdb.d diff --git a/5.5/docker-entrypoint.sh b/5.5/docker-entrypoint.sh index 2eaba7a6f..094f4ee02 100755 --- a/5.5/docker-entrypoint.sh +++ b/5.5/docker-entrypoint.sh @@ -11,11 +11,11 @@ if [ "$1" = 'mysqld' ]; then DATADIR="$("$@" --verbose --help 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')" if [ ! -d "$DATADIR/mysql" ]; then - if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" ]; then - echo >&2 'error: database is uninitialized and MYSQL_ROOT_PASSWORD not set' - echo >&2 ' Did you forget to add -e MYSQL_ROOT_PASSWORD=... ?' - exit 1 - fi + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 'error: database is uninitialized and password option is not specified ' + echo >&2 ' You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD' + exit 1 + fi mkdir -p "$DATADIR" chown -R mysql:mysql "$DATADIR" @@ -42,6 +42,10 @@ if [ "$1" = 'mysqld' ]; then mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(pwmake 128)" + echo "GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + fi "${mysql[@]}" <<-EOSQL -- What's done in this file shouldn't be replicated -- or products like mysql-fabric won't work diff --git a/5.6/Dockerfile b/5.6/Dockerfile index 06c9d1ba6..d5bcff063 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -5,6 +5,7 @@ ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mys # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ && yum install -y $PACKAGE_URL \ + && yum install -y libpwquality \ && rm -rf /var/cache/yum/* RUN mkdir /docker-entrypoint-initdb.d diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index e59d53f47..fd1a7b870 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -11,11 +11,11 @@ if [ "$1" = 'mysqld' ]; then DATADIR="$("$@" --verbose --help 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')" if [ ! -d "$DATADIR/mysql" ]; then - if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" ]; then - echo >&2 'error: database is uninitialized and MYSQL_ROOT_PASSWORD not set' - echo >&2 ' Did you forget to add -e MYSQL_ROOT_PASSWORD=... ?' - exit 1 - fi + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 'error: database is uninitialized and password option is not specified ' + echo >&2 ' You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD' + exit 1 + fi mkdir -p "$DATADIR" chown -R mysql:mysql "$DATADIR" @@ -43,6 +43,10 @@ if [ "$1" = 'mysqld' ]; then # sed is for https://bugs.mysql.com/bug.php?id=20545 mysql_tzinfo_to_sql /usr/share/zoneinfo | sed 's/Local time zone must be set--see zic manual page/FCTY/' | "${mysql[@]}" mysql + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(pwmake 128)" + echo "GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + fi "${mysql[@]}" <<-EOSQL -- What's done in this file shouldn't be replicated -- or products like mysql-fabric won't work @@ -82,6 +86,11 @@ if [ "$1" = 'mysqld' ]; then echo done + if [ ! -z "$MYSQL_ONETIME_PASSWORD" ]; then + "${mysql[@]}" <<-EOSQL + ALTER USER 'root'@'%' PASSWORD EXPIRE; + EOSQL + fi if ! kill -s TERM "$pid" || ! wait "$pid"; then echo >&2 'MySQL init process failed.' exit 1 diff --git a/5.7/Dockerfile b/5.7/Dockerfile index d2ca8630f..f1ae493a5 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -1,10 +1,10 @@ FROM oraclelinux:latest - ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.9-1.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ && yum install -y $PACKAGE_URL \ + && yum install -y libpwquality \ && rm -rf /var/cache/yum/* RUN mkdir /docker-entrypoint-initdb.d diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index fdeef556c..6fb4b848f 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -11,9 +11,9 @@ if [ "$1" = 'mysqld' ]; then DATADIR="$("$@" --verbose --help --log-bin-index=/tmp/tmp.index 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')" if [ ! -d "$DATADIR/mysql" ]; then - if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" ]; then - echo >&2 'error: database is uninitialized and MYSQL_ROOT_PASSWORD not set' - echo >&2 ' Did you forget to add -e MYSQL_ROOT_PASSWORD=... ?' + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 'error: database is uninitialized and password option is not specified ' + echo >&2 ' You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD' exit 1 fi mkdir -p "$DATADIR" @@ -41,7 +41,11 @@ if [ "$1" = 'mysqld' ]; then fi mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql - + + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(pwmake 128)" + echo "GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + fi "${mysql[@]}" <<-EOSQL -- What's done in this file shouldn't be replicated -- or products like mysql-fabric won't work @@ -70,7 +74,6 @@ if [ "$1" = 'mysqld' ]; then echo 'FLUSH PRIVILEGES ;' | "${mysql[@]}" fi - echo for f in /docker-entrypoint-initdb.d/*; do case "$f" in @@ -81,6 +84,11 @@ if [ "$1" = 'mysqld' ]; then echo done + if [ ! -z "$MYSQL_ONETIME_PASSWORD" ]; then + "${mysql[@]}" <<-EOSQL + ALTER USER 'root'@'%' PASSWORD EXPIRE; + EOSQL + fi if ! kill -s TERM "$pid" || ! wait "$pid"; then echo >&2 'MySQL init process failed.' exit 1 From d4ca08149293070e1b94fc2e551f275960458f84 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 17 Nov 2015 12:15:53 +0100 Subject: [PATCH 028/386] Put image documentation in README.md --- README.md | 147 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 144 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 20522ec32..7c306d610 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,146 @@ -# About this Repo +# What is MySQL? -This is the Git repo for Dockerfiles and scripts for MySQL products, maintained by the MySQL team. +MySQL is the world's most popular open source database. With its proven performance, reliability and ease-of-use, MySQL has become the leading database choice for web-based applications, covering the entire range from personal projects and websites, via online shops and information services, all the way to high profile web properties including Facebook, Twitter, YouTube, Yahoo! and many more. -For bugs and issues, please submit a bug report at bugs.mysql.com under the category “MySQL Package Repos and Docker Images”. +For more information and related downloads for MySQL Server and other MySQL products, please visit http://www.mysql.com. + +# MySQL Server Docker Images + +These are optimized MySQL Server Docker images, created and maintained by the MySQL team at Oracle. The available versions are: + + MySQL Server 5.5 (tag: 5.5) + MySQL Server 5.6 (tag: 5.6) + MySQL Server 5.7, the latest GA version (tag: 5.7 or latest) + +Images are updated when new MySQL Server maintenance releases and development milestones are published. + +We also publish experimental early previews of MySQL Server from time to time. Please visit the [MySQL Labs Docker image page](https://hub.docker.com/r/mysql/mysql-labs/) to see what is available. + +# How to Use the MySQL Images + +## Start a MySQL Server Instance + +Start a MySQL instance as follows (but make sure you also read the section below on data persistence): + + docker run --name my-container-name -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql/mysql-server:tag + +... where `my-container-name` is the name you want to assign to your container, `my-secret-pw` is the password to be set for the MySQL root user and `tag` is the tag specifying the MySQL version you want. See the list above for relevant tags, or look at the [full list of tags](https://registry.hub.docker.com/u/mysql/mysql-server/tags/manage/). + +## Connect to MySQL from an Application in Another Docker Container + +This image exposes the standard MySQL port (3306), so container linking makes the MySQL instance available to other application containers. Start your application container like this in order to link it to the MySQL container: + + docker run --name app-container-name --link my-container-name:mysql -d app-that-uses-mysql + +## Connect to MySQL from the MySQL Command Line Client + +The following command starts another MySQL container instance and runs the `mysql` command line client against your original MySQL container, allowing you to execute SQL statements against your database: + + docker run -it --link my-container-name:mysql --rm mysql/mysql-server:tag sh -c 'exec mysql -h"$MYSQL_PORT_3306_TCP_ADDR" -P"$MYSQL_PORT_3306_TCP_PORT" -uroot -p"$MYSQL_ENV_MYSQL_ROOT_PASSWORD"' + +... where `my-container-name` is the name of your original MySQL Server container. + +More information about the MySQL command line client can be found in the MySQL reference documentation at http://dev.mysql.com/doc/refman/en/ + +## Container Shell Access and Viewing MySQL Log Files + +The `docker exec` command allows you to run commands inside a Docker container. The following command line will give you a bash shell inside your MySQL container: + + docker exec -it my-container-name bash + +The MySQL Server log is located at `/var/log/mysqld.log` inside the container, and the following command line from a shell inside the container will let you inspect it: + + more /var/log/mysqld.log + +# Environment Variables + +When you start the MySQL image, you can adjust the configuration of the MySQL instance by passing one or more environment variables on the `docker run` command line. Do note that none of the variables below will have any effect if you start the container with a data directory that already contains a database: any pre-existing database will always be left untouched on container startup. + +## `MYSQL_ROOT_PASSWORD` + +This variable is mandatory and specifies the password that will be set for the MySQL root superuser account. In the above example, it was set `to my-secret-pw`. + +## `MYSQL_DATABASE` + +This variable is optional and allows you to specify the name of a database to be created on image startup. If a user/password was supplied (see below) then that user will be granted superuser access (corresponding to GRANT ALL) to this database. + +## `MYSQL_USER`, `MYSQL_PASSWORD` + +These variables are optional, used in conjunction to create a new user and set that user's password. This user will be granted superuser permissions (see above) for the database specified by the `MYSQL_DATABASE` variable. Both variables are required for a user to be created. + +Do note that there is no need to use this mechanism to create the `root` superuser, that user gets created by default with the password specified by the `MYSQL_ROOT_PASSWORD`. variable. + +## `MYSQL_ALLOW_EMPTY_PASSWORD` + +Set to `yes` to allow the container to be started with a blank password for the root user. NOTE: Setting this variable to `yes` is not recommended unless you really know what you are doing, since this will leave your MySQL instance completely unprotected, allowing anyone to gain complete superuser access. + +# Notes, Tips, Gotchas + +## Where to Store Data + +Important note: There are basically two ways to store data used by applications that run in Docker containers. We encourage users of MySQL with Docker to familiarize themselves with the options available, including: + +* Let Docker manage the storage of your database data by writing the database files to disk on the host system using its own internal volume management. This is the default and is easy and fairly transparent to the user. The downside is that the files may be hard to locate for tools and applications that run directly on the host system, i.e. outside containers. +* Create a data directory on the host system (outside the container) and mount this to a directory visible from inside the container. This places the database files in a known location on the host system, and makes it easy for tools and applications on the host system to access the files. The downside is that the user needs to make sure that the directory exists, and that e.g. directory permissions and other security mechanisms on the host system are set up correctly. + +The Docker documentation is a good starting point for understanding the different storage options and variations, and there are multiple blog and forum postings that discuss and give advice in this area. We will simply show the basic procedure here for the latter option above: + +1. Create a data directory on a suitable volume on your host system, e.g. `/my/own/datadir`. +2. Start your MySQL container like this: + +``` + docker run --name my-container-name -v /my/own/datadir:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql/mysql-server:tag +``` + +The `-v /my/own/datadir:/var/lib/mysql` part of the command mounts the `/my/own/datadir` directory from the underlying host system as `/var/lib/mysql` inside the container, where MySQL by default will write its data files. + +Note that users on systems with SELinux enabled may experience problems with this. The current workaround is to assign the relevant SELinux policy type to the new data directory so that the container will be allowed to access it: + + chcon -Rt svirt_sandbox_file_t /my/own/datadir + +## Usage Against an Existing Database + +If you start your MySQL container instance with a data directory that already contains a database (specifically, a `mysql` subdirectory), the `$MYSQL_ROOT_PASSWORD` variable should be omitted from the `docker run` command line; it will in any case be ignored, and the pre-existing database will not be changed in any way. + +## Using a Custom MySQL Config File + +The MySQL startup configuration in these Docker images is specified in the file `/etc/my.cnf`. If you want to customize this configuration for your own purposes, you can create your alternative configuration file in a directory on the host machine and then mount this file in the appropriate location inside the MySQL container, effectively replacing the standard configuration file. + +If you want to base your changes on the standard configuration file, start your MySQL container in the standard way described above, then do: + + docker exec -it my-container-name cat /etc/my.cnf > /my/custom/config-file + +... where ´/my/custom/config-file´ is the path and name of the new configuration file. Then start a new MySQL container like this: + + docker run --name my-new-container-name -v /my/custom/config-file:/etc/my.cnf -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql/mysql-server:tag + +This will start a new MySQL container ´my-new-container-name´ where the MySQL instance uses the startup options specified in ´/my/custom/config-file´. + +Note that users on systems where SELinux is enabled may experience problems with this. The current workaround is to assign the relevant SELinux policy type to your new config file so that the container will be allowed to mount it: + + chcon -Rt svirt_sandbox_file_t /my/custom/config-file + +## Docker Optimized MySQL Install + +These Docker images are optimized for size, which means that we have reduced the contents to what is expected to be relevant for a large majority of users who run Docker based MySQL instances. The key differences compared to a default MySQL install are: + + All binaries are stripped, non-debug only + + Included binaries are limited to: + + /usr/bin/my_print_defaults + /usr/bin/mysql + /usr/bin/mysql_config + /usr/bin/mysql_install_db + /usr/bin/mysql_tzinfo_to_sql + /usr/bin/mysql_upgrade + /usr/bin/mysqldump + /usr/sbin/mysqld + +# Supported Docker Versions + +These images are officially supported by the MySQL team on Docker version 1.9. Support for older versions (down to 1.0) is provided on a best-effort basis, but we strongly recommend running on the most recent version, since that is assumed for parts of the documentation above. + +# User Feedback + +We welcome your feedback! For general comments or discussion, please drop us a line in the Comments section below. For bugs and issues, please submit a bug report at http://bugs.mysql.com under the category "MySQL Package Repos and Docker Images". From 90504e51c832b583d332da7eb23238adfca78397 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 24 Nov 2015 15:28:14 +0100 Subject: [PATCH 029/386] Updated README --- README.md | 56 +++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 46 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 7c306d610..8ca1fde41 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +![logo](https://www.mysql.com/common/logos/logo-mysql-170x115.png) + # What is MySQL? MySQL is the world's most popular open source database. With its proven performance, reliability and ease-of-use, MySQL has become the leading database choice for web-based applications, covering the entire range from personal projects and websites, via online shops and information services, all the way to high profile web properties including Facebook, Twitter, YouTube, Yahoo! and many more. @@ -20,7 +22,7 @@ We also publish experimental early previews of MySQL Server from time to time. P ## Start a MySQL Server Instance -Start a MySQL instance as follows (but make sure you also read the section below on data persistence): +Start a MySQL instance as follows (but make sure you also read the sections *Secure Container Startup* and *Where to Store Data* below): docker run --name my-container-name -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql/mysql-server:tag @@ -56,29 +58,62 @@ The MySQL Server log is located at `/var/log/mysqld.log` inside the container, a When you start the MySQL image, you can adjust the configuration of the MySQL instance by passing one or more environment variables on the `docker run` command line. Do note that none of the variables below will have any effect if you start the container with a data directory that already contains a database: any pre-existing database will always be left untouched on container startup. +Most of the variables listed below are optional, but one of the variables `MYSQL_ROOT_PASSWORD`, `MYSQL_ALLOW_EMPTY_PASSWORD`, `MYSQL_RANDOM_ROOT_PASSWORD` must be given. + ## `MYSQL_ROOT_PASSWORD` -This variable is mandatory and specifies the password that will be set for the MySQL root superuser account. In the above example, it was set `to my-secret-pw`. +This variable specifies a password that will be set for the MySQL root superuser account. In the above example, it was set `to my-secret-pw`. **NOTE:** Setting the MySQL root user password on the command line is insecure. See the section *Secure Container Startup* below for an alternative. + +## `MYSQL_RANDOM_ROOT_PASSWORD` + +When this variable is set to `yes`, a random password for the server's root user will be generated. The password will be printed to stdout in the container, and it can be obtained by using the command `docker logs my-container-name`. + +## `MYSQL_ONETIME_PASSWORD` + +This variable is optional. When set to `yes`, the root user's password will be set as expired, and must be changed before MySQL can be used normally. This is only supported by MySQL 5.6 or newer. ## `MYSQL_DATABASE` -This variable is optional and allows you to specify the name of a database to be created on image startup. If a user/password was supplied (see below) then that user will be granted superuser access (corresponding to GRANT ALL) to this database. +This variable is optional. It allows you to specify the name of a database to be created on image startup. If a user/password was supplied (see below) then that user will be granted superuser access (corresponding to GRANT ALL) to this database. ## `MYSQL_USER`, `MYSQL_PASSWORD` These variables are optional, used in conjunction to create a new user and set that user's password. This user will be granted superuser permissions (see above) for the database specified by the `MYSQL_DATABASE` variable. Both variables are required for a user to be created. -Do note that there is no need to use this mechanism to create the `root` superuser, that user gets created by default with the password specified by the `MYSQL_ROOT_PASSWORD`. variable. +Do note that there is no need to use this mechanism to create the `root` superuser, that user gets created by default with the password set by either of the mechanisms (given or generated) discussed above. ## `MYSQL_ALLOW_EMPTY_PASSWORD` -Set to `yes` to allow the container to be started with a blank password for the root user. NOTE: Setting this variable to `yes` is not recommended unless you really know what you are doing, since this will leave your MySQL instance completely unprotected, allowing anyone to gain complete superuser access. +Set to `yes` to allow the container to be started with a blank password for the root user. **NOTE:** Setting this variable to `yes` is not recommended unless you really know what you are doing, since this will leave your MySQL instance completely unprotected, allowing anyone to gain complete superuser access. # Notes, Tips, Gotchas +## Secure Container Startup + +In many use cases, employing the `MYSQL_ROOT_PASSWORD` variable to specify the MySQL root user password on initial container startup is insecure. Instead, to keep your setup as secure as possible, we strongly recommend using the `MYSQL_RANDOM_ROOT_PASSWORD` option. To further secure your instance, we also recommend using the `MYSQL_ONETIME_PASSWORD` variable if you use MySQL version 5.6 or higher. + +This is the full procedure: + + docker run --name my-container-name -e MYSQL_RANDOM_ROOT_PASSWORD=yes -e MYSQL_ONETIME_PASSWORD=yes -d mysql/mysql-server:tag + docker logs my-container-name + +Look for the "GENERATED ROOT PASSWORD" line in the output. + +If you also set the `MYSQL_ONETIME_PASSWORD` variable, you must now start a bash shell inside the container in order to set a new root password: + + docker exec -it my-container-name bash + +Start the MySQL command line client and log in using the randomly set root password: + + mysql -u root -p + +And finally, on the mysql client command line, set a new, secure root password for MySQL: + + ALTER USER root IDENTIFIED BY 'my-secret-pw'; + ## Where to Store Data -Important note: There are basically two ways to store data used by applications that run in Docker containers. We encourage users of MySQL with Docker to familiarize themselves with the options available, including: +There are basically two ways to store data used by applications that run in Docker containers. We encourage users of MySQL with Docker to familiarize themselves with the options available, including: * Let Docker manage the storage of your database data by writing the database files to disk on the host system using its own internal volume management. This is the default and is easy and fairly transparent to the user. The downside is that the files may be hard to locate for tools and applications that run directly on the host system, i.e. outside containers. * Create a data directory on the host system (outside the container) and mount this to a directory visible from inside the container. This places the database files in a known location on the host system, and makes it easy for tools and applications on the host system to access the files. The downside is that the user needs to make sure that the directory exists, and that e.g. directory permissions and other security mechanisms on the host system are set up correctly. @@ -124,10 +159,10 @@ Note that users on systems where SELinux is enabled may experience problems with These Docker images are optimized for size, which means that we have reduced the contents to what is expected to be relevant for a large majority of users who run Docker based MySQL instances. The key differences compared to a default MySQL install are: - All binaries are stripped, non-debug only - - Included binaries are limited to: +* All binaries are stripped, non-debug only +* Included binaries are limited to: +``` /usr/bin/my_print_defaults /usr/bin/mysql /usr/bin/mysql_config @@ -136,6 +171,7 @@ These Docker images are optimized for size, which means that we have reduced the /usr/bin/mysql_upgrade /usr/bin/mysqldump /usr/sbin/mysqld +``` # Supported Docker Versions @@ -143,4 +179,4 @@ These images are officially supported by the MySQL team on Docker version 1.9. S # User Feedback -We welcome your feedback! For general comments or discussion, please drop us a line in the Comments section below. For bugs and issues, please submit a bug report at http://bugs.mysql.com under the category "MySQL Package Repos and Docker Images". +We welcome your feedback! For general comments or discussion, please drop us a line in the Comments section below. For bugs and issues, please submit a bug report at http://bugs.mysql.com under the category "MySQL Package Repos and Docker Images". \ No newline at end of file From c22ce303062435b0483a8ccc9c66095c22a57a7a Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Wed, 25 Nov 2015 09:16:41 +0100 Subject: [PATCH 030/386] Bug#79374 user `mysql.sys` is removed from docker deployment The user is needed for the sys schema. Changed script to preserve it. --- 5.7/docker-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 6fb4b848f..dfe589b67 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -50,7 +50,7 @@ if [ "$1" = 'mysqld' ]; then -- What's done in this file shouldn't be replicated -- or products like mysql-fabric won't work SET @@SESSION.SQL_LOG_BIN=0; - DELETE FROM mysql.user ; + DELETE FROM mysql.user where user != 'mysql.sys'; CREATE USER 'root'@'%' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}' ; GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION ; DROP DATABASE IF EXISTS test ; From 1aa826b7ab2270dbce50ce1c8dd1ae9f4e250aab Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Mon, 7 Dec 2015 13:27:07 +0100 Subject: [PATCH 031/386] Updated README Added notes about port forwarding and passing in server options --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 8ca1fde41..8458b77c4 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,22 @@ Note that users on systems with SELinux enabled may experience problems with thi If you start your MySQL container instance with a data directory that already contains a database (specifically, a `mysql` subdirectory), the `$MYSQL_ROOT_PASSWORD` variable should be omitted from the `docker run` command line; it will in any case be ignored, and the pre-existing database will not be changed in any way. +## Port forwarding + +Docker allows mapping of ports on the container to ports on the host system by using the -p option. If you start the container as follows, you can connect to the database by connecting your client to a port on the host machine, in this example port 6603: + + docker run --name my-container-name -p 6603:3306 -d mysql/mysql-server + +## Passing options to the server + +You can pass arbitrary command line options to the MySQL server by appending them to the `run command`: + + docker run --name my-container-name -d mysql/mysql-server --option1=value --option2=value + +In this case, the values of option1 and option2 will be passed directly to the server when it is started. The following command will for instance start your container with UTF-8 as the default setting for character set and collation for all databases in MySQL: + + docker run --name my-container-name -d mysql/mysql-server --character-set-server=utf8 --collation-server=utf8_general_ci + ## Using a Custom MySQL Config File The MySQL startup configuration in these Docker images is specified in the file `/etc/my.cnf`. If you want to customize this configuration for your own purposes, you can create your alternative configuration file in a directory on the host machine and then mount this file in the appropriate location inside the MySQL container, effectively replacing the standard configuration file. From 68c9658511560ffde17bfcf80247bb2126f241a7 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Mon, 7 Dec 2015 21:58:24 +0100 Subject: [PATCH 032/386] Updated 5.6 to 5.6.28 --- 5.6/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.6/Dockerfile b/5.6/Dockerfile index d5bcff063..515c7b485 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -1,6 +1,6 @@ FROM oraclelinux:latest -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.27-2.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/ # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From 0b81a81a075d816d6069edd26e4c88ccd372c535 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Tue, 8 Dec 2015 09:45:02 +0100 Subject: [PATCH 033/386] Updated 5.7 to 5.7.10 --- 5.7/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.7/Dockerfile b/5.7/Dockerfile index f1ae493a5..1f1ad6163 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -1,5 +1,5 @@ FROM oraclelinux:latest -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.9-1.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.10-1.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From d98d7abacb24a41024ed5c6d2abe894e175632a9 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Tue, 8 Dec 2015 10:03:10 +0100 Subject: [PATCH 034/386] Fixed 5.6.28 URL --- 5.6/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.6/Dockerfile b/5.6/Dockerfile index 515c7b485..88c40ca0f 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -1,6 +1,6 @@ FROM oraclelinux:latest -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/ +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.28-2.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From cda06e63c2856847ad370883e6f067b9adb8adf8 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Tue, 8 Dec 2015 10:49:25 +0100 Subject: [PATCH 035/386] Updated 5.5 to 5.5.47 --- 5.5/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.5/Dockerfile b/5.5/Dockerfile index 93e5c72d0..c3c3d829d 100644 --- a/5.5/Dockerfile +++ b/5.5/Dockerfile @@ -1,6 +1,6 @@ FROM oraclelinux:latest -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.46-2.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.47-2.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From 0473555536990a99a47b880253915d6b45489567 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Mon, 1 Feb 2016 13:33:39 +0100 Subject: [PATCH 036/386] Added a way to store root password in a file If the MYSQL_ROOT_PASSWORD variable is a valid file path, the entrypoint script will cat the file and use the output as the root password. --- 5.5/docker-entrypoint.sh | 12 ++++++++---- 5.6/docker-entrypoint.sh | 12 ++++++++---- 5.7/docker-entrypoint.sh | 4 ++++ 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/5.5/docker-entrypoint.sh b/5.5/docker-entrypoint.sh index 094f4ee02..0687b451c 100755 --- a/5.5/docker-entrypoint.sh +++ b/5.5/docker-entrypoint.sh @@ -12,10 +12,14 @@ if [ "$1" = 'mysqld' ]; then if [ ! -d "$DATADIR/mysql" ]; then if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - echo >&2 'error: database is uninitialized and password option is not specified ' - echo >&2 ' You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD' - exit 1 - fi + echo >&2 'error: database is uninitialized and password option is not specified ' + echo >&2 ' You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD' + exit 1 + fi + # If the password variable is a filename we use the contents of the file + if [ -f "$MYSQL_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + fi mkdir -p "$DATADIR" chown -R mysql:mysql "$DATADIR" diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index fd1a7b870..962d5b292 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -12,10 +12,14 @@ if [ "$1" = 'mysqld' ]; then if [ ! -d "$DATADIR/mysql" ]; then if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - echo >&2 'error: database is uninitialized and password option is not specified ' - echo >&2 ' You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD' - exit 1 - fi + echo >&2 'error: database is uninitialized and password option is not specified ' + echo >&2 ' You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD' + exit 1 + fi + # If the password variable is a filename we use the contents of the file + if [ -f "$MYSQL_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + fi mkdir -p "$DATADIR" chown -R mysql:mysql "$DATADIR" diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index dfe589b67..ecc4b99ca 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -16,6 +16,10 @@ if [ "$1" = 'mysqld' ]; then echo >&2 ' You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD' exit 1 fi + # If the password variable is a filename we use the contents of the file + if [ -f "$MYSQL_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + fi mkdir -p "$DATADIR" chown -R mysql:mysql "$DATADIR" From e4a2af855526c0d4de55133a8639f4d61eb56573 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Fri, 5 Feb 2016 21:22:21 +0100 Subject: [PATCH 037/386] Updated 5.5 to 5.5.48 --- 5.5/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.5/Dockerfile b/5.5/Dockerfile index c3c3d829d..688229baf 100644 --- a/5.5/Dockerfile +++ b/5.5/Dockerfile @@ -1,6 +1,6 @@ FROM oraclelinux:latest -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.47-2.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.48-2.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From 6071fbb5ee4806be2766fd71743f52146a7d2290 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Sat, 6 Feb 2016 00:14:46 +0100 Subject: [PATCH 038/386] Updated 5.6 to 5.6.29 --- 5.6/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.6/Dockerfile b/5.6/Dockerfile index 88c40ca0f..2b8c85da7 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -1,6 +1,6 @@ FROM oraclelinux:latest -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.28-2.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.29-2.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From e6c8c8001b6ee9665df154498f061143139386a6 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Sat, 6 Feb 2016 09:53:28 +0100 Subject: [PATCH 039/386] Updated 5.7 to 5.7.11 --- 5.7/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.7/Dockerfile b/5.7/Dockerfile index 1f1ad6163..2c29ca71c 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -1,5 +1,5 @@ FROM oraclelinux:latest -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.10-1.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.11-1.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From 77e9d962f80e9fd0290c90318fa74d2762891eec Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Mon, 11 Apr 2016 19:26:31 +0200 Subject: [PATCH 040/386] Updated 5.5 to 5.5.49 --- 5.5/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.5/Dockerfile b/5.5/Dockerfile index 688229baf..25453c105 100644 --- a/5.5/Dockerfile +++ b/5.5/Dockerfile @@ -1,6 +1,6 @@ FROM oraclelinux:latest -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.48-2.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.49-2.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From 3eb1ef980a7a831449c27ecc3fb3ab07b0170286 Mon Sep 17 00:00:00 2001 From: Hery Ramilison Date: Mon, 11 Apr 2016 19:40:11 +0200 Subject: [PATCH 041/386] Updated 5.6 to 5.6.30 --- 5.6/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.6/Dockerfile b/5.6/Dockerfile index 2b8c85da7..f5b386ffd 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -1,6 +1,6 @@ FROM oraclelinux:latest -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.29-2.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.30-2.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From af7678147ed9044598c7bf59ded3a328239dabcb Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Tue, 12 Apr 2016 10:18:56 +0200 Subject: [PATCH 042/386] Updated 5.7 to 5.7.12 --- 5.7/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.7/Dockerfile b/5.7/Dockerfile index 2c29ca71c..0d6face87 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -1,5 +1,5 @@ FROM oraclelinux:latest -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.11-1.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.12-1.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From 5a1608faf085acc192f6b9f85050c50a9f84bf6e Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Fri, 22 Apr 2016 11:46:24 +0200 Subject: [PATCH 043/386] Expose port 33060 to allow connections from MySQL Shell --- 5.7/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.7/Dockerfile b/5.7/Dockerfile index 0d6face87..c156e6030 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -13,6 +13,6 @@ VOLUME /var/lib/mysql COPY docker-entrypoint.sh /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] -EXPOSE 3306 +EXPOSE 3306 33060 CMD ["mysqld"] From 1fee5fc140293b0df5d3e7a56f9654dfc437b34b Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Wed, 10 Feb 2016 08:23:58 +0100 Subject: [PATCH 044/386] Updated readme for password from file --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8458b77c4..472b6a888 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,8 @@ Most of the variables listed below are optional, but one of the variables `MYSQL This variable specifies a password that will be set for the MySQL root superuser account. In the above example, it was set `to my-secret-pw`. **NOTE:** Setting the MySQL root user password on the command line is insecure. See the section *Secure Container Startup* below for an alternative. +As an alternative to specifying the password explicitly, if the variable is set to a file path, the contents of the file will be used as the root password. + ## `MYSQL_RANDOM_ROOT_PASSWORD` When this variable is set to `yes`, a random password for the server's root user will be generated. The password will be printed to stdout in the container, and it can be obtained by using the command `docker logs my-container-name`. @@ -111,6 +113,10 @@ And finally, on the mysql client command line, set a new, secure root password f ALTER USER root IDENTIFIED BY 'my-secret-pw'; +An alternative is to use MYSQL_ROOT_PASSWORD, but set it to point to a file that contains the password. This provides better security than having the password on the command line and is easier to use in automated processes than the random password: + + docker run --name my-container-name -e MYSQL_ROOT_PASSWORD=/tmp/password.txt -v mypasswordfile:/tmp/password.txt -e MYSQL_ONETIME_PASSWORD=yes -d mysql/mysql-server:tag + ## Where to Store Data There are basically two ways to store data used by applications that run in Docker containers. We encourage users of MySQL with Docker to familiarize themselves with the options available, including: @@ -195,4 +201,4 @@ These images are officially supported by the MySQL team on Docker version 1.9. S # User Feedback -We welcome your feedback! For general comments or discussion, please drop us a line in the Comments section below. For bugs and issues, please submit a bug report at http://bugs.mysql.com under the category "MySQL Package Repos and Docker Images". \ No newline at end of file +We welcome your feedback! For general comments or discussion, please drop us a line in the Comments section below. For bugs and issues, please submit a bug report at http://bugs.mysql.com under the category "MySQL Package Repos and Docker Images". From 7e58f0dbb55dee5648a064ccc292c8ad27a819ca Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Thu, 26 May 2016 08:11:38 +0200 Subject: [PATCH 045/386] Bug#81415 Docker image fails to start with log-bin in config and server-id on command line Temporary starting of server did not include command line options, only config file. Changed to use the same command server is started with after init --- 5.5/docker-entrypoint.sh | 2 +- 5.6/docker-entrypoint.sh | 2 +- 5.7/docker-entrypoint.sh | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/5.5/docker-entrypoint.sh b/5.5/docker-entrypoint.sh index 0687b451c..4af544f81 100755 --- a/5.5/docker-entrypoint.sh +++ b/5.5/docker-entrypoint.sh @@ -27,7 +27,7 @@ if [ "$1" = 'mysqld' ]; then mysql_install_db --user=mysql --datadir="$DATADIR" --rpm echo 'Finished mysql_install_db' - mysqld --user=mysql --datadir="$DATADIR" --skip-networking & + "$@" --skip-networking & pid="$!" mysql=( mysql --protocol=socket -uroot ) diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index 962d5b292..59709852b 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -27,7 +27,7 @@ if [ "$1" = 'mysqld' ]; then mysql_install_db --user=mysql --datadir="$DATADIR" --rpm --keep-my-cnf echo 'Finished mysql_install_db' - mysqld --user=mysql --datadir="$DATADIR" --skip-networking & + "$@" --skip-networking & pid="$!" mysql=( mysql --protocol=socket -uroot ) diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index ecc4b99ca..cbf71ec4f 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -24,10 +24,10 @@ if [ "$1" = 'mysqld' ]; then chown -R mysql:mysql "$DATADIR" echo 'Initializing database' - mysqld --initialize-insecure=on --user=mysql --datadir="$DATADIR" + "$@" --initialize-insecure=on echo 'Database initialized' - mysqld --user=mysql --datadir="$DATADIR" --skip-networking & + "$@" --skip-networking & pid="$!" mysql=( mysql --protocol=socket -uroot ) From 1b1e67d5ca05ef1ee851d8c206abeab951196809 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Thu, 2 Jun 2016 19:49:48 +0200 Subject: [PATCH 046/386] Updated 5.5 to 5.5.50 --- 5.5/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.5/Dockerfile b/5.5/Dockerfile index 25453c105..c6a0fa9cd 100644 --- a/5.5/Dockerfile +++ b/5.5/Dockerfile @@ -1,6 +1,6 @@ FROM oraclelinux:latest -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.49-2.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.50-2.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From 8b5380f8c66a450d1f44e39173b51606ea9b67f9 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Thu, 2 Jun 2016 19:55:29 +0200 Subject: [PATCH 047/386] Updated 5.6 to 5.6.31 --- 5.6/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.6/Dockerfile b/5.6/Dockerfile index f5b386ffd..2857f4a95 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -1,6 +1,6 @@ FROM oraclelinux:latest -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.30-2.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.31-2.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From b5a39bf7a28d54585aed0eaef24f9b215aac5133 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Thu, 2 Jun 2016 22:22:48 +0200 Subject: [PATCH 048/386] Updated 5.7 to 5.7.13 --- 5.7/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.7/Dockerfile b/5.7/Dockerfile index c156e6030..257b9a6ab 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -1,5 +1,5 @@ FROM oraclelinux:latest -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.12-1.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.13-1.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From c0915f732b65f5021d5927608deeb4535c824513 Mon Sep 17 00:00:00 2001 From: Giuseppe Maxia Date: Sat, 4 Jun 2016 22:15:59 +0200 Subject: [PATCH 049/386] Fix for bug#81723 Fixing [Bug#81723](https://bugs.mysql.com/bug.php?id=81723): Installing a container with X-Plugin enabled results with an unresponsive server. --- 5.7/docker-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index cbf71ec4f..0ea4c2829 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -54,7 +54,7 @@ if [ "$1" = 'mysqld' ]; then -- What's done in this file shouldn't be replicated -- or products like mysql-fabric won't work SET @@SESSION.SQL_LOG_BIN=0; - DELETE FROM mysql.user where user != 'mysql.sys'; + DELETE FROM mysql.user where user NOT IN ('mysql.sys', 'mysqlxsys'); CREATE USER 'root'@'%' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}' ; GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION ; DROP DATABASE IF EXISTS test ; From 56d263f47c741aaca70f36e4a55ad6071ed859af Mon Sep 17 00:00:00 2001 From: ltangvald Date: Tue, 7 Jun 2016 07:19:55 +0200 Subject: [PATCH 050/386] Revert "Fix for bug#81723" --- 5.7/docker-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 0ea4c2829..cbf71ec4f 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -54,7 +54,7 @@ if [ "$1" = 'mysqld' ]; then -- What's done in this file shouldn't be replicated -- or products like mysql-fabric won't work SET @@SESSION.SQL_LOG_BIN=0; - DELETE FROM mysql.user where user NOT IN ('mysql.sys', 'mysqlxsys'); + DELETE FROM mysql.user where user != 'mysql.sys'; CREATE USER 'root'@'%' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}' ; GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION ; DROP DATABASE IF EXISTS test ; From 9108dcf96334d7535dd5f7db742e1765f4d29e90 Mon Sep 17 00:00:00 2001 From: Giuseppe Maxia Date: Tue, 7 Jun 2016 09:22:24 +0200 Subject: [PATCH 051/386] Fix for bug#81723 Fixing [Bug#81723](https://bugs.mysql.com/bug.php?id=81723): Installing a container with X-Plugin enabled results with an unresponsive server. --- 5.7/docker-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index cbf71ec4f..f7f1fd7a6 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -54,7 +54,7 @@ if [ "$1" = 'mysqld' ]; then -- What's done in this file shouldn't be replicated -- or products like mysql-fabric won't work SET @@SESSION.SQL_LOG_BIN=0; - DELETE FROM mysql.user where user != 'mysql.sys'; + DELETE FROM mysql.user WHERE user NOT IN ('mysql.sys', 'mysqlxsys'); CREATE USER 'root'@'%' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}' ; GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION ; DROP DATABASE IF EXISTS test ; From 56d1d356c7ae85574571a9708988ae2004485b0a Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Fri, 29 Jul 2016 18:56:05 +0200 Subject: [PATCH 052/386] Updated 5.5 to 5.5.51 --- 5.5/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.5/Dockerfile b/5.5/Dockerfile index c6a0fa9cd..300befe7e 100644 --- a/5.5/Dockerfile +++ b/5.5/Dockerfile @@ -1,6 +1,6 @@ FROM oraclelinux:latest -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.50-2.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.51-2.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From 1fbd1d9949ddd44156e4644d4a1ddd6711fd7710 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Sat, 30 Jul 2016 08:08:05 +0200 Subject: [PATCH 053/386] Updated 5.7 to 5.7.14 --- 5.7/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.7/Dockerfile b/5.7/Dockerfile index 257b9a6ab..af44efe22 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -1,5 +1,5 @@ FROM oraclelinux:latest -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.13-1.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.14-1.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From 27438b007769d28be7cc502f695b66c3642dcf1c Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Sat, 30 Jul 2016 08:25:49 +0200 Subject: [PATCH 054/386] Updated 5.6 to 5.6.32 --- 5.6/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.6/Dockerfile b/5.6/Dockerfile index 2857f4a95..cbf0f3516 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -1,6 +1,6 @@ FROM oraclelinux:latest -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.31-2.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.32-2.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From 05833afcfb62f88fc294d1afed584cec1d5bdd0e Mon Sep 17 00:00:00 2001 From: Trond Humborstad Date: Wed, 17 Aug 2016 10:36:15 +0200 Subject: [PATCH 055/386] Add an early check for whether server can start, to detect config errors and notify user. --- 5.5/docker-entrypoint.sh | 10 ++++++++++ 5.6/docker-entrypoint.sh | 10 ++++++++++ 5.7/docker-entrypoint.sh | 10 ++++++++++ 3 files changed, 30 insertions(+) diff --git a/5.5/docker-entrypoint.sh b/5.5/docker-entrypoint.sh index 4af544f81..31baad82e 100755 --- a/5.5/docker-entrypoint.sh +++ b/5.5/docker-entrypoint.sh @@ -7,6 +7,16 @@ if [ "${1:0:1}" = '-' ]; then fi if [ "$1" = 'mysqld' ]; then + # Test we're able to startup without errors. We redirect stdout to /dev/null so + # only the error messages are left. + result=0 + output=$("$@" --verbose --help 2>&1 > /dev/null) || result=$? + if [ ! "$result" = "0" ]; then + echo >&2 'error: could not run mysql. This could be caused by a misconfigured my.cnf' + echo >&2 "$output" + exit 1 + fi + # Get config DATADIR="$("$@" --verbose --help 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')" diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index 59709852b..257f8b533 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -7,6 +7,16 @@ if [ "${1:0:1}" = '-' ]; then fi if [ "$1" = 'mysqld' ]; then + # Test we're able to startup without errors. We redirect stdout to /dev/null so + # only the error messages are left. + result=0 + output=$("$@" --verbose --help 2>&1 > /dev/null) || result=$? + if [ ! "$result" = "0" ]; then + echo >&2 'error: could not run mysql. This could be caused by a misconfigured my.cnf' + echo >&2 "$output" + exit 1 + fi + # Get config DATADIR="$("$@" --verbose --help 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')" diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index f7f1fd7a6..909abd4af 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -7,6 +7,16 @@ if [ "${1:0:1}" = '-' ]; then fi if [ "$1" = 'mysqld' ]; then + # Test we're able to startup without errors. We redirect stdout to /dev/null so + # only the error messages are left. + result=0 + output=$("$@" --verbose --help 2>&1 > /dev/null) || result=$? + if [ ! "$result" = "0" ]; then + echo >&2 'error: could not run mysql. This could be caused by a misconfigured my.cnf' + echo >&2 "$output" + exit 1 + fi + # Get config DATADIR="$("$@" --verbose --help --log-bin-index=/tmp/tmp.index 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')" From 08835d10ae3835885167b64824cd5a2ebb7898d0 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Tue, 6 Sep 2016 17:41:10 +0200 Subject: [PATCH 056/386] Updated 5.5 to 5.5.52 --- 5.5/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.5/Dockerfile b/5.5/Dockerfile index 300befe7e..5b9171cc5 100644 --- a/5.5/Dockerfile +++ b/5.5/Dockerfile @@ -1,6 +1,6 @@ FROM oraclelinux:latest -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.51-2.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.52-2.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From 63b7584cd854ac3f94c878fdb7d154f635773c81 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Tue, 6 Sep 2016 18:30:13 +0200 Subject: [PATCH 057/386] Updated 5.7 to 5.7.15 --- 5.7/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.7/Dockerfile b/5.7/Dockerfile index af44efe22..f51b30c56 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -1,5 +1,5 @@ FROM oraclelinux:latest -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.14-1.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.15-1.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From 1632cc8c1375f92a413856dae913bd8f48ab6d8f Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 7 Sep 2016 06:13:42 +0200 Subject: [PATCH 058/386] Updated 5.6 to 5.6.33 --- 5.6/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.6/Dockerfile b/5.6/Dockerfile index cbf0f3516..45ab79179 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -1,6 +1,6 @@ FROM oraclelinux:latest -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.32-2.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.33-2.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From 938f20aaf9ae05530d29195e0654610c4320453b Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Wed, 24 Aug 2016 07:39:02 +0200 Subject: [PATCH 059/386] Added 8.0 build --- 8.0/Dockerfile | 18 ++++++ 8.0/docker-entrypoint.sh | 120 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 138 insertions(+) create mode 100644 8.0/Dockerfile create mode 100755 8.0/docker-entrypoint.sh diff --git a/8.0/Dockerfile b/8.0/Dockerfile new file mode 100644 index 000000000..5ea96b158 --- /dev/null +++ b/8.0/Dockerfile @@ -0,0 +1,18 @@ +FROM oraclelinux:latest +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-8.0-community/docker/x86_64/mysql-community-server-minimal-8.0.0-1.el7.x86_64.rpm + +# Install server +RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ + && yum install -y $PACKAGE_URL \ + && yum install -y libpwquality \ + && rm -rf /var/cache/yum/* +RUN mkdir /docker-entrypoint-initdb.d + +VOLUME /var/lib/mysql + +COPY docker-entrypoint.sh /entrypoint.sh +ENTRYPOINT ["/entrypoint.sh"] + +EXPOSE 3306 33060 +CMD ["mysqld"] + diff --git a/8.0/docker-entrypoint.sh b/8.0/docker-entrypoint.sh new file mode 100755 index 000000000..909abd4af --- /dev/null +++ b/8.0/docker-entrypoint.sh @@ -0,0 +1,120 @@ +#!/bin/bash +set -e + +# if command starts with an option, prepend mysqld +if [ "${1:0:1}" = '-' ]; then + set -- mysqld "$@" +fi + +if [ "$1" = 'mysqld' ]; then + # Test we're able to startup without errors. We redirect stdout to /dev/null so + # only the error messages are left. + result=0 + output=$("$@" --verbose --help 2>&1 > /dev/null) || result=$? + if [ ! "$result" = "0" ]; then + echo >&2 'error: could not run mysql. This could be caused by a misconfigured my.cnf' + echo >&2 "$output" + exit 1 + fi + + # Get config + DATADIR="$("$@" --verbose --help --log-bin-index=/tmp/tmp.index 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')" + + if [ ! -d "$DATADIR/mysql" ]; then + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 'error: database is uninitialized and password option is not specified ' + echo >&2 ' You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD' + exit 1 + fi + # If the password variable is a filename we use the contents of the file + if [ -f "$MYSQL_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + fi + mkdir -p "$DATADIR" + chown -R mysql:mysql "$DATADIR" + + echo 'Initializing database' + "$@" --initialize-insecure=on + echo 'Database initialized' + + "$@" --skip-networking & + pid="$!" + + mysql=( mysql --protocol=socket -uroot ) + + for i in {30..0}; do + if echo 'SELECT 1' | "${mysql[@]}" &> /dev/null; then + break + fi + echo 'MySQL init process in progress...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 'MySQL init process failed.' + exit 1 + fi + + mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql + + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(pwmake 128)" + echo "GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + fi + "${mysql[@]}" <<-EOSQL + -- What's done in this file shouldn't be replicated + -- or products like mysql-fabric won't work + SET @@SESSION.SQL_LOG_BIN=0; + DELETE FROM mysql.user WHERE user NOT IN ('mysql.sys', 'mysqlxsys'); + CREATE USER 'root'@'%' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}' ; + GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION ; + DROP DATABASE IF EXISTS test ; + FLUSH PRIVILEGES ; + EOSQL + if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then + mysql+=( -p"${MYSQL_ROOT_PASSWORD}" ) + fi + + if [ "$MYSQL_DATABASE" ]; then + echo "CREATE DATABASE IF NOT EXISTS \`$MYSQL_DATABASE\` ;" | "${mysql[@]}" + mysql+=( "$MYSQL_DATABASE" ) + fi + + if [ "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then + echo "CREATE USER '"$MYSQL_USER"'@'%' IDENTIFIED BY '"$MYSQL_PASSWORD"' ;" | "${mysql[@]}" + + if [ "$MYSQL_DATABASE" ]; then + echo "GRANT ALL ON \`"$MYSQL_DATABASE"\`.* TO '"$MYSQL_USER"'@'%' ;" | "${mysql[@]}" + fi + + echo 'FLUSH PRIVILEGES ;' | "${mysql[@]}" + fi + echo + for f in /docker-entrypoint-initdb.d/*; do + case "$f" in + *.sh) echo "$0: running $f"; . "$f" ;; + *.sql) echo "$0: running $f"; "${mysql[@]}" < "$f" && echo ;; + *) echo "$0: ignoring $f" ;; + esac + echo + done + + if [ ! -z "$MYSQL_ONETIME_PASSWORD" ]; then + "${mysql[@]}" <<-EOSQL + ALTER USER 'root'@'%' PASSWORD EXPIRE; + EOSQL + fi + if ! kill -s TERM "$pid" || ! wait "$pid"; then + echo >&2 'MySQL init process failed.' + exit 1 + fi + + echo + echo 'MySQL init process done. Ready for start up.' + echo + fi + + chown -R mysql:mysql "$DATADIR" +fi + +exec "$@" + From 14ffaf772788a186df60c258296e4ea350080cd0 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Tue, 13 Sep 2016 09:31:23 +0200 Subject: [PATCH 060/386] Updated 8.0 to 8.0.0 --- 8.0/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 5ea96b158..40778496a 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -1,5 +1,5 @@ FROM oraclelinux:latest -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-8.0-community/docker/x86_64/mysql-community-server-minimal-8.0.0-1.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-8.0-community/docker/x86_64/mysql-community-server-minimal-8.0.0-0.1.dmr.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From 1d65ebf3b83203908edf2c807fc6d73e47fd1ccd Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Thu, 15 Sep 2016 14:15:43 +0200 Subject: [PATCH 061/386] Updated README for 8.0 preview release. --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 472b6a888..765857c4d 100644 --- a/README.md +++ b/README.md @@ -13,10 +13,11 @@ These are optimized MySQL Server Docker images, created and maintained by the My MySQL Server 5.5 (tag: 5.5) MySQL Server 5.6 (tag: 5.6) MySQL Server 5.7, the latest GA version (tag: 5.7 or latest) + MySQL Server 8.0 Development Milestone 1, preview release (tag: 8.0) -Images are updated when new MySQL Server maintenance releases and development milestones are published. +Images are updated when new MySQL Server maintenance releases and development milestones are published. Please note that milestone releases are for preview purposes only and should not be used in production setups. -We also publish experimental early previews of MySQL Server from time to time. Please visit the [MySQL Labs Docker image page](https://hub.docker.com/r/mysql/mysql-labs/) to see what is available. +We also from time to time publish special MySQL Server images that contain experimental features. Please visit the [MySQL Labs Docker image page](https://hub.docker.com/r/mysql/mysql-labs/) to see what is available. # How to Use the MySQL Images From 13978835fe8e3eba18f2aa9efe203ab5b5ee8633 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 4 Oct 2016 13:21:48 +0200 Subject: [PATCH 062/386] Change oraclelinux dependency from latest to 7 to avoid any surprise upgrades in the future --- 5.5/Dockerfile | 2 +- 5.6/Dockerfile | 2 +- 5.7/Dockerfile | 2 +- 8.0/Dockerfile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/5.5/Dockerfile b/5.5/Dockerfile index 5b9171cc5..521fc2db0 100644 --- a/5.5/Dockerfile +++ b/5.5/Dockerfile @@ -1,4 +1,4 @@ -FROM oraclelinux:latest +FROM oraclelinux:7 ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.52-2.el7.x86_64.rpm diff --git a/5.6/Dockerfile b/5.6/Dockerfile index 45ab79179..7601b35c2 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -1,4 +1,4 @@ -FROM oraclelinux:latest +FROM oraclelinux:7 ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.33-2.el7.x86_64.rpm diff --git a/5.7/Dockerfile b/5.7/Dockerfile index f51b30c56..4f76daa43 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -1,4 +1,4 @@ -FROM oraclelinux:latest +FROM oraclelinux:7 ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.15-1.el7.x86_64.rpm # Install server diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 40778496a..40941ce17 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -1,4 +1,4 @@ -FROM oraclelinux:latest +FROM oraclelinux:7 ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-8.0-community/docker/x86_64/mysql-community-server-minimal-8.0.0-0.1.dmr.el7.x86_64.rpm # Install server From d663918c7e69c056808451d12e10768abd5f0eb2 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 12 Oct 2016 19:14:49 +0200 Subject: [PATCH 063/386] Updated 5.6 to 5.6.34 --- 5.6/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.6/Dockerfile b/5.6/Dockerfile index 7601b35c2..f4b6123a5 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -1,6 +1,6 @@ FROM oraclelinux:7 -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.33-2.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.34-2.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From 8507d38bb11d3d117ed4f5d796abbbb83d6534a1 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 12 Oct 2016 19:35:57 +0200 Subject: [PATCH 064/386] Updated 5.5 to 5.5.53 --- 5.5/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.5/Dockerfile b/5.5/Dockerfile index 521fc2db0..cf3d12553 100644 --- a/5.5/Dockerfile +++ b/5.5/Dockerfile @@ -1,6 +1,6 @@ FROM oraclelinux:7 -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.52-2.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.53-2.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From 63917ecf6fc80720d79fe42a1f73b227f8f10aa5 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Thu, 13 Oct 2016 14:44:43 +0200 Subject: [PATCH 065/386] Updated 5.7 to 5.7.16 --- 5.7/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.7/Dockerfile b/5.7/Dockerfile index 4f76daa43..28c9bfa81 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -1,5 +1,5 @@ FROM oraclelinux:7 -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.15-1.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.16-1.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From 6fbb227bae9ba468404a96f3aa112012d9a8bb6d Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 22 Nov 2016 12:34:43 +0100 Subject: [PATCH 066/386] Restrict host access for root user The root user was created as @'%'. If the user opens the Docker network to the outside, this would allow connections to root from any host. * By default, root will only allow access from localhost (this means users have to use the docker exec command to connect to root) * We also add the environment variable MYSQL_ROOT_HOST, which if set will create a second root account for this host (e.g 172.17.0.1 for the standard Docker gateway). --- 5.5/docker-entrypoint.sh | 12 +++++++++--- 5.6/docker-entrypoint.sh | 12 +++++++++--- 5.7/docker-entrypoint.sh | 12 +++++++++--- 8.0/docker-entrypoint.sh | 12 +++++++++--- 4 files changed, 36 insertions(+), 12 deletions(-) diff --git a/5.5/docker-entrypoint.sh b/5.5/docker-entrypoint.sh index 31baad82e..52c343dc2 100755 --- a/5.5/docker-entrypoint.sh +++ b/5.5/docker-entrypoint.sh @@ -60,13 +60,19 @@ if [ "$1" = 'mysqld' ]; then MYSQL_ROOT_PASSWORD="$(pwmake 128)" echo "GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" fi + if [ -z "$MYSQL_ROOT_HOST" ]; then + ROOTCREATE="SET PASSWORD FOR 'root'@'localhost'=PASSWORD('${MYSQL_ROOT_PASSWORD}');" + else + ROOTCREATE="SET PASSWORD FOR 'root'@'localhost'=PASSWORD('${MYSQL_ROOT_PASSWORD}'); \ + CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + fi "${mysql[@]}" <<-EOSQL -- What's done in this file shouldn't be replicated -- or products like mysql-fabric won't work SET @@SESSION.SQL_LOG_BIN=0; - DELETE FROM mysql.user ; - CREATE USER 'root'@'%' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}' ; - GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION ; + DELETE FROM mysql.user WHERE user NOT IN ('mysql.sys', 'mysqlxsys', 'root') OR host NOT IN ('localhost'); + ${ROOTCREATE} DROP DATABASE IF EXISTS test ; FLUSH PRIVILEGES ; EOSQL diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index 257f8b533..6087019cd 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -61,13 +61,19 @@ if [ "$1" = 'mysqld' ]; then MYSQL_ROOT_PASSWORD="$(pwmake 128)" echo "GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" fi + if [ -z "$MYSQL_ROOT_HOST" ]; then + ROOTCREATE="SET PASSWORD FOR 'root'@'localhost'=PASSWORD('${MYSQL_ROOT_PASSWORD}');" + else + ROOTCREATE="SET PASSWORD FOR 'root'@'localhost'=PASSWORD('${MYSQL_ROOT_PASSWORD}'); \ + CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + fi "${mysql[@]}" <<-EOSQL -- What's done in this file shouldn't be replicated -- or products like mysql-fabric won't work SET @@SESSION.SQL_LOG_BIN=0; - DELETE FROM mysql.user ; - CREATE USER 'root'@'%' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}' ; - GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION ; + DELETE FROM mysql.user WHERE user NOT IN ('mysql.sys', 'mysqlxsys', 'root') OR host NOT IN ('localhost'); + ${ROOTCREATE} DROP DATABASE IF EXISTS test ; FLUSH PRIVILEGES ; EOSQL diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 909abd4af..521788895 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -60,13 +60,19 @@ if [ "$1" = 'mysqld' ]; then MYSQL_ROOT_PASSWORD="$(pwmake 128)" echo "GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" fi + if [ -z "$MYSQL_ROOT_HOST" ]; then + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';" + else + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + fi "${mysql[@]}" <<-EOSQL -- What's done in this file shouldn't be replicated -- or products like mysql-fabric won't work SET @@SESSION.SQL_LOG_BIN=0; - DELETE FROM mysql.user WHERE user NOT IN ('mysql.sys', 'mysqlxsys'); - CREATE USER 'root'@'%' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}' ; - GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION ; + DELETE FROM mysql.user WHERE user NOT IN ('mysql.sys', 'mysqlxsys', 'root') OR host NOT IN ('localhost'); + ${ROOTCREATE} DROP DATABASE IF EXISTS test ; FLUSH PRIVILEGES ; EOSQL diff --git a/8.0/docker-entrypoint.sh b/8.0/docker-entrypoint.sh index 909abd4af..521788895 100755 --- a/8.0/docker-entrypoint.sh +++ b/8.0/docker-entrypoint.sh @@ -60,13 +60,19 @@ if [ "$1" = 'mysqld' ]; then MYSQL_ROOT_PASSWORD="$(pwmake 128)" echo "GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" fi + if [ -z "$MYSQL_ROOT_HOST" ]; then + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';" + else + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + fi "${mysql[@]}" <<-EOSQL -- What's done in this file shouldn't be replicated -- or products like mysql-fabric won't work SET @@SESSION.SQL_LOG_BIN=0; - DELETE FROM mysql.user WHERE user NOT IN ('mysql.sys', 'mysqlxsys'); - CREATE USER 'root'@'%' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}' ; - GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION ; + DELETE FROM mysql.user WHERE user NOT IN ('mysql.sys', 'mysqlxsys', 'root') OR host NOT IN ('localhost'); + ${ROOTCREATE} DROP DATABASE IF EXISTS test ; FLUSH PRIVILEGES ; EOSQL From e28da831d2087d3d9d815716eebbc5d76f1f82d5 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 22 Nov 2016 14:00:23 +0100 Subject: [PATCH 067/386] Updated readme file for MYSQL_ROOT_HOST setting --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 765857c4d..44c29a7bf 100644 --- a/README.md +++ b/README.md @@ -37,11 +37,11 @@ This image exposes the standard MySQL port (3306), so container linking makes th ## Connect to MySQL from the MySQL Command Line Client -The following command starts another MySQL container instance and runs the `mysql` command line client against your original MySQL container, allowing you to execute SQL statements against your database: +The following command starts a new process inside an existing MySQL container instance and runs the `mysql` command line client against your original MySQL server, allowing you to execute SQL statements against your database: - docker run -it --link my-container-name:mysql --rm mysql/mysql-server:tag sh -c 'exec mysql -h"$MYSQL_PORT_3306_TCP_ADDR" -P"$MYSQL_PORT_3306_TCP_PORT" -uroot -p"$MYSQL_ENV_MYSQL_ROOT_PASSWORD"' + docker exec -it my-container-name mysql -uroot -p -... where `my-container-name` is the name of your original MySQL Server container. +... where `my-container-name` is the name of your original MySQL Server container. Note that if the main container process (the server) exits, the process started by exec will also exit. More information about the MySQL command line client can be found in the MySQL reference documentation at http://dev.mysql.com/doc/refman/en/ @@ -89,6 +89,10 @@ Do note that there is no need to use this mechanism to create the `root` superus Set to `yes` to allow the container to be started with a blank password for the root user. **NOTE:** Setting this variable to `yes` is not recommended unless you really know what you are doing, since this will leave your MySQL instance completely unprotected, allowing anyone to gain complete superuser access. +## `MYSQL_ROOT_HOST` + +By default, MySQL creates the 'root'@'localhost' command. This account can only be connected to from inside the container, requiring the use of the docker exec command as noted under `Connect to MySQL from the MySQL Command Line Client`. To allow connections from other hosts, set this environment variable. As an example, the value "172.17.0.1", which is the default Docker gateway IP, will allow connections from the Docker host machine. + # Notes, Tips, Gotchas ## Secure Container Startup From 063e01fb413239475fb2ea7968f2827ee4d731da Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Mon, 12 Dec 2016 15:20:17 +0100 Subject: [PATCH 068/386] Updated 5.6 to 5.6.35 --- 5.6/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.6/Dockerfile b/5.6/Dockerfile index f4b6123a5..e4e8c066e 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -1,6 +1,6 @@ FROM oraclelinux:7 -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.34-2.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.35-2.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From 5d8358770ec0d632dff10a99a6302c5ecf272dee Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Mon, 12 Dec 2016 19:09:36 +0100 Subject: [PATCH 069/386] Updated 5.7 to 5.7.17 --- 5.7/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.7/Dockerfile b/5.7/Dockerfile index 28c9bfa81..9fb53f4d8 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -1,5 +1,5 @@ FROM oraclelinux:7 -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.16-1.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.17-1.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From 3271a6bc0d5506c4b9268aaa3001950c353ac538 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Tue, 13 Dec 2016 09:15:19 +0100 Subject: [PATCH 070/386] Updated 5.5 to 5.5.54 --- 5.5/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.5/Dockerfile b/5.5/Dockerfile index cf3d12553..42db391d8 100644 --- a/5.5/Dockerfile +++ b/5.5/Dockerfile @@ -1,6 +1,6 @@ FROM oraclelinux:7 -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.53-2.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.54-2.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From 056bce0c690ffe48d9255efdd1b13256f3b55d11 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 22 Nov 2016 14:46:07 +0100 Subject: [PATCH 071/386] Fix readme typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 44c29a7bf..e82325677 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ Set to `yes` to allow the container to be started with a blank password for the ## `MYSQL_ROOT_HOST` -By default, MySQL creates the 'root'@'localhost' command. This account can only be connected to from inside the container, requiring the use of the docker exec command as noted under `Connect to MySQL from the MySQL Command Line Client`. To allow connections from other hosts, set this environment variable. As an example, the value "172.17.0.1", which is the default Docker gateway IP, will allow connections from the Docker host machine. +By default, MySQL creates the 'root'@'localhost' account. This account can only be connected to from inside the container, requiring the use of the docker exec command as noted under `Connect to MySQL from the MySQL Command Line Client`. To allow connections from other hosts, set this environment variable. As an example, the value "172.17.0.1", which is the default Docker gateway IP, will allow connections from the Docker host machine. # Notes, Tips, Gotchas From 20f303dc962c5634c418fe8cb46d4ac5c0e6e8a5 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 22 Nov 2016 14:47:56 +0100 Subject: [PATCH 072/386] Hardcode socket path during init During container init, we start both server and client temporarily, for user admin etc. For the server we pass on any command line arguments specified by the user, but for the client we don't. This can cause an issue if the user specifies a different socket path, since the client won't find it, causing init failure. Since the socket location doesn't really matter for these temporary runs, we hardcode it to /var/run/mysqld/mysqld.sock --- 5.5/docker-entrypoint.sh | 4 ++-- 5.6/docker-entrypoint.sh | 4 ++-- 5.7/docker-entrypoint.sh | 4 ++-- 8.0/docker-entrypoint.sh | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/5.5/docker-entrypoint.sh b/5.5/docker-entrypoint.sh index 52c343dc2..1f074b421 100755 --- a/5.5/docker-entrypoint.sh +++ b/5.5/docker-entrypoint.sh @@ -37,10 +37,10 @@ if [ "$1" = 'mysqld' ]; then mysql_install_db --user=mysql --datadir="$DATADIR" --rpm echo 'Finished mysql_install_db' - "$@" --skip-networking & + "$@" --skip-networking --socket=/var/run/mysqld/mysqld.sock & pid="$!" - mysql=( mysql --protocol=socket -uroot ) + mysql=( mysql --protocol=socket -uroot --socket=/var/run/mysqld/mysqld.sock) for i in {30..0}; do if echo 'SELECT 1' | "${mysql[@]}" &> /dev/null; then diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index 6087019cd..6573c828b 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -37,10 +37,10 @@ if [ "$1" = 'mysqld' ]; then mysql_install_db --user=mysql --datadir="$DATADIR" --rpm --keep-my-cnf echo 'Finished mysql_install_db' - "$@" --skip-networking & + "$@" --skip-networking --socket=/var/run/mysqld/mysqld.sock & pid="$!" - mysql=( mysql --protocol=socket -uroot ) + mysql=( mysql --protocol=socket -uroot --socket=/var/run/mysqld/mysqld.sock) for i in {30..0}; do if echo 'SELECT 1' | "${mysql[@]}" &> /dev/null; then diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 521788895..30117bbf3 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -37,10 +37,10 @@ if [ "$1" = 'mysqld' ]; then "$@" --initialize-insecure=on echo 'Database initialized' - "$@" --skip-networking & + "$@" --skip-networking --socket=/var/run/mysqld/mysqld.sock & pid="$!" - mysql=( mysql --protocol=socket -uroot ) + mysql=( mysql --protocol=socket -uroot --socket=/var/run/mysqld/mysqld.sock) for i in {30..0}; do if echo 'SELECT 1' | "${mysql[@]}" &> /dev/null; then diff --git a/8.0/docker-entrypoint.sh b/8.0/docker-entrypoint.sh index 521788895..30117bbf3 100755 --- a/8.0/docker-entrypoint.sh +++ b/8.0/docker-entrypoint.sh @@ -37,10 +37,10 @@ if [ "$1" = 'mysqld' ]; then "$@" --initialize-insecure=on echo 'Database initialized' - "$@" --skip-networking & + "$@" --skip-networking --socket=/var/run/mysqld/mysqld.sock & pid="$!" - mysql=( mysql --protocol=socket -uroot ) + mysql=( mysql --protocol=socket -uroot --socket=/var/run/mysqld/mysqld.sock) for i in {30..0}; do if echo 'SELECT 1' | "${mysql[@]}" &> /dev/null; then From 1d5ed8b5943ea1fa928245f75b72e71b64c37b3c Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 22 Nov 2016 14:49:48 +0100 Subject: [PATCH 073/386] Ensure client run during container init uses localhost interface The MYSQL_HOST environment variable overrides the host setting for the client if it's set, which can cause init failure, so we override it to -hlocalhost to prevent this. --- 5.5/docker-entrypoint.sh | 2 +- 5.6/docker-entrypoint.sh | 2 +- 5.7/docker-entrypoint.sh | 2 +- 8.0/docker-entrypoint.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/5.5/docker-entrypoint.sh b/5.5/docker-entrypoint.sh index 1f074b421..f236477e9 100755 --- a/5.5/docker-entrypoint.sh +++ b/5.5/docker-entrypoint.sh @@ -40,7 +40,7 @@ if [ "$1" = 'mysqld' ]; then "$@" --skip-networking --socket=/var/run/mysqld/mysqld.sock & pid="$!" - mysql=( mysql --protocol=socket -uroot --socket=/var/run/mysqld/mysqld.sock) + mysql=( mysql --protocol=socket -uroot -hlocalhost --socket=/var/run/mysqld/mysqld.sock) for i in {30..0}; do if echo 'SELECT 1' | "${mysql[@]}" &> /dev/null; then diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index 6573c828b..d33ec3663 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -40,7 +40,7 @@ if [ "$1" = 'mysqld' ]; then "$@" --skip-networking --socket=/var/run/mysqld/mysqld.sock & pid="$!" - mysql=( mysql --protocol=socket -uroot --socket=/var/run/mysqld/mysqld.sock) + mysql=( mysql --protocol=socket -uroot -hlocalhost --socket=/var/run/mysqld/mysqld.sock) for i in {30..0}; do if echo 'SELECT 1' | "${mysql[@]}" &> /dev/null; then diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 30117bbf3..ceaeef9e2 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -40,7 +40,7 @@ if [ "$1" = 'mysqld' ]; then "$@" --skip-networking --socket=/var/run/mysqld/mysqld.sock & pid="$!" - mysql=( mysql --protocol=socket -uroot --socket=/var/run/mysqld/mysqld.sock) + mysql=( mysql --protocol=socket -uroot -hlocalhost --socket=/var/run/mysqld/mysqld.sock) for i in {30..0}; do if echo 'SELECT 1' | "${mysql[@]}" &> /dev/null; then diff --git a/8.0/docker-entrypoint.sh b/8.0/docker-entrypoint.sh index 30117bbf3..ceaeef9e2 100755 --- a/8.0/docker-entrypoint.sh +++ b/8.0/docker-entrypoint.sh @@ -40,7 +40,7 @@ if [ "$1" = 'mysqld' ]; then "$@" --skip-networking --socket=/var/run/mysqld/mysqld.sock & pid="$!" - mysql=( mysql --protocol=socket -uroot --socket=/var/run/mysqld/mysqld.sock) + mysql=( mysql --protocol=socket -uroot -hlocalhost --socket=/var/run/mysqld/mysqld.sock) for i in {30..0}; do if echo 'SELECT 1' | "${mysql[@]}" &> /dev/null; then From 1013a709420135c6f5ffd74881ee4246b0be882d Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Wed, 23 Nov 2016 06:30:11 +0100 Subject: [PATCH 074/386] Fixed dead link in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e82325677..6b19e7d5a 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ These are optimized MySQL Server Docker images, created and maintained by the My Images are updated when new MySQL Server maintenance releases and development milestones are published. Please note that milestone releases are for preview purposes only and should not be used in production setups. -We also from time to time publish special MySQL Server images that contain experimental features. Please visit the [MySQL Labs Docker image page](https://hub.docker.com/r/mysql/mysql-labs/) to see what is available. +We also from time to time publish special MySQL Server images that contain experimental features. Please take a look at the [MySQL Docker image list](https://hub.docker.com/r/mysql/) to see what is available. # How to Use the MySQL Images From ca6e42c12b22df8fea7cc57f148ef7dd9c067524 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 17 Jan 2017 16:57:20 +0100 Subject: [PATCH 075/386] Enable network access for sanity test of server version --- test/testserver.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testserver.sh b/test/testserver.sh index 0c1a2f03d..891da5246 100755 --- a/test/testserver.sh +++ b/test/testserver.sh @@ -5,7 +5,7 @@ SERVERSTART=0 SERVERCONNECT=0 SUCCESS=false echo "Starting image with MySQL version $VERSION" -docker run -e MYSQL_ROOT_PASSWORD=rot --name=testserver -p 3306:3306 -d mysql/mysql-server:$VERSION +docker run -e MYSQL_ROOT_PASSWORD=rot -e MYSQL_ROOT_HOST="%" --name=testserver -p 3306:3306 -d mysql/mysql-server:$VERSION RES=$? if [ ! $RES = 0 ]; then echo "Server start failed with error code $RES" From 236a804bdc475f117e1c165ad8d75c9b6e80b9f7 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 17 Jan 2017 16:59:08 +0100 Subject: [PATCH 076/386] Added note about custom init scripts to readme --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 6b19e7d5a..9788a8839 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,12 @@ The MySQL Server log is located at `/var/log/mysqld.log` inside the container, a more /var/log/mysqld.log +## Running custom init scripts at database creation + +After the database is created, the entrypoint script will execute any .sh or .sql scripts found in /docker-entrypoint-initdb.d/ +If you wish to execute any custom initialization scripts (e.g. for extra database or user creation), map them to this location +the first time you start up the image. + # Environment Variables When you start the MySQL image, you can adjust the configuration of the MySQL instance by passing one or more environment variables on the `docker run` command line. Do note that none of the variables below will have any effect if you start the container with a data directory that already contains a database: any pre-existing database will always be left untouched on container startup. From 2966db72e60192d175feacd69fce6811ceef8035 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Thu, 16 Feb 2017 07:57:23 +0100 Subject: [PATCH 077/386] Updated all images to use OracleLinux 7-slim This significantly reduces the size of the images --- 5.5/Dockerfile | 2 +- 5.6/Dockerfile | 2 +- 5.7/Dockerfile | 2 +- 8.0/Dockerfile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/5.5/Dockerfile b/5.5/Dockerfile index 42db391d8..c4e46a2f9 100644 --- a/5.5/Dockerfile +++ b/5.5/Dockerfile @@ -1,4 +1,4 @@ -FROM oraclelinux:7 +FROM oraclelinux:7-slim ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.54-2.el7.x86_64.rpm diff --git a/5.6/Dockerfile b/5.6/Dockerfile index e4e8c066e..e48c79be6 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -1,4 +1,4 @@ -FROM oraclelinux:7 +FROM oraclelinux:7-slim ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.35-2.el7.x86_64.rpm diff --git a/5.7/Dockerfile b/5.7/Dockerfile index 9fb53f4d8..ce227de79 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -1,4 +1,4 @@ -FROM oraclelinux:7 +FROM oraclelinux:7-slim ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.17-1.el7.x86_64.rpm # Install server diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 40941ce17..2e71a6829 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -1,4 +1,4 @@ -FROM oraclelinux:7 +FROM oraclelinux:7-slim ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-8.0-community/docker/x86_64/mysql-community-server-minimal-8.0.0-0.1.dmr.el7.x86_64.rpm # Install server From f2184f158dad836f19729d53733fac198531022f Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Tue, 11 Apr 2017 09:08:37 +0200 Subject: [PATCH 078/386] Updated 5.5 to 5.5.55 --- 5.5/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.5/Dockerfile b/5.5/Dockerfile index c4e46a2f9..64b59052d 100644 --- a/5.5/Dockerfile +++ b/5.5/Dockerfile @@ -1,6 +1,6 @@ FROM oraclelinux:7-slim -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.54-2.el7.x86_64.rpm +ENV PACKAGE_URL http://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.55-2.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From e40dee2d7b72d022b1cff39364f933280955e513 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Tue, 11 Apr 2017 13:53:52 +0200 Subject: [PATCH 079/386] Updated 8.0 to 8.0.1 --- 8.0/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 2e71a6829..4bef65658 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -1,5 +1,5 @@ FROM oraclelinux:7-slim -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-8.0-community/docker/x86_64/mysql-community-server-minimal-8.0.0-0.1.dmr.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-8.0-community/docker/x86_64/mysql-community-server-minimal-8.0.1-0.1.dmr.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From e9c3d14dbeae730a4c8e3e6ea22154097f77cf11 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Wed, 12 Apr 2017 09:02:58 +0200 Subject: [PATCH 080/386] Updated versions 5.6 to 5.6.36 5.7 to 5.7.18 Fixed whitespace issue with build test --- 5.6/Dockerfile | 3 +-- 5.7/Dockerfile | 2 +- test/testbuild.sh | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/5.6/Dockerfile b/5.6/Dockerfile index e48c79be6..73a548647 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -1,6 +1,5 @@ FROM oraclelinux:7-slim - -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.35-2.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.36-2.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ diff --git a/5.7/Dockerfile b/5.7/Dockerfile index ce227de79..c6343481b 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -1,5 +1,5 @@ FROM oraclelinux:7-slim -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.17-1.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.18-1.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ diff --git a/test/testbuild.sh b/test/testbuild.sh index 94eaea0d0..264293b60 100755 --- a/test/testbuild.sh +++ b/test/testbuild.sh @@ -16,7 +16,7 @@ fi IMAGELIST=$(docker images | grep $VERSION) -versionregex="mysql/mysql-server $VERSION" +versionregex="mysql/mysql-server\s*$VERSION" if [[ $IMAGELIST =~ $versionregex ]]; then echo "Test passed" From 9742fe8bd9ca4ac1754c59e80469a33ffa393dbe Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Fri, 28 Apr 2017 07:14:27 +0200 Subject: [PATCH 081/386] Small readme fixes * Removed "milestone 1" from 8.0 description to keep from having to update it * Fixed ALTER USER example that was missing @localhost --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9788a8839..2f7d3d5cc 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ These are optimized MySQL Server Docker images, created and maintained by the My MySQL Server 5.5 (tag: 5.5) MySQL Server 5.6 (tag: 5.6) MySQL Server 5.7, the latest GA version (tag: 5.7 or latest) - MySQL Server 8.0 Development Milestone 1, preview release (tag: 8.0) + MySQL Server 8.0, preview release (tag: 8.0) Images are updated when new MySQL Server maintenance releases and development milestones are published. Please note that milestone releases are for preview purposes only and should not be used in production setups. @@ -122,7 +122,7 @@ Start the MySQL command line client and log in using the randomly set root passw And finally, on the mysql client command line, set a new, secure root password for MySQL: - ALTER USER root IDENTIFIED BY 'my-secret-pw'; + ALTER USER 'root'@'localhost' IDENTIFIED BY 'my-secret-pw'; An alternative is to use MYSQL_ROOT_PASSWORD, but set it to point to a file that contains the password. This provides better security than having the password on the command line and is easier to use in automated processes than the random password: From 6daa99ea9516c15d447ab5436e03b59d76e90c17 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Wed, 7 Jun 2017 10:52:11 +0200 Subject: [PATCH 082/386] Added changelog file The changelog just has an intial blank 1.0.0 entry for now, but is needed to introduce proper versioning of Docker images. The idea is that the most finegrained tags will contain image version: 5.7.18-1.0.0 --- changelog | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelog diff --git a/changelog b/changelog new file mode 100644 index 000000000..17baf98a9 --- /dev/null +++ b/changelog @@ -0,0 +1,2 @@ +# 1.0.0 (2017-06-07) + * First changelog entry From 674778b81a1bfc3237f820038afa68f07794e817 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Thu, 8 Jun 2017 09:45:43 +0200 Subject: [PATCH 083/386] Added 1.0.1 changelog entry --- changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/changelog b/changelog index 17baf98a9..5be58cb00 100644 --- a/changelog +++ b/changelog @@ -1,2 +1,4 @@ +# 1.0.1 (unreleased) + * New release # 1.0.0 (2017-06-07) * First changelog entry From b297b6e61f7069df0463ad7f272120a594ff3b84 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Thu, 8 Jun 2017 09:54:05 +0200 Subject: [PATCH 084/386] Bug #86523 Wrong root user altered for MYSQL_ONETIME_PASSWORD If the variable is set, the entrypoint script will expire the root user, but the code wasn't updated after the default root user was changed from @% to @localhost (+ optional @MYSQL_ROOT_HOST), so the statement fails. --- 5.6/docker-entrypoint.sh | 13 ++++++++++--- 5.7/docker-entrypoint.sh | 13 ++++++++++--- 8.0/docker-entrypoint.sh | 13 ++++++++++--- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index d33ec3663..b8ccf983b 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -107,9 +107,16 @@ if [ "$1" = 'mysqld' ]; then done if [ ! -z "$MYSQL_ONETIME_PASSWORD" ]; then - "${mysql[@]}" <<-EOSQL - ALTER USER 'root'@'%' PASSWORD EXPIRE; - EOSQL + if [ ! -z "$MYSQL_ROOT_HOST" ]; then + "${mysql[@]}" <<-EOSQL + ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; + ALTER USER 'root'@'localhost' PASSWORD EXPIRE; + EOSQL + else + "${mysql[@]}" <<-EOSQL + ALTER USER 'root'@'localhost' PASSWORD EXPIRE; + EOSQL + fi fi if ! kill -s TERM "$pid" || ! wait "$pid"; then echo >&2 'MySQL init process failed.' diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index ceaeef9e2..b9e536fad 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -105,9 +105,16 @@ if [ "$1" = 'mysqld' ]; then done if [ ! -z "$MYSQL_ONETIME_PASSWORD" ]; then - "${mysql[@]}" <<-EOSQL - ALTER USER 'root'@'%' PASSWORD EXPIRE; - EOSQL + if [ ! -z "$MYSQL_ROOT_HOST" ]; then + "${mysql[@]}" <<-EOSQL + ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; + ALTER USER 'root'@'localhost' PASSWORD EXPIRE; + EOSQL + else + "${mysql[@]}" <<-EOSQL + ALTER USER 'root'@'localhost' PASSWORD EXPIRE; + EOSQL + fi fi if ! kill -s TERM "$pid" || ! wait "$pid"; then echo >&2 'MySQL init process failed.' diff --git a/8.0/docker-entrypoint.sh b/8.0/docker-entrypoint.sh index ceaeef9e2..b9e536fad 100755 --- a/8.0/docker-entrypoint.sh +++ b/8.0/docker-entrypoint.sh @@ -105,9 +105,16 @@ if [ "$1" = 'mysqld' ]; then done if [ ! -z "$MYSQL_ONETIME_PASSWORD" ]; then - "${mysql[@]}" <<-EOSQL - ALTER USER 'root'@'%' PASSWORD EXPIRE; - EOSQL + if [ ! -z "$MYSQL_ROOT_HOST" ]; then + "${mysql[@]}" <<-EOSQL + ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; + ALTER USER 'root'@'localhost' PASSWORD EXPIRE; + EOSQL + else + "${mysql[@]}" <<-EOSQL + ALTER USER 'root'@'localhost' PASSWORD EXPIRE; + EOSQL + fi fi if ! kill -s TERM "$pid" || ! wait "$pid"; then echo >&2 'MySQL init process failed.' From a83bc086310a940795acc378f7c8d53c3a6a98ab Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Thu, 15 Jun 2017 12:29:50 +0200 Subject: [PATCH 085/386] Add generation of control files from template --- genOracleLinux.sh | 87 ++++++++++++++++++ template/Dockerfile | 33 +++++++ template/docker-entrypoint.sh | 166 ++++++++++++++++++++++++++++++++++ 3 files changed, 286 insertions(+) create mode 100755 genOracleLinux.sh create mode 100644 template/Dockerfile create mode 100644 template/docker-entrypoint.sh diff --git a/genOracleLinux.sh b/genOracleLinux.sh new file mode 100755 index 000000000..f97f7d3c2 --- /dev/null +++ b/genOracleLinux.sh @@ -0,0 +1,87 @@ +#!/bin/bash +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +VERSIONS="5.5 5.6 5.7 8.0" + +declare -A PACKAGE_URL +PACKAGE_URL["5.5"]="https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.55-2.el7.x86_64.rpm" +PACKAGE_URL["5.6"]="https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.36-2.el7.x86_64.rpm" +PACKAGE_URL["5.7"]="https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.18-1.el7.x86_64.rpm" +PACKAGE_URL["8.0"]="https://repo.mysql.com/yum/mysql-8.0-community/docker/x86_64/mysql-community-server-minimal-8.0.1-0.1.dmr.el7.x86_64.rpm" + +# 33060 is the default port for the mysqlx plugin, new to 5.7 +declare -A PORTS +PORTS["5.5"]="3306" +PORTS["5.6"]="3306" +PORTS["5.7"]="3306 33060" +PORTS["8.0"]="3306 33060" + +declare -A PASSWORDSET +PASSWORDSET["5.5"]="SET PASSWORD FOR 'root'@'localhost'=PASSWORD('\${MYSQL_ROOT_PASSWORD}');" +PASSWORDSET["5.6"]=${PASSWORDSET["5.5"]} +PASSWORDSET["5.7"]="ALTER USER 'root'@'localhost' IDENTIFIED BY '\${MYSQL_ROOT_PASSWORD}';" +PASSWORDSET["8.0"]=${PASSWORDSET["5.7"]} + +declare -A DATABASE_INIT +DATABASE_INIT["5.5"]="mysql_install_db --user=mysql --datadir=\"\$DATADIR\" --rpm" +DATABASE_INIT["5.6"]="mysql_install_db --user=mysql --datadir=\"\$DATADIR\" --rpm --keep-my-cnf" +DATABASE_INIT["5.7"]="\"\$@\" --initialize-insecure" +DATABASE_INIT["8.0"]="\"\$@\" --initialize-insecure" + +# 5.7+ has the --daemonize flag, which makes the process fork and then exit when +# the server is ready, removing the need for a fragile wait loop +declare -A INIT_STARTUP +INIT_STARTUP["5.5"]="\"\$@\" --skip-networking --socket=/var/run/mysqld/mysqld.sock \&" +INIT_STARTUP["5.6"]="\"\$@\" --skip-networking --socket=/var/run/mysqld/mysqld.sock \&" +INIT_STARTUP["5.7"]="\"\$@\" --daemonize --skip-networking --socket=/var/run/mysqld/mysqld.sock" +INIT_STARTUP["8.0"]="\"\$@\" --daemonize --skip-networking --socket=/var/run/mysqld/mysqld.sock" + +declare -A STARTUP_WAIT +STARTUP_WAIT["5.5"]="\"yes\"" +STARTUP_WAIT["5.6"]="\"yes\"" +STARTUP_WAIT["5.7"]="\"\"" +STARTUP_WAIT["8.0"]="\"\"" + +# The option to set a user as expired, (forcing a password change before +# any other action can be taken) was added in 5.6 +declare -A EXPIRE_SUPPORT +EXPIRE_SUPPORT["5.5"]="\"\"" +EXPIRE_SUPPORT["5.6"]="\"yes\"" +EXPIRE_SUPPORT["5.7"]="\"yes\"" +EXPIRE_SUPPORT["8.0"]="\"yes\"" + +# sed is for https://bugs.mysql.com/bug.php?id=20545 +declare -A TZINFO_WORKAROUND +TZINFO_WORKAROUND["5.5"]="sed 's/Local time zone must be set--see zic manual page/FCTY/' | " +TZINFO_WORKAROUND["5.6"]="sed 's/Local time zone must be set--see zic manual page/FCTY/' | " +TZINFO_WORKAROUND["5.7"]="" +TZINFO_WORKAROUND["8.0"]="" + +for VERSION in ${VERSIONS} +do + # Dockerfile + sed 's#%%PACKAGE_URL%%#'"${PACKAGE_URL[${VERSION}]}"'#g' template/Dockerfile > tmpfile + sed -i 's/%%PORTS%%/'"${PORTS[${VERSION}]}"'/g' tmpfile + mv tmpfile ${VERSION}/Dockerfile + + # Entrypoint + sed 's#%%PASSWORDSET%%#'"${PASSWORDSET[${VERSION}]}"'#g' template/docker-entrypoint.sh > tmpfile + sed -i 's#%%DATABASE_INIT%%#'"${DATABASE_INIT[${VERSION}]}"'#g' tmpfile + sed -i 's#%%EXPIRE_SUPPORT%%#'"${EXPIRE_SUPPORT[${VERSION}]}"'#g' tmpfile + sed -i 's#%%SED_TZINFO%%#'"${TZINFO_WORKAROUND[${VERSION}]}"'#g' tmpfile + sed -i 's#%%INIT_STARTUP%%#'"${INIT_STARTUP[${VERSION}]}"'#g' tmpfile + sed -i 's#%%STARTUP_WAIT%%#'"${STARTUP_WAIT[${VERSION}]}"'#g' tmpfile + mv tmpfile ${VERSION}/docker-entrypoint.sh +done diff --git a/template/Dockerfile b/template/Dockerfile new file mode 100644 index 000000000..3ff5eaada --- /dev/null +++ b/template/Dockerfile @@ -0,0 +1,33 @@ +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +FROM oraclelinux:7-slim + +ENV PACKAGE_URL %%PACKAGE_URL%% + +# Install server +RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ + && yum install -y $PACKAGE_URL \ + && yum install -y libpwquality \ + && rm -rf /var/cache/yum/* +RUN mkdir /docker-entrypoint-initdb.d + +VOLUME /var/lib/mysql + +COPY docker-entrypoint.sh /entrypoint.sh +ENTRYPOINT ["/entrypoint.sh"] + +EXPOSE %%PORTS%% +CMD ["mysqld"] + diff --git a/template/docker-entrypoint.sh b/template/docker-entrypoint.sh new file mode 100644 index 000000000..5414e9465 --- /dev/null +++ b/template/docker-entrypoint.sh @@ -0,0 +1,166 @@ +#!/bin/bash +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +# Fetch value from server config +# We use mysqld --verbose --help instead of my_print_defaults because the +# latter only show values present in config files, and not server defaults +_get_config() { + local conf="$1"; shift + "$@" --verbose --help 2>/dev/null | awk '$1 == "'"$conf"'" { print $2; exit }' +} + +# If command starts with an option, prepend mysqld +# This allows users to add command-line options without +# needing to specify the "mysqld" command +if [ "${1:0:1}" = '-' ]; then + set -- mysqld "$@" +fi + +if [ "$1" = 'mysqld' ]; then + # Test that the server can start. We redirect stdout to /dev/null so + # only the error messages are left. + result=0 + output=$("$@" --verbose --help 2>&1 > /dev/null) || result=$? + if [ ! "$result" = "0" ]; then + echo >&2 'ERROR: Unable to start MySQL. Please check your configuration.' + echo >&2 "$output" + exit 1 + fi + + # Get config + DATADIR="$(_get_config 'datadir' "$@")" + PIDFILE="$(_get_config 'pid-file' "$@")" + + if [ ! -d "$DATADIR/mysql" ]; then + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 'ERROR: No password option specified for new database.' + echo >&2 ' You need to specify one of the following:' + echo >&2 ' - MYSQL_RANDOM_ROOT_PASSWORD (recommended)' + echo >&2 ' - MYSQL_ROOT_PASSWORD' + echo >&2 ' - MYSQL_ALLOW_EMPTY_PASSWORD' + exit 1 + fi + # If the password variable is a filename we use the contents of the file + if [ -f "$MYSQL_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + fi + mkdir -p "$DATADIR" + chown -R mysql:mysql "$DATADIR" + + echo 'Initializing database' + %%DATABASE_INIT%% + echo 'Database initialized' + + %%INIT_STARTUP%% + + mysql=( mysql --protocol=socket -uroot -hlocalhost --socket=/var/run/mysqld/mysqld.sock) + + if [ ! -z %%STARTUP_WAIT%% ]; + then + for i in {30..0}; do + if mysqladmin --socket=/var/run/mysqld/mysqld.sock ping &>/dev/null; then + break + fi + echo 'Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 'Timeout during MySQL init.' + exit 1 + fi + fi + + pid=$(cat $PIDFILE) + echo "Pidfile: $PIDFILE - pid: $pid" + + mysql_tzinfo_to_sql /usr/share/zoneinfo | %%SED_TZINFO%%"${mysql[@]}" mysql + + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(pwmake 128)" + echo "GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + fi + if [ -z "$MYSQL_ROOT_HOST" ]; then + ROOTCREATE="%%PASSWORDSET%%" + else + ROOTCREATE="%%PASSWORDSET%% \ + CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + fi + "${mysql[@]}" <<-EOSQL + -- What's done in this file shouldn't be replicated + -- or products like mysql-fabric won't work + SET @@SESSION.SQL_LOG_BIN=0; + DELETE FROM mysql.user WHERE user NOT IN ('mysql.sys', 'mysqlxsys', 'root') OR host NOT IN ('localhost'); + ${ROOTCREATE} + FLUSH PRIVILEGES ; + EOSQL + if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then + mysql+=( -p"${MYSQL_ROOT_PASSWORD}" ) + fi + + if [ "$MYSQL_DATABASE" ]; then + echo "CREATE DATABASE IF NOT EXISTS \`$MYSQL_DATABASE\` ;" | "${mysql[@]}" + mysql+=( "$MYSQL_DATABASE" ) + fi + + if [ "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then + echo "CREATE USER '"$MYSQL_USER"'@'%' IDENTIFIED BY '"$MYSQL_PASSWORD"' ;" | "${mysql[@]}" + + if [ "$MYSQL_DATABASE" ]; then + echo "GRANT ALL ON \`"$MYSQL_DATABASE"\`.* TO '"$MYSQL_USER"'@'%' ;" | "${mysql[@]}" + fi + + echo 'FLUSH PRIVILEGES ;' | "${mysql[@]}" + fi + echo + for f in /docker-entrypoint-initdb.d/*; do + case "$f" in + *.sh) echo "$0: running $f"; . "$f" ;; + *.sql) echo "$0: running $f"; "${mysql[@]}" < "$f" && echo ;; + *) echo "$0: ignoring $f" ;; + esac + echo + done + + if [ ! -z "$MYSQL_ONETIME_PASSWORD" ]; then + if [ -z %%EXPIRE_SUPPORT%% ]; then + echo "User expiration is only supported in MySQL 5.6+" + else + if [ ! -z "$MYSQL_ROOT_HOST" ]; then + "${mysql[@]}" <<-EOSQL + ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; + ALTER USER 'root'@'localhost' PASSWORD EXPIRE; + EOSQL + else + "${mysql[@]}" <<-EOSQL + ALTER USER 'root'@'localhost' PASSWORD EXPIRE; + EOSQL + fi + fi + fi + mysqladmin shutdown -uroot -p${MYSQL_ROOT_PASSWORD} --socket=/var/run/mysqld/mysqld.sock + + echo + echo 'MySQL init process done. Ready for start up.' + echo + fi + + chown -R mysql:mysql "$DATADIR" +fi + +exec "$@" + From 01e80b9ebb6c98289df57545b0655f62e63d7781 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Thu, 22 Jun 2017 12:32:35 +0200 Subject: [PATCH 086/386] Fix missing executable flag on generated entrypoint files --- genOracleLinux.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/genOracleLinux.sh b/genOracleLinux.sh index f97f7d3c2..96cd0f1e2 100755 --- a/genOracleLinux.sh +++ b/genOracleLinux.sh @@ -84,4 +84,5 @@ do sed -i 's#%%INIT_STARTUP%%#'"${INIT_STARTUP[${VERSION}]}"'#g' tmpfile sed -i 's#%%STARTUP_WAIT%%#'"${STARTUP_WAIT[${VERSION}]}"'#g' tmpfile mv tmpfile ${VERSION}/docker-entrypoint.sh + chmod +x ${VERSION}/docker-entrypoint.sh done From a22032a472243badb349ae65b0f9a958c9550e6f Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Thu, 22 Jun 2017 12:34:03 +0200 Subject: [PATCH 087/386] Made PACKAGE_URL ARG instead of ENV This allows it to be overridden at build-time --- template/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/Dockerfile b/template/Dockerfile index 3ff5eaada..fbeb805c2 100644 --- a/template/Dockerfile +++ b/template/Dockerfile @@ -14,7 +14,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ENV PACKAGE_URL %%PACKAGE_URL%% +ARG PACKAGE_URL=%%PACKAGE_URL%% # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From 007b26db1859fc3f2ef59bf0017286caba8aa15b Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Wed, 5 Jul 2017 08:36:28 +0200 Subject: [PATCH 088/386] Readme update Made the version support statement more general --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2f7d3d5cc..31f546c63 100644 --- a/README.md +++ b/README.md @@ -208,7 +208,7 @@ These Docker images are optimized for size, which means that we have reduced the # Supported Docker Versions -These images are officially supported by the MySQL team on Docker version 1.9. Support for older versions (down to 1.0) is provided on a best-effort basis, but we strongly recommend running on the most recent version, since that is assumed for parts of the documentation above. +These images are created by the MySQL team for use on the latest version of Docker. Support for older versions (down to 1.0) is provided on a best-effort basis, but we strongly recommend running on the most recent version, since that is assumed for parts of the documentation above. # User Feedback From 1acd3548f0185c10b3dd0e79c5c25a257556044a Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Mon, 26 Jun 2017 12:30:52 +0200 Subject: [PATCH 089/386] Added healthcheck Before starting up the main server process (after server initialization or if no init needed) the entrypoint script will touch the file /mysql-init-complete The healthcheck script works by first checking if this file exists, and it it does run mysqladmin ping to see if the server is ready. --- genOracleLinux.sh | 4 ++++ template/Dockerfile | 3 ++- template/docker-entrypoint.sh | 3 +++ template/healthcheck.sh | 24 ++++++++++++++++++++++++ 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 template/healthcheck.sh diff --git a/genOracleLinux.sh b/genOracleLinux.sh index 96cd0f1e2..232da4168 100755 --- a/genOracleLinux.sh +++ b/genOracleLinux.sh @@ -85,4 +85,8 @@ do sed -i 's#%%STARTUP_WAIT%%#'"${STARTUP_WAIT[${VERSION}]}"'#g' tmpfile mv tmpfile ${VERSION}/docker-entrypoint.sh chmod +x ${VERSION}/docker-entrypoint.sh + + # Healthcheck + cp template/healthcheck.sh ${VERSION}/ + chmod +x ${VERSION}/healthcheck.sh done diff --git a/template/Dockerfile b/template/Dockerfile index fbeb805c2..f083ca331 100644 --- a/template/Dockerfile +++ b/template/Dockerfile @@ -26,8 +26,9 @@ RUN mkdir /docker-entrypoint-initdb.d VOLUME /var/lib/mysql COPY docker-entrypoint.sh /entrypoint.sh +COPY healthcheck.sh /healthcheck.sh ENTRYPOINT ["/entrypoint.sh"] - +HEALTHCHECK CMD /healthcheck.sh EXPOSE %%PORTS%% CMD ["mysqld"] diff --git a/template/docker-entrypoint.sh b/template/docker-entrypoint.sh index 5414e9465..4e1bf11d3 100644 --- a/template/docker-entrypoint.sh +++ b/template/docker-entrypoint.sh @@ -159,6 +159,9 @@ if [ "$1" = 'mysqld' ]; then echo fi + # Used by healthcheck to make sure it doesn't mistakenly report container + # healthy during startup + touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" fi diff --git a/template/healthcheck.sh b/template/healthcheck.sh new file mode 100644 index 000000000..35236c84d --- /dev/null +++ b/template/healthcheck.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# The mysql-init-complete file is touched by the entrypoint file before the +# main server process is started +if [ -f /mysql-init-complete ]; # The entrypoint script touches this file +then # Ping server to see if it is ready + mysqladmin ping +else # Initialization still in progress + exit 1 +fi From 13507953098b9cb707418a216ec5ac9d84326221 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Wed, 28 Jun 2017 16:09:13 +0200 Subject: [PATCH 090/386] Bug #86523 Wrong root user altered for MYSQL_ONETIME_PASSWORD New template system caused a regression, as the mysqladmin shutdown command would fail if the user was expired. User is now expired after the normal database init, with an --init-file script --- template/docker-entrypoint.sh | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/template/docker-entrypoint.sh b/template/docker-entrypoint.sh index 4e1bf11d3..0c8a9aa71 100644 --- a/template/docker-entrypoint.sh +++ b/template/docker-entrypoint.sh @@ -85,7 +85,6 @@ if [ "$1" = 'mysqld' ]; then fi pid=$(cat $PIDFILE) - echo "Pidfile: $PIDFILE - pid: $pid" mysql_tzinfo_to_sql /usr/share/zoneinfo | %%SED_TZINFO%%"${mysql[@]}" mysql @@ -136,23 +135,41 @@ if [ "$1" = 'mysqld' ]; then echo done + # To avoid using password on commandline, put it in a temporary file + PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + install /dev/null -m0600 -omysql -gmysql "${PASSFILE}" + cat >$PASSFILE < ${SQL} +ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF else - "${mysql[@]}" <<-EOSQL - ALTER USER 'root'@'localhost' PASSWORD EXPIRE; - EOSQL + cat << EOF > ${SQL} +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF fi + set -- "$@" --init-file=$SQL + unset SQL fi fi - mysqladmin shutdown -uroot -p${MYSQL_ROOT_PASSWORD} --socket=/var/run/mysqld/mysqld.sock echo echo 'MySQL init process done. Ready for start up.' From 15fc9d9b265b63d9b452a46dd3bb7c03e09da873 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Thu, 29 Jun 2017 09:52:39 +0200 Subject: [PATCH 091/386] Some variable cleanup --- template/docker-entrypoint.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/template/docker-entrypoint.sh b/template/docker-entrypoint.sh index 0c8a9aa71..5fc2fa3bf 100644 --- a/template/docker-entrypoint.sh +++ b/template/docker-entrypoint.sh @@ -137,14 +137,14 @@ if [ "$1" = 'mysqld' ]; then # To avoid using password on commandline, put it in a temporary file PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) - install /dev/null -m0600 -omysql -gmysql "${PASSFILE}" - cat >$PASSFILE <"$PASSFILE" < ${SQL} + cat << EOF > "$SQL" ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; ALTER USER 'root'@'localhost' PASSWORD EXPIRE; EOF else - cat << EOF > ${SQL} + cat << EOF > "$SQL" ALTER USER 'root'@'localhost' PASSWORD EXPIRE; EOF fi - set -- "$@" --init-file=$SQL + set -- "$@" --init-file="$SQL" unset SQL fi fi From 57513e281bb6616f5d7d0e3f0f594db38ac440b8 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Thu, 29 Jun 2017 10:38:56 +0200 Subject: [PATCH 092/386] Use socket setting from configuration during database init --- genOracleLinux.sh | 8 ++++---- template/docker-entrypoint.sh | 10 ++++------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/genOracleLinux.sh b/genOracleLinux.sh index 232da4168..dc36f317f 100755 --- a/genOracleLinux.sh +++ b/genOracleLinux.sh @@ -43,10 +43,10 @@ DATABASE_INIT["8.0"]="\"\$@\" --initialize-insecure" # 5.7+ has the --daemonize flag, which makes the process fork and then exit when # the server is ready, removing the need for a fragile wait loop declare -A INIT_STARTUP -INIT_STARTUP["5.5"]="\"\$@\" --skip-networking --socket=/var/run/mysqld/mysqld.sock \&" -INIT_STARTUP["5.6"]="\"\$@\" --skip-networking --socket=/var/run/mysqld/mysqld.sock \&" -INIT_STARTUP["5.7"]="\"\$@\" --daemonize --skip-networking --socket=/var/run/mysqld/mysqld.sock" -INIT_STARTUP["8.0"]="\"\$@\" --daemonize --skip-networking --socket=/var/run/mysqld/mysqld.sock" +INIT_STARTUP["5.5"]="\"\$@\" --skip-networking --socket=\"\$SOCKET\" \&" +INIT_STARTUP["5.6"]="\"\$@\" --skip-networking --socket=\"\$SOCKET\" \&" +INIT_STARTUP["5.7"]="\"\$@\" --daemonize --skip-networking --socket=\"\$SOCKET\"" +INIT_STARTUP["8.0"]="\"\$@\" --daemonize --skip-networking --socket=\"\$SOCKET\"" declare -A STARTUP_WAIT STARTUP_WAIT["5.5"]="\"yes\"" diff --git a/template/docker-entrypoint.sh b/template/docker-entrypoint.sh index 5fc2fa3bf..7525f6e38 100644 --- a/template/docker-entrypoint.sh +++ b/template/docker-entrypoint.sh @@ -43,7 +43,6 @@ if [ "$1" = 'mysqld' ]; then # Get config DATADIR="$(_get_config 'datadir' "$@")" - PIDFILE="$(_get_config 'pid-file' "$@")" if [ ! -d "$DATADIR/mysql" ]; then if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then @@ -65,14 +64,15 @@ if [ "$1" = 'mysqld' ]; then %%DATABASE_INIT%% echo 'Database initialized' + SOCKET="$(_get_config 'socket' "$@")" %%INIT_STARTUP%% - mysql=( mysql --protocol=socket -uroot -hlocalhost --socket=/var/run/mysqld/mysqld.sock) + mysql=( mysql --protocol=socket -uroot -hlocalhost --socket="$SOCKET") if [ ! -z %%STARTUP_WAIT%% ]; then for i in {30..0}; do - if mysqladmin --socket=/var/run/mysqld/mysqld.sock ping &>/dev/null; then + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then break fi echo 'Waiting for server...' @@ -84,8 +84,6 @@ if [ "$1" = 'mysqld' ]; then fi fi - pid=$(cat $PIDFILE) - mysql_tzinfo_to_sql /usr/share/zoneinfo | %%SED_TZINFO%%"${mysql[@]}" mysql if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then @@ -143,7 +141,7 @@ if [ "$1" = 'mysqld' ]; then password=${MYSQL_ROOT_PASSWORD} EOF # When using a local socket, mysqladmin shutdown will only complete when the server is actually down - mysqladmin --defaults-extra-file="$PASSFILE" shutdown -uroot --socket=/var/run/mysqld/mysqld.sock + mysqladmin --defaults-extra-file="$PASSFILE" shutdown -uroot --socket="$SOCKET" rm -f "$PASSFILE" unset PASSFILE echo "Server shut down" From 326fffeda3598ca584df86df3f720588274879cb Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Thu, 29 Jun 2017 11:53:45 +0200 Subject: [PATCH 093/386] Keep mysql.session instead of mysqlxsys user The latter was replaced by the former, for more consistent naming of system users. --- template/docker-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/docker-entrypoint.sh b/template/docker-entrypoint.sh index 7525f6e38..12dd91fee 100644 --- a/template/docker-entrypoint.sh +++ b/template/docker-entrypoint.sh @@ -101,7 +101,7 @@ if [ "$1" = 'mysqld' ]; then -- What's done in this file shouldn't be replicated -- or products like mysql-fabric won't work SET @@SESSION.SQL_LOG_BIN=0; - DELETE FROM mysql.user WHERE user NOT IN ('mysql.sys', 'mysqlxsys', 'root') OR host NOT IN ('localhost'); + DELETE FROM mysql.user WHERE user NOT IN ('mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); ${ROOTCREATE} FLUSH PRIVILEGES ; EOSQL From f6ea7ee6bc38d8534d4bb3b4429b8ebb8f3dec95 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Fri, 30 Jun 2017 08:38:06 +0200 Subject: [PATCH 094/386] Write password to temporary file for client use Running the client with the password on the command line could make it visible to other users on the host machine --- template/docker-entrypoint.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/template/docker-entrypoint.sh b/template/docker-entrypoint.sh index 12dd91fee..11bcdcf31 100644 --- a/template/docker-entrypoint.sh +++ b/template/docker-entrypoint.sh @@ -67,7 +67,11 @@ if [ "$1" = 'mysqld' ]; then SOCKET="$(_get_config 'socket' "$@")" %%INIT_STARTUP%% - mysql=( mysql --protocol=socket -uroot -hlocalhost --socket="$SOCKET") + # To avoid using password on commandline, put it in a temporary file. + # The file is only populated when and if the root password is set. + PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + install /dev/null -m0600 -omysql -gmysql "$PASSFILE" + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET") if [ ! -z %%STARTUP_WAIT%% ]; then @@ -106,7 +110,12 @@ if [ "$1" = 'mysqld' ]; then FLUSH PRIVILEGES ; EOSQL if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then - mysql+=( -p"${MYSQL_ROOT_PASSWORD}" ) + # Put the password into the temporary config file + cat >"$PASSFILE" <"$PASSFILE" < Date: Fri, 30 Jun 2017 08:39:02 +0200 Subject: [PATCH 095/386] Add a user for the healthcheck script. Running mysqladmin ping against root without the correct credentials will create access denied messages in the logs, and will run into issues with connection_control plugin. --- template/docker-entrypoint.sh | 9 +++++++++ template/healthcheck.sh | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/template/docker-entrypoint.sh b/template/docker-entrypoint.sh index 11bcdcf31..4c2a192ba 100644 --- a/template/docker-entrypoint.sh +++ b/template/docker-entrypoint.sh @@ -106,6 +106,7 @@ if [ "$1" = 'mysqld' ]; then -- or products like mysql-fabric won't work SET @@SESSION.SQL_LOG_BIN=0; DELETE FROM mysql.user WHERE user NOT IN ('mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; ${ROOTCREATE} FLUSH PRIVILEGES ; EOSQL @@ -178,6 +179,14 @@ EOF # Used by healthcheck to make sure it doesn't mistakenly report container # healthy during startup + # Put the password into the temporary config file + touch /healthcheck.cnf + cat >"/healthcheck.cnf" < Date: Fri, 30 Jun 2017 09:48:12 +0200 Subject: [PATCH 096/386] Add [Entrypoint] to echo statements in entrypoint scripts This should make it a bit simpler to see what is coming from the script and what is from the MySQL processes. --- template/docker-entrypoint.sh | 38 +++++++++++++++++------------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/template/docker-entrypoint.sh b/template/docker-entrypoint.sh index 4c2a192ba..527443ff5 100644 --- a/template/docker-entrypoint.sh +++ b/template/docker-entrypoint.sh @@ -36,8 +36,8 @@ if [ "$1" = 'mysqld' ]; then result=0 output=$("$@" --verbose --help 2>&1 > /dev/null) || result=$? if [ ! "$result" = "0" ]; then - echo >&2 'ERROR: Unable to start MySQL. Please check your configuration.' - echo >&2 "$output" + echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' + echo >&2 "[Entrypoint] $output" exit 1 fi @@ -46,11 +46,11 @@ if [ "$1" = 'mysqld' ]; then if [ ! -d "$DATADIR/mysql" ]; then if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - echo >&2 'ERROR: No password option specified for new database.' - echo >&2 ' You need to specify one of the following:' - echo >&2 ' - MYSQL_RANDOM_ROOT_PASSWORD (recommended)' - echo >&2 ' - MYSQL_ROOT_PASSWORD' - echo >&2 ' - MYSQL_ALLOW_EMPTY_PASSWORD' + echo >&2 '[Entrypoint] ERROR: No password option specified for new database.' + echo >&2 '[Entrypoint] You need to specify one of the following:' + echo >&2 '[Entrypoint] - MYSQL_RANDOM_ROOT_PASSWORD (recommended)' + echo >&2 '[Entrypoint] - MYSQL_ROOT_PASSWORD' + echo >&2 '[Entrypoint] - MYSQL_ALLOW_EMPTY_PASSWORD' exit 1 fi # If the password variable is a filename we use the contents of the file @@ -60,9 +60,9 @@ if [ "$1" = 'mysqld' ]; then mkdir -p "$DATADIR" chown -R mysql:mysql "$DATADIR" - echo 'Initializing database' + echo '[Entrypoint] Initializing database' %%DATABASE_INIT%% - echo 'Database initialized' + echo '[Entrypoint] Database initialized' SOCKET="$(_get_config 'socket' "$@")" %%INIT_STARTUP%% @@ -79,11 +79,11 @@ if [ "$1" = 'mysqld' ]; then if mysqladmin --socket="$SOCKET" ping &>/dev/null; then break fi - echo 'Waiting for server...' + echo '[Entrypoint] Waiting for server...' sleep 1 done if [ "$i" = 0 ]; then - echo >&2 'Timeout during MySQL init.' + echo >&2 '[Entrypoint] Timeout during MySQL init.' exit 1 fi fi @@ -92,7 +92,7 @@ if [ "$1" = 'mysqld' ]; then if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then MYSQL_ROOT_PASSWORD="$(pwmake 128)" - echo "GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" fi if [ -z "$MYSQL_ROOT_HOST" ]; then ROOTCREATE="%%PASSWORDSET%%" @@ -136,9 +136,9 @@ EOF echo for f in /docker-entrypoint-initdb.d/*; do case "$f" in - *.sh) echo "$0: running $f"; . "$f" ;; - *.sql) echo "$0: running $f"; "${mysql[@]}" < "$f" && echo ;; - *) echo "$0: ignoring $f" ;; + *.sh) echo "[Entrypoint] running $f"; . "$f" ;; + *.sql) echo "[Entrypoint] running $f"; "${mysql[@]}" < "$f" && echo ;; + *) echo "[Entrypoint] ignoring $f" ;; esac echo done @@ -147,14 +147,14 @@ EOF mysqladmin --defaults-extra-file="$PASSFILE" shutdown -uroot --socket="$SOCKET" rm -f "$PASSFILE" unset PASSFILE - echo "Server shut down" + echo "[Entrypoint] Server shut down" # This needs to be done outside the normal init, since mysqladmin shutdown will not work after if [ ! -z "$MYSQL_ONETIME_PASSWORD" ]; then if [ -z %%EXPIRE_SUPPORT%% ]; then - echo "User expiration is only supported in MySQL 5.6+" + echo "[Entrypoint] User expiration is only supported in MySQL 5.6+" else - echo "Setting root user as expired. Password will need to be changed before database can be used." + echo "[Entrypoint] Setting root user as expired. Password will need to be changed before database can be used." SQL=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) install /dev/null -m0600 -omysql -gmysql "$SQL" if [ ! -z "$MYSQL_ROOT_HOST" ]; then @@ -173,7 +173,7 @@ EOF fi echo - echo 'MySQL init process done. Ready for start up.' + echo '[Entrypoint] MySQL init process done. Ready for start up.' echo fi From 8034c600328cda178011bfc7913984e5c0057c03 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Fri, 30 Jun 2017 13:45:40 +0200 Subject: [PATCH 097/386] Make config fetching more robust In some cases _get_config will fail because it gets confused by several matches. This happens for socket if mysqlx plugin is loaded (leading it setting "socket=(in". Limiting matches to those that start the line to make it more robust. --- template/docker-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/docker-entrypoint.sh b/template/docker-entrypoint.sh index 527443ff5..de53eb9b1 100644 --- a/template/docker-entrypoint.sh +++ b/template/docker-entrypoint.sh @@ -20,7 +20,7 @@ set -e # latter only show values present in config files, and not server defaults _get_config() { local conf="$1"; shift - "$@" --verbose --help 2>/dev/null | awk '$1 == "'"$conf"'" { print $2; exit }' + "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' } # If command starts with an option, prepend mysqld From ec1ec02f7c7bae9115c7e13305ae33a20125b11a Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Wed, 5 Jul 2017 08:35:07 +0200 Subject: [PATCH 098/386] Small comment describing how the templating works --- genOracleLinux.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/genOracleLinux.sh b/genOracleLinux.sh index dc36f317f..fe189ecc4 100755 --- a/genOracleLinux.sh +++ b/genOracleLinux.sh @@ -13,6 +13,10 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# This script will simply use sed to replace placeholder variables in the +# files in template/ with version-specific variants. +# Example: mysql_install_db for 5.5 and 5.6, and mysqld --initialize for newer VERSIONS="5.5 5.6 5.7 8.0" declare -A PACKAGE_URL From a7de33605311936f809ee68fa5cbfa3b1d7dd309 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Thu, 6 Jul 2017 11:20:10 +0200 Subject: [PATCH 099/386] Small Dockerfile cleanup --- template/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/template/Dockerfile b/template/Dockerfile index f083ca331..6a3940582 100644 --- a/template/Dockerfile +++ b/template/Dockerfile @@ -20,8 +20,8 @@ ARG PACKAGE_URL=%%PACKAGE_URL%% RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ && yum install -y $PACKAGE_URL \ && yum install -y libpwquality \ - && rm -rf /var/cache/yum/* -RUN mkdir /docker-entrypoint-initdb.d + && yum clean all \ + && mkdir /docker-entrypoint-initdb.d VOLUME /var/lib/mysql From 49f6c97a4c1eb8dc240aa331bf0a6679cefca975 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Thu, 6 Jul 2017 11:22:17 +0200 Subject: [PATCH 100/386] Special characters in password could break client commands If the password contained certain special characters (such as #), the client would fail to read it properly from the temporary file, causing login errors during init. Fixed by adding quotes around it in the file. --- template/docker-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/docker-entrypoint.sh b/template/docker-entrypoint.sh index de53eb9b1..c71dc59d2 100644 --- a/template/docker-entrypoint.sh +++ b/template/docker-entrypoint.sh @@ -114,7 +114,7 @@ if [ "$1" = 'mysqld' ]; then # Put the password into the temporary config file cat >"$PASSFILE" < Date: Thu, 6 Jul 2017 11:38:22 +0200 Subject: [PATCH 101/386] Added installation of shell to 5.7 and 8.0 images --- genOracleLinux.sh | 7 +++++++ template/Dockerfile | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/genOracleLinux.sh b/genOracleLinux.sh index fe189ecc4..a3402d7c8 100755 --- a/genOracleLinux.sh +++ b/genOracleLinux.sh @@ -25,6 +25,12 @@ PACKAGE_URL["5.6"]="https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64 PACKAGE_URL["5.7"]="https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.18-1.el7.x86_64.rpm" PACKAGE_URL["8.0"]="https://repo.mysql.com/yum/mysql-8.0-community/docker/x86_64/mysql-community-server-minimal-8.0.1-0.1.dmr.el7.x86_64.rpm" +declare -A PACKAGE_URL_SHELL +PACKAGE_URL_SHELL["5.5"]="\"\"" +PACKAGE_URL_SHELL["5.6"]="\"\"" +PACKAGE_URL_SHELL["5.7"]="https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/mysql-shell-1.0.9-1.el7.x86_64.rpm" +PACKAGE_URL_SHELL["8.0"]="https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/mysql-shell-1.0.9-1.el7.x86_64.rpm" + # 33060 is the default port for the mysqlx plugin, new to 5.7 declare -A PORTS PORTS["5.5"]="3306" @@ -77,6 +83,7 @@ for VERSION in ${VERSIONS} do # Dockerfile sed 's#%%PACKAGE_URL%%#'"${PACKAGE_URL[${VERSION}]}"'#g' template/Dockerfile > tmpfile + sed -i 's#%%PACKAGE_URL_SHELL%%#'"${PACKAGE_URL_SHELL[${VERSION}]}"'#g' tmpfile sed -i 's/%%PORTS%%/'"${PORTS[${VERSION}]}"'/g' tmpfile mv tmpfile ${VERSION}/Dockerfile diff --git a/template/Dockerfile b/template/Dockerfile index 6a3940582..4e2eafc79 100644 --- a/template/Dockerfile +++ b/template/Dockerfile @@ -15,11 +15,11 @@ FROM oraclelinux:7-slim ARG PACKAGE_URL=%%PACKAGE_URL%% +ARG PACKAGE_URL_SHELL=%%PACKAGE_URL_SHELL%% # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ - && yum install -y $PACKAGE_URL \ - && yum install -y libpwquality \ + && yum install -y $PACKAGE_URL $PACKAGE_URL_SHELL libpwquality \ && yum clean all \ && mkdir /docker-entrypoint-initdb.d From fb098a6a750dd9a7b19f5aaf02842050cdd84573 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Thu, 6 Jul 2017 13:30:26 +0200 Subject: [PATCH 102/386] Use https to fetch gpg key --- template/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/Dockerfile b/template/Dockerfile index 4e2eafc79..0a594e4ac 100644 --- a/template/Dockerfile +++ b/template/Dockerfile @@ -18,7 +18,7 @@ ARG PACKAGE_URL=%%PACKAGE_URL%% ARG PACKAGE_URL_SHELL=%%PACKAGE_URL_SHELL%% # Install server -RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ +RUN rpmkeys --import https://repo.mysql.com/RPM-GPG-KEY-mysql \ && yum install -y $PACKAGE_URL $PACKAGE_URL_SHELL libpwquality \ && yum clean all \ && mkdir /docker-entrypoint-initdb.d From 53d8b591a368e997f21fe76a1f036d125839a3d5 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Thu, 6 Jul 2017 14:03:47 +0200 Subject: [PATCH 103/386] Added basic start and finish output from entrypoint. Without this, for newer service versions, docker logs would give no output when starting with an existing database. --- genOracleLinux.sh | 7 +++++++ template/docker-entrypoint.sh | 2 ++ 2 files changed, 9 insertions(+) diff --git a/genOracleLinux.sh b/genOracleLinux.sh index a3402d7c8..137bb9dd5 100755 --- a/genOracleLinux.sh +++ b/genOracleLinux.sh @@ -19,6 +19,12 @@ # Example: mysql_install_db for 5.5 and 5.6, and mysqld --initialize for newer VERSIONS="5.5 5.6 5.7 8.0" +declare -A SERVER_VERSION_FULL +SERVER_VERSION_FULL["5.5"]="5.5.57-1.1.0" +SERVER_VERSION_FULL["5.6"]="5.6.37-1.1.0" +SERVER_VERSION_FULL["5.7"]="5.7.19-1.1.0" +SERVER_VERSION_FULL["8.0"]="8.0.2-dmr-1.1.0" + declare -A PACKAGE_URL PACKAGE_URL["5.5"]="https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.55-2.el7.x86_64.rpm" PACKAGE_URL["5.6"]="https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.36-2.el7.x86_64.rpm" @@ -94,6 +100,7 @@ do sed -i 's#%%SED_TZINFO%%#'"${TZINFO_WORKAROUND[${VERSION}]}"'#g' tmpfile sed -i 's#%%INIT_STARTUP%%#'"${INIT_STARTUP[${VERSION}]}"'#g' tmpfile sed -i 's#%%STARTUP_WAIT%%#'"${STARTUP_WAIT[${VERSION}]}"'#g' tmpfile + sed -i 's#%%SERVER_VERSION_FULL%%#'"${SERVER_VERSION_FULL[${VERSION}]}"'#g' tmpfile mv tmpfile ${VERSION}/docker-entrypoint.sh chmod +x ${VERSION}/docker-entrypoint.sh diff --git a/template/docker-entrypoint.sh b/template/docker-entrypoint.sh index c71dc59d2..b965c489a 100644 --- a/template/docker-entrypoint.sh +++ b/template/docker-entrypoint.sh @@ -15,6 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e +echo "[Entrypoint] MySQL Docker Image %%SERVER_VERSION_FULL%%" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -189,6 +190,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" + echo "[Entrypoint] Starting MySQL %%SERVER_VERSION_FULL%%" fi exec "$@" From c0ac31c4ab2bda6eb7b607003e89e0473502f709 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Thu, 6 Jul 2017 14:26:57 +0200 Subject: [PATCH 104/386] Moved fetching of socket config to fix healthcheck for existing database. The socket config was only read when initializing a new database, but is added to the healthcheck config which is run regardless. --- template/docker-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/docker-entrypoint.sh b/template/docker-entrypoint.sh index b965c489a..ed0280e64 100644 --- a/template/docker-entrypoint.sh +++ b/template/docker-entrypoint.sh @@ -44,6 +44,7 @@ if [ "$1" = 'mysqld' ]; then # Get config DATADIR="$(_get_config 'datadir' "$@")" + SOCKET="$(_get_config 'socket' "$@")" if [ ! -d "$DATADIR/mysql" ]; then if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then @@ -65,7 +66,6 @@ if [ "$1" = 'mysqld' ]; then %%DATABASE_INIT%% echo '[Entrypoint] Database initialized' - SOCKET="$(_get_config 'socket' "$@")" %%INIT_STARTUP%% # To avoid using password on commandline, put it in a temporary file. From 7f3fd163f253369d7701eddac8cc3c6e37fbd8df Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Mon, 17 Jul 2017 23:37:44 +0200 Subject: [PATCH 105/386] Updated server versions * 5.5.57 * 5.6.37 * 5.7.19 * 8.0.2-dmr --- 5.5/Dockerfile | 2 +- 5.6/Dockerfile | 2 +- 5.7/Dockerfile | 2 +- 8.0/Dockerfile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/5.5/Dockerfile b/5.5/Dockerfile index 64b59052d..e3646d030 100644 --- a/5.5/Dockerfile +++ b/5.5/Dockerfile @@ -1,6 +1,6 @@ FROM oraclelinux:7-slim -ENV PACKAGE_URL http://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.55-2.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.57-2.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ diff --git a/5.6/Dockerfile b/5.6/Dockerfile index 73a548647..dd87616e8 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -1,5 +1,5 @@ FROM oraclelinux:7-slim -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.36-2.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.37-2.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ diff --git a/5.7/Dockerfile b/5.7/Dockerfile index c6343481b..ba2f977dc 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -1,5 +1,5 @@ FROM oraclelinux:7-slim -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.18-1.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.19-1.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 4bef65658..f90fa30c6 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -1,5 +1,5 @@ FROM oraclelinux:7-slim -ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-8.0-community/docker/x86_64/mysql-community-server-minimal-8.0.1-0.1.dmr.el7.x86_64.rpm +ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-8.0-community/docker/x86_64/mysql-community-server-minimal-8.0.2-0.1.dmr.el7.x86_64.rpm # Install server RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ From d0ee591084f44034e87ec2129e12afbbd49c6377 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Fri, 7 Jul 2017 12:05:11 +0200 Subject: [PATCH 106/386] All sources generated genOracleLinux executed --- 5.5/Dockerfile | 29 ++++++-- 5.5/docker-entrypoint.sh | 152 +++++++++++++++++++++++++++---------- 5.5/healthcheck.sh | 24 ++++++ 5.6/Dockerfile | 31 ++++++-- 5.6/docker-entrypoint.sh | 157 +++++++++++++++++++++++++++------------ 5.6/healthcheck.sh | 24 ++++++ 5.7/Dockerfile | 30 ++++++-- 5.7/docker-entrypoint.sh | 154 +++++++++++++++++++++++++++----------- 5.7/healthcheck.sh | 24 ++++++ 8.0/Dockerfile | 30 ++++++-- 8.0/docker-entrypoint.sh | 154 +++++++++++++++++++++++++++----------- 8.0/healthcheck.sh | 24 ++++++ genOracleLinux.sh | 8 +- 13 files changed, 633 insertions(+), 208 deletions(-) create mode 100755 5.5/healthcheck.sh create mode 100755 5.6/healthcheck.sh create mode 100755 5.7/healthcheck.sh create mode 100755 8.0/healthcheck.sh diff --git a/5.5/Dockerfile b/5.5/Dockerfile index 64b59052d..3fcd279cc 100644 --- a/5.5/Dockerfile +++ b/5.5/Dockerfile @@ -1,19 +1,34 @@ +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ENV PACKAGE_URL http://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.55-2.el7.x86_64.rpm +ARG PACKAGE_URL=https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.57-2.el7.x86_64.rpm +ARG PACKAGE_URL_SHELL="" # Install server -RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \ - && yum install -y $PACKAGE_URL \ - && yum install -y libpwquality \ - && rm -rf /var/cache/yum/* -RUN mkdir /docker-entrypoint-initdb.d +RUN rpmkeys --import https://repo.mysql.com/RPM-GPG-KEY-mysql \ + && yum install -y $PACKAGE_URL $PACKAGE_URL_SHELL libpwquality \ + && yum clean all \ + && mkdir /docker-entrypoint-initdb.d VOLUME /var/lib/mysql COPY docker-entrypoint.sh /entrypoint.sh +COPY healthcheck.sh /healthcheck.sh ENTRYPOINT ["/entrypoint.sh"] - +HEALTHCHECK CMD /healthcheck.sh EXPOSE 3306 CMD ["mysqld"] diff --git a/5.5/docker-entrypoint.sh b/5.5/docker-entrypoint.sh index f236477e9..cc30febc6 100755 --- a/5.5/docker-entrypoint.sh +++ b/5.5/docker-entrypoint.sh @@ -1,29 +1,58 @@ #!/bin/bash +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -# if command starts with an option, prepend mysqld +echo "[Entrypoint] MySQL Docker Image 5.5.57-1.1.0" +# Fetch value from server config +# We use mysqld --verbose --help instead of my_print_defaults because the +# latter only show values present in config files, and not server defaults +_get_config() { + local conf="$1"; shift + "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' +} + +# If command starts with an option, prepend mysqld +# This allows users to add command-line options without +# needing to specify the "mysqld" command if [ "${1:0:1}" = '-' ]; then set -- mysqld "$@" fi if [ "$1" = 'mysqld' ]; then - # Test we're able to startup without errors. We redirect stdout to /dev/null so + # Test that the server can start. We redirect stdout to /dev/null so # only the error messages are left. result=0 output=$("$@" --verbose --help 2>&1 > /dev/null) || result=$? if [ ! "$result" = "0" ]; then - echo >&2 'error: could not run mysql. This could be caused by a misconfigured my.cnf' - echo >&2 "$output" + echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' + echo >&2 "[Entrypoint] $output" exit 1 fi # Get config - DATADIR="$("$@" --verbose --help 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')" + DATADIR="$(_get_config 'datadir' "$@")" + SOCKET="$(_get_config 'socket' "$@")" if [ ! -d "$DATADIR/mysql" ]; then if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - echo >&2 'error: database is uninitialized and password option is not specified ' - echo >&2 ' You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD' + echo >&2 '[Entrypoint] ERROR: No password option specified for new database.' + echo >&2 '[Entrypoint] You need to specify one of the following:' + echo >&2 '[Entrypoint] - MYSQL_RANDOM_ROOT_PASSWORD (recommended)' + echo >&2 '[Entrypoint] - MYSQL_ROOT_PASSWORD' + echo >&2 '[Entrypoint] - MYSQL_ALLOW_EMPTY_PASSWORD' exit 1 fi # If the password variable is a filename we use the contents of the file @@ -33,32 +62,38 @@ if [ "$1" = 'mysqld' ]; then mkdir -p "$DATADIR" chown -R mysql:mysql "$DATADIR" - echo 'Running mysql_install_db' + echo '[Entrypoint] Initializing database' mysql_install_db --user=mysql --datadir="$DATADIR" --rpm - echo 'Finished mysql_install_db' - - "$@" --skip-networking --socket=/var/run/mysqld/mysqld.sock & - pid="$!" - - mysql=( mysql --protocol=socket -uroot -hlocalhost --socket=/var/run/mysqld/mysqld.sock) - - for i in {30..0}; do - if echo 'SELECT 1' | "${mysql[@]}" &> /dev/null; then - break + echo '[Entrypoint] Database initialized' + + "$@" --skip-networking --socket="$SOCKET" & + + # To avoid using password on commandline, put it in a temporary file. + # The file is only populated when and if the root password is set. + PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + install /dev/null -m0600 -omysql -gmysql "$PASSFILE" + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET") + + if [ ! -z "yes" ]; + then + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break + fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 fi - echo 'MySQL init process in progress...' - sleep 1 - done - if [ "$i" = 0 ]; then - echo >&2 'MySQL init process failed.' - exit 1 fi - mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql - + mysql_tzinfo_to_sql /usr/share/zoneinfo | sed 's/Local time zone must be set--see zic manual page/FCTY/' | "${mysql[@]}" mysql + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then MYSQL_ROOT_PASSWORD="$(pwmake 128)" - echo "GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" fi if [ -z "$MYSQL_ROOT_HOST" ]; then ROOTCREATE="SET PASSWORD FOR 'root'@'localhost'=PASSWORD('${MYSQL_ROOT_PASSWORD}');" @@ -71,13 +106,18 @@ if [ "$1" = 'mysqld' ]; then -- What's done in this file shouldn't be replicated -- or products like mysql-fabric won't work SET @@SESSION.SQL_LOG_BIN=0; - DELETE FROM mysql.user WHERE user NOT IN ('mysql.sys', 'mysqlxsys', 'root') OR host NOT IN ('localhost'); + DELETE FROM mysql.user WHERE user NOT IN ('mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; ${ROOTCREATE} - DROP DATABASE IF EXISTS test ; FLUSH PRIVILEGES ; EOSQL if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then - mysql+=( -p"${MYSQL_ROOT_PASSWORD}" ) + # Put the password into the temporary config file + cat >"$PASSFILE" <&2 'MySQL init process failed.' - exit 1 + # When using a local socket, mysqladmin shutdown will only complete when the server is actually down + mysqladmin --defaults-extra-file="$PASSFILE" shutdown -uroot --socket="$SOCKET" + rm -f "$PASSFILE" + unset PASSFILE + echo "[Entrypoint] Server shut down" + + # This needs to be done outside the normal init, since mysqladmin shutdown will not work after + if [ ! -z "$MYSQL_ONETIME_PASSWORD" ]; then + if [ -z "" ]; then + echo "[Entrypoint] User expiration is only supported in MySQL 5.6+" + else + echo "[Entrypoint] Setting root user as expired. Password will need to be changed before database can be used." + SQL=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + install /dev/null -m0600 -omysql -gmysql "$SQL" + if [ ! -z "$MYSQL_ROOT_HOST" ]; then + cat << EOF > "$SQL" +ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL + fi fi echo - echo 'MySQL init process done. Ready for start up.' + echo '[Entrypoint] MySQL init process done. Ready for start up.' echo fi + # Used by healthcheck to make sure it doesn't mistakenly report container + # healthy during startup + # Put the password into the temporary config file + touch /healthcheck.cnf + cat >"/healthcheck.cnf" </dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' +} + +# If command starts with an option, prepend mysqld +# This allows users to add command-line options without +# needing to specify the "mysqld" command if [ "${1:0:1}" = '-' ]; then set -- mysqld "$@" fi if [ "$1" = 'mysqld' ]; then - # Test we're able to startup without errors. We redirect stdout to /dev/null so + # Test that the server can start. We redirect stdout to /dev/null so # only the error messages are left. result=0 output=$("$@" --verbose --help 2>&1 > /dev/null) || result=$? if [ ! "$result" = "0" ]; then - echo >&2 'error: could not run mysql. This could be caused by a misconfigured my.cnf' - echo >&2 "$output" + echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' + echo >&2 "[Entrypoint] $output" exit 1 fi # Get config - DATADIR="$("$@" --verbose --help 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')" + DATADIR="$(_get_config 'datadir' "$@")" + SOCKET="$(_get_config 'socket' "$@")" if [ ! -d "$DATADIR/mysql" ]; then if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - echo >&2 'error: database is uninitialized and password option is not specified ' - echo >&2 ' You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD' + echo >&2 '[Entrypoint] ERROR: No password option specified for new database.' + echo >&2 '[Entrypoint] You need to specify one of the following:' + echo >&2 '[Entrypoint] - MYSQL_RANDOM_ROOT_PASSWORD (recommended)' + echo >&2 '[Entrypoint] - MYSQL_ROOT_PASSWORD' + echo >&2 '[Entrypoint] - MYSQL_ALLOW_EMPTY_PASSWORD' exit 1 fi # If the password variable is a filename we use the contents of the file @@ -33,33 +62,38 @@ if [ "$1" = 'mysqld' ]; then mkdir -p "$DATADIR" chown -R mysql:mysql "$DATADIR" - echo 'Running mysql_install_db' + echo '[Entrypoint] Initializing database' mysql_install_db --user=mysql --datadir="$DATADIR" --rpm --keep-my-cnf - echo 'Finished mysql_install_db' - - "$@" --skip-networking --socket=/var/run/mysqld/mysqld.sock & - pid="$!" - - mysql=( mysql --protocol=socket -uroot -hlocalhost --socket=/var/run/mysqld/mysqld.sock) - - for i in {30..0}; do - if echo 'SELECT 1' | "${mysql[@]}" &> /dev/null; then - break + echo '[Entrypoint] Database initialized' + + "$@" --skip-networking --socket="$SOCKET" & + + # To avoid using password on commandline, put it in a temporary file. + # The file is only populated when and if the root password is set. + PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + install /dev/null -m0600 -omysql -gmysql "$PASSFILE" + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET") + + if [ ! -z "yes" ]; + then + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break + fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 fi - echo 'MySQL init process in progress...' - sleep 1 - done - if [ "$i" = 0 ]; then - echo >&2 'MySQL init process failed.' - exit 1 fi - # sed is for https://bugs.mysql.com/bug.php?id=20545 mysql_tzinfo_to_sql /usr/share/zoneinfo | sed 's/Local time zone must be set--see zic manual page/FCTY/' | "${mysql[@]}" mysql - + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then MYSQL_ROOT_PASSWORD="$(pwmake 128)" - echo "GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" fi if [ -z "$MYSQL_ROOT_HOST" ]; then ROOTCREATE="SET PASSWORD FOR 'root'@'localhost'=PASSWORD('${MYSQL_ROOT_PASSWORD}');" @@ -72,13 +106,18 @@ if [ "$1" = 'mysqld' ]; then -- What's done in this file shouldn't be replicated -- or products like mysql-fabric won't work SET @@SESSION.SQL_LOG_BIN=0; - DELETE FROM mysql.user WHERE user NOT IN ('mysql.sys', 'mysqlxsys', 'root') OR host NOT IN ('localhost'); + DELETE FROM mysql.user WHERE user NOT IN ('mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; ${ROOTCREATE} - DROP DATABASE IF EXISTS test ; FLUSH PRIVILEGES ; EOSQL if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then - mysql+=( -p"${MYSQL_ROOT_PASSWORD}" ) + # Put the password into the temporary config file + cat >"$PASSFILE" < "$SQL" +ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL fi fi - if ! kill -s TERM "$pid" || ! wait "$pid"; then - echo >&2 'MySQL init process failed.' - exit 1 - fi echo - echo 'MySQL init process done. Ready for start up.' + echo '[Entrypoint] MySQL init process done. Ready for start up.' echo fi + # Used by healthcheck to make sure it doesn't mistakenly report container + # healthy during startup + # Put the password into the temporary config file + touch /healthcheck.cnf + cat >"/healthcheck.cnf" </dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' +} + +# If command starts with an option, prepend mysqld +# This allows users to add command-line options without +# needing to specify the "mysqld" command if [ "${1:0:1}" = '-' ]; then set -- mysqld "$@" fi if [ "$1" = 'mysqld' ]; then - # Test we're able to startup without errors. We redirect stdout to /dev/null so + # Test that the server can start. We redirect stdout to /dev/null so # only the error messages are left. result=0 output=$("$@" --verbose --help 2>&1 > /dev/null) || result=$? if [ ! "$result" = "0" ]; then - echo >&2 'error: could not run mysql. This could be caused by a misconfigured my.cnf' - echo >&2 "$output" + echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' + echo >&2 "[Entrypoint] $output" exit 1 fi # Get config - DATADIR="$("$@" --verbose --help --log-bin-index=/tmp/tmp.index 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')" + DATADIR="$(_get_config 'datadir' "$@")" + SOCKET="$(_get_config 'socket' "$@")" if [ ! -d "$DATADIR/mysql" ]; then if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - echo >&2 'error: database is uninitialized and password option is not specified ' - echo >&2 ' You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD' + echo >&2 '[Entrypoint] ERROR: No password option specified for new database.' + echo >&2 '[Entrypoint] You need to specify one of the following:' + echo >&2 '[Entrypoint] - MYSQL_RANDOM_ROOT_PASSWORD (recommended)' + echo >&2 '[Entrypoint] - MYSQL_ROOT_PASSWORD' + echo >&2 '[Entrypoint] - MYSQL_ALLOW_EMPTY_PASSWORD' exit 1 fi # If the password variable is a filename we use the contents of the file @@ -33,32 +62,38 @@ if [ "$1" = 'mysqld' ]; then mkdir -p "$DATADIR" chown -R mysql:mysql "$DATADIR" - echo 'Initializing database' - "$@" --initialize-insecure=on - echo 'Database initialized' - - "$@" --skip-networking --socket=/var/run/mysqld/mysqld.sock & - pid="$!" - - mysql=( mysql --protocol=socket -uroot -hlocalhost --socket=/var/run/mysqld/mysqld.sock) - - for i in {30..0}; do - if echo 'SELECT 1' | "${mysql[@]}" &> /dev/null; then - break + echo '[Entrypoint] Initializing database' + "$@" --initialize-insecure + echo '[Entrypoint] Database initialized' + + "$@" --daemonize --skip-networking --socket="$SOCKET" + + # To avoid using password on commandline, put it in a temporary file. + # The file is only populated when and if the root password is set. + PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + install /dev/null -m0600 -omysql -gmysql "$PASSFILE" + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET") + + if [ ! -z "" ]; + then + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break + fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 fi - echo 'MySQL init process in progress...' - sleep 1 - done - if [ "$i" = 0 ]; then - echo >&2 'MySQL init process failed.' - exit 1 fi mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then MYSQL_ROOT_PASSWORD="$(pwmake 128)" - echo "GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" fi if [ -z "$MYSQL_ROOT_HOST" ]; then ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';" @@ -71,13 +106,18 @@ if [ "$1" = 'mysqld' ]; then -- What's done in this file shouldn't be replicated -- or products like mysql-fabric won't work SET @@SESSION.SQL_LOG_BIN=0; - DELETE FROM mysql.user WHERE user NOT IN ('mysql.sys', 'mysqlxsys', 'root') OR host NOT IN ('localhost'); + DELETE FROM mysql.user WHERE user NOT IN ('mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; ${ROOTCREATE} - DROP DATABASE IF EXISTS test ; FLUSH PRIVILEGES ; EOSQL if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then - mysql+=( -p"${MYSQL_ROOT_PASSWORD}" ) + # Put the password into the temporary config file + cat >"$PASSFILE" < "$SQL" +ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL fi fi - if ! kill -s TERM "$pid" || ! wait "$pid"; then - echo >&2 'MySQL init process failed.' - exit 1 - fi echo - echo 'MySQL init process done. Ready for start up.' + echo '[Entrypoint] MySQL init process done. Ready for start up.' echo fi + # Used by healthcheck to make sure it doesn't mistakenly report container + # healthy during startup + # Put the password into the temporary config file + touch /healthcheck.cnf + cat >"/healthcheck.cnf" </dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' +} + +# If command starts with an option, prepend mysqld +# This allows users to add command-line options without +# needing to specify the "mysqld" command if [ "${1:0:1}" = '-' ]; then set -- mysqld "$@" fi if [ "$1" = 'mysqld' ]; then - # Test we're able to startup without errors. We redirect stdout to /dev/null so + # Test that the server can start. We redirect stdout to /dev/null so # only the error messages are left. result=0 output=$("$@" --verbose --help 2>&1 > /dev/null) || result=$? if [ ! "$result" = "0" ]; then - echo >&2 'error: could not run mysql. This could be caused by a misconfigured my.cnf' - echo >&2 "$output" + echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' + echo >&2 "[Entrypoint] $output" exit 1 fi # Get config - DATADIR="$("$@" --verbose --help --log-bin-index=/tmp/tmp.index 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')" + DATADIR="$(_get_config 'datadir' "$@")" + SOCKET="$(_get_config 'socket' "$@")" if [ ! -d "$DATADIR/mysql" ]; then if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - echo >&2 'error: database is uninitialized and password option is not specified ' - echo >&2 ' You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD' + echo >&2 '[Entrypoint] ERROR: No password option specified for new database.' + echo >&2 '[Entrypoint] You need to specify one of the following:' + echo >&2 '[Entrypoint] - MYSQL_RANDOM_ROOT_PASSWORD (recommended)' + echo >&2 '[Entrypoint] - MYSQL_ROOT_PASSWORD' + echo >&2 '[Entrypoint] - MYSQL_ALLOW_EMPTY_PASSWORD' exit 1 fi # If the password variable is a filename we use the contents of the file @@ -33,32 +62,38 @@ if [ "$1" = 'mysqld' ]; then mkdir -p "$DATADIR" chown -R mysql:mysql "$DATADIR" - echo 'Initializing database' - "$@" --initialize-insecure=on - echo 'Database initialized' - - "$@" --skip-networking --socket=/var/run/mysqld/mysqld.sock & - pid="$!" - - mysql=( mysql --protocol=socket -uroot -hlocalhost --socket=/var/run/mysqld/mysqld.sock) - - for i in {30..0}; do - if echo 'SELECT 1' | "${mysql[@]}" &> /dev/null; then - break + echo '[Entrypoint] Initializing database' + "$@" --initialize-insecure + echo '[Entrypoint] Database initialized' + + "$@" --daemonize --skip-networking --socket="$SOCKET" + + # To avoid using password on commandline, put it in a temporary file. + # The file is only populated when and if the root password is set. + PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + install /dev/null -m0600 -omysql -gmysql "$PASSFILE" + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET") + + if [ ! -z "" ]; + then + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break + fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 fi - echo 'MySQL init process in progress...' - sleep 1 - done - if [ "$i" = 0 ]; then - echo >&2 'MySQL init process failed.' - exit 1 fi mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then MYSQL_ROOT_PASSWORD="$(pwmake 128)" - echo "GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" fi if [ -z "$MYSQL_ROOT_HOST" ]; then ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';" @@ -71,13 +106,18 @@ if [ "$1" = 'mysqld' ]; then -- What's done in this file shouldn't be replicated -- or products like mysql-fabric won't work SET @@SESSION.SQL_LOG_BIN=0; - DELETE FROM mysql.user WHERE user NOT IN ('mysql.sys', 'mysqlxsys', 'root') OR host NOT IN ('localhost'); + DELETE FROM mysql.user WHERE user NOT IN ('mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; ${ROOTCREATE} - DROP DATABASE IF EXISTS test ; FLUSH PRIVILEGES ; EOSQL if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then - mysql+=( -p"${MYSQL_ROOT_PASSWORD}" ) + # Put the password into the temporary config file + cat >"$PASSFILE" < "$SQL" +ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL fi fi - if ! kill -s TERM "$pid" || ! wait "$pid"; then - echo >&2 'MySQL init process failed.' - exit 1 - fi echo - echo 'MySQL init process done. Ready for start up.' + echo '[Entrypoint] MySQL init process done. Ready for start up.' echo fi + # Used by healthcheck to make sure it doesn't mistakenly report container + # healthy during startup + # Put the password into the temporary config file + touch /healthcheck.cnf + cat >"/healthcheck.cnf" < Date: Tue, 11 Jul 2017 08:45:19 +0200 Subject: [PATCH 107/386] Updated changelog to 1.1.0 --- changelog | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/changelog b/changelog index 5be58cb00..bace580fd 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,28 @@ -# 1.0.1 (unreleased) - * New release -# 1.0.0 (2017-06-07) - * First changelog entry +Changes in 1.1.0 (2017-07-24) + * Fixed broken MYSQL_ONETIME_PASSWORD support (#86523) + The functionality wasn't correctly updated when the entrypoint script was + changed to only create the root@localhost user by default + * Changed control files to be generated from a common template + The control files for each version will be generated by swapping out the few + commands that differ between server versions + * Made PACKAGE_URL an ARG entry, to allow build-time changing + The URL variables can be changed by supplying new ones with --build-arg at + build time + * Added basic healthcheck script + Once database init is complete a flag file will be touched. If this file + exists and mysqladmin ping succeeds, the container is reported as healthy, + meaning it is ready for use + * Database init will now use configured socket setting instead of hardcoded + Using a hardcoded socket could cause init scripts to fail in confusing ways + if the user customized the socket setting + * Added MySQL Shell to supported images + For 5.7 and 8.0, MySQL Shell is installed together with the server. + https://dev.mysql.com/doc/refman/5.7/en/mysql-shell.html + +Known issues: + * For existing databases created with older images/not with Docker, the + healthcheck script will generate an "Access denied for healthchecker@localhost" + message in the server log every time it runs. If connection throttling is + enabled this could eventually cause the healthcheck to fail + * 5.7: Shell 1.0.9 is unable to set up innodb-cluster with the default + root@localhost user (#86267) From 572e0b6edb359865e9d0bc41e8e6b25d5dcc9521 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Mon, 14 Aug 2017 09:30:42 +0200 Subject: [PATCH 108/386] Bug #87305 RUNING DOCKER IMAGE WILL EXECUTE GTIDS THAT WILL FAIL TO START GROUP REPLICATION The output of mysql_tzinfo_to_sql did not disable binlogging, causing the gtid execution. Also affects various optional commands that can be executed, so changed to disable for all client operations in the entrypoint script. --- 5.5/docker-entrypoint.sh | 11 +++++------ 5.6/docker-entrypoint.sh | 11 +++++------ 5.7/docker-entrypoint.sh | 11 +++++------ 8.0/docker-entrypoint.sh | 11 +++++------ changelog | 4 ++++ genOracleLinux.sh | 10 ++++++---- template/docker-entrypoint.sh | 7 +++---- 7 files changed, 33 insertions(+), 32 deletions(-) diff --git a/5.5/docker-entrypoint.sh b/5.5/docker-entrypoint.sh index cc30febc6..7973f145d 100755 --- a/5.5/docker-entrypoint.sh +++ b/5.5/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.5.57-1.1.0" +echo "[Entrypoint] MySQL Docker Image 5.5.57-1.1.1" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -72,7 +72,9 @@ if [ "$1" = 'mysqld' ]; then # The file is only populated when and if the root password is set. PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) install /dev/null -m0600 -omysql -gmysql "$PASSFILE" - mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET") + # Define the client command used throughout the script + # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") if [ ! -z "yes" ]; then @@ -103,9 +105,6 @@ if [ "$1" = 'mysqld' ]; then GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" fi "${mysql[@]}" <<-EOSQL - -- What's done in this file shouldn't be replicated - -- or products like mysql-fabric won't work - SET @@SESSION.SQL_LOG_BIN=0; DELETE FROM mysql.user WHERE user NOT IN ('mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; ${ROOTCREATE} @@ -190,7 +189,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.5.57-1.1.0" + echo "[Entrypoint] Starting MySQL 5.5.57-1.1.1" fi exec "$@" diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index 067aa17f0..9934403d2 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.6.37-1.1.0" +echo "[Entrypoint] MySQL Docker Image 5.6.37-1.1.1" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -72,7 +72,9 @@ if [ "$1" = 'mysqld' ]; then # The file is only populated when and if the root password is set. PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) install /dev/null -m0600 -omysql -gmysql "$PASSFILE" - mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET") + # Define the client command used throughout the script + # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") if [ ! -z "yes" ]; then @@ -103,9 +105,6 @@ if [ "$1" = 'mysqld' ]; then GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" fi "${mysql[@]}" <<-EOSQL - -- What's done in this file shouldn't be replicated - -- or products like mysql-fabric won't work - SET @@SESSION.SQL_LOG_BIN=0; DELETE FROM mysql.user WHERE user NOT IN ('mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; ${ROOTCREATE} @@ -190,7 +189,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.6.37-1.1.0" + echo "[Entrypoint] Starting MySQL 5.6.37-1.1.1" fi exec "$@" diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 9fa91eb16..eb1e90dd5 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.19-1.1.0" +echo "[Entrypoint] MySQL Docker Image 5.7.19-1.1.1" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -72,7 +72,9 @@ if [ "$1" = 'mysqld' ]; then # The file is only populated when and if the root password is set. PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) install /dev/null -m0600 -omysql -gmysql "$PASSFILE" - mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET") + # Define the client command used throughout the script + # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") if [ ! -z "" ]; then @@ -103,9 +105,6 @@ if [ "$1" = 'mysqld' ]; then GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" fi "${mysql[@]}" <<-EOSQL - -- What's done in this file shouldn't be replicated - -- or products like mysql-fabric won't work - SET @@SESSION.SQL_LOG_BIN=0; DELETE FROM mysql.user WHERE user NOT IN ('mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; ${ROOTCREATE} @@ -190,7 +189,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.7.19-1.1.0" + echo "[Entrypoint] Starting MySQL 5.7.19-1.1.1" fi exec "$@" diff --git a/8.0/docker-entrypoint.sh b/8.0/docker-entrypoint.sh index 2760dee16..123ec0673 100755 --- a/8.0/docker-entrypoint.sh +++ b/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.2-dmr-1.1.0" +echo "[Entrypoint] MySQL Docker Image 8.0.2-dmr-1.1.1" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -72,7 +72,9 @@ if [ "$1" = 'mysqld' ]; then # The file is only populated when and if the root password is set. PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) install /dev/null -m0600 -omysql -gmysql "$PASSFILE" - mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET") + # Define the client command used throughout the script + # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") if [ ! -z "" ]; then @@ -103,9 +105,6 @@ if [ "$1" = 'mysqld' ]; then GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" fi "${mysql[@]}" <<-EOSQL - -- What's done in this file shouldn't be replicated - -- or products like mysql-fabric won't work - SET @@SESSION.SQL_LOG_BIN=0; DELETE FROM mysql.user WHERE user NOT IN ('mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; ${ROOTCREATE} @@ -190,7 +189,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 8.0.2-dmr-1.1.0" + echo "[Entrypoint] Starting MySQL 8.0.2-dmr-1.1.1" fi exec "$@" diff --git a/changelog b/changelog index bace580fd..fe9edc277 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,7 @@ +Changes in 1.1.1 (not released) + * Disable binlog for all entrypoint client commands (#87305) + This was previously only done only for the script to set the root password, + but should be done for all client commands, or group replication will fail Changes in 1.1.0 (2017-07-24) * Fixed broken MYSQL_ONETIME_PASSWORD support (#86523) The functionality wasn't correctly updated when the entrypoint script was diff --git a/genOracleLinux.sh b/genOracleLinux.sh index 44103104d..d835a06bb 100755 --- a/genOracleLinux.sh +++ b/genOracleLinux.sh @@ -19,11 +19,13 @@ # Example: mysql_install_db for 5.5 and 5.6, and mysqld --initialize for newer VERSIONS="5.5 5.6 5.7 8.0" +VERSION_DOCKERFILES=1.1.1 + declare -A SERVER_VERSION_FULL -SERVER_VERSION_FULL["5.5"]="5.5.57-1.1.0" -SERVER_VERSION_FULL["5.6"]="5.6.37-1.1.0" -SERVER_VERSION_FULL["5.7"]="5.7.19-1.1.0" -SERVER_VERSION_FULL["8.0"]="8.0.2-dmr-1.1.0" +SERVER_VERSION_FULL["5.5"]="5.5.57-${VERSION_DOCKERFILES}" +SERVER_VERSION_FULL["5.6"]="5.6.37-${VERSION_DOCKERFILES}" +SERVER_VERSION_FULL["5.7"]="5.7.19-${VERSION_DOCKERFILES}" +SERVER_VERSION_FULL["8.0"]="8.0.2-dmr-${VERSION_DOCKERFILES}" declare -A PACKAGE_URL PACKAGE_URL["5.5"]="https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.57-2.el7.x86_64.rpm" diff --git a/template/docker-entrypoint.sh b/template/docker-entrypoint.sh index ed0280e64..03c6a711f 100644 --- a/template/docker-entrypoint.sh +++ b/template/docker-entrypoint.sh @@ -72,7 +72,9 @@ if [ "$1" = 'mysqld' ]; then # The file is only populated when and if the root password is set. PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) install /dev/null -m0600 -omysql -gmysql "$PASSFILE" - mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET") + # Define the client command used throughout the script + # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") if [ ! -z %%STARTUP_WAIT%% ]; then @@ -103,9 +105,6 @@ if [ "$1" = 'mysqld' ]; then GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" fi "${mysql[@]}" <<-EOSQL - -- What's done in this file shouldn't be replicated - -- or products like mysql-fabric won't work - SET @@SESSION.SQL_LOG_BIN=0; DELETE FROM mysql.user WHERE user NOT IN ('mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; ${ROOTCREATE} From 5b9e3148cb13dae58a530491260d177a44f100fc Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Wed, 23 Aug 2017 10:47:11 +0200 Subject: [PATCH 109/386] Bug#26643372 DOCKER IMAGE LOGS TO A FILE INSIDE THE CONTAINER WHICH IS DIFFICULT TO REACH Add an environment variable MYSQL_LOG_STDOUT which, when set (any non-empty value), makes the entrypoint script comment out the log-error line from the default config file. This will make the command "docker logs container" output the MySQL server log The flag has no effect on 8.0, where this is the default behavior --- changelog | 4 ++++ genOracleLinux.sh | 8 ++++++++ template/docker-entrypoint.sh | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/changelog b/changelog index fe9edc277..817d1666d 100644 --- a/changelog +++ b/changelog @@ -2,6 +2,10 @@ Changes in 1.1.1 (not released) * Disable binlog for all entrypoint client commands (#87305) This was previously only done only for the script to set the root password, but should be done for all client commands, or group replication will fail + * Add flag for logging to stdout (#87458) + Setting -e MYSQL_LOG_STDOUT=true will make the server log to stdout, so the + server log is available through Docker's log interface. + Changes in 1.1.0 (2017-07-24) * Fixed broken MYSQL_ONETIME_PASSWORD support (#86523) The functionality wasn't correctly updated when the entrypoint script was diff --git a/genOracleLinux.sh b/genOracleLinux.sh index d835a06bb..0c297a928 100755 --- a/genOracleLinux.sh +++ b/genOracleLinux.sh @@ -87,6 +87,13 @@ TZINFO_WORKAROUND["5.6"]="sed 's/Local time zone must be set--see zic manual pag TZINFO_WORKAROUND["5.7"]="" TZINFO_WORKAROUND["8.0"]="" +# Logging to stdout makes server log available with the «docker logs command» +declare -A DEFAULT_LOG +DEFAULT_LOG["5.5"]="" +DEFAULT_LOG["5.6"]="" +DEFAULT_LOG["5.7"]="" +DEFAULT_LOG["8.0"]="stdout" + for VERSION in ${VERSIONS} do # Dockerfile @@ -103,6 +110,7 @@ do sed -i 's#%%INIT_STARTUP%%#'"${INIT_STARTUP[${VERSION}]}"'#g' tmpfile sed -i 's#%%STARTUP_WAIT%%#'"${STARTUP_WAIT[${VERSION}]}"'#g' tmpfile sed -i 's#%%SERVER_VERSION_FULL%%#'"${SERVER_VERSION_FULL[${VERSION}]}"'#g' tmpfile + sed -i 's#%%DEFAULT_LOG%%#'"${DEFAULT_LOG[${VERSION}]}"'#g' tmpfile mv tmpfile ${VERSION}/docker-entrypoint.sh chmod +x ${VERSION}/docker-entrypoint.sh diff --git a/template/docker-entrypoint.sh b/template/docker-entrypoint.sh index 03c6a711f..2f291e27e 100644 --- a/template/docker-entrypoint.sh +++ b/template/docker-entrypoint.sh @@ -46,6 +46,10 @@ if [ "$1" = 'mysqld' ]; then DATADIR="$(_get_config 'datadir' "$@")" SOCKET="$(_get_config 'socket' "$@")" + if [ -n "$MYSQL_LOG_STDOUT" ] || [ -n "%%DEFAULT_LOG%%" ]; then + sed -i 's/^log-error=/#&/' /etc/my.cnf + fi + if [ ! -d "$DATADIR/mysql" ]; then if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then echo >&2 '[Entrypoint] ERROR: No password option specified for new database.' From 8120cd3aa6a1f1d5d798d5ceb76c59f9434ec533 Mon Sep 17 00:00:00 2001 From: Robert Neumayer Date: Mon, 28 Aug 2017 15:48:38 +0200 Subject: [PATCH 110/386] Bug #26405605 DOCKER IMAGES SILENTLY IGNORE INCOMPLETE OPTIONS FOR EXTRA USER CREATION Ensure both MYSQL_USER and MYSQL_PASSWORD are set. --- changelog | 1 + template/docker-entrypoint.sh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/changelog b/changelog index 817d1666d..bf6d5e86c 100644 --- a/changelog +++ b/changelog @@ -5,6 +5,7 @@ Changes in 1.1.1 (not released) * Add flag for logging to stdout (#87458) Setting -e MYSQL_LOG_STDOUT=true will make the server log to stdout, so the server log is available through Docker's log interface. + * Ensure both MYSQL_USER and MYSQL_PASSWORD are set (#86982) Changes in 1.1.0 (2017-07-24) * Fixed broken MYSQL_ONETIME_PASSWORD support (#86523) diff --git a/template/docker-entrypoint.sh b/template/docker-entrypoint.sh index 2f291e27e..4990cf1d9 100644 --- a/template/docker-entrypoint.sh +++ b/template/docker-entrypoint.sh @@ -136,6 +136,8 @@ EOF fi echo 'FLUSH PRIVILEGES ;' | "${mysql[@]}" + elif [ "$MYSQL_USER" -a ! "$MYSQL_PASSWORD" -o ! "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then + echo '[Entrypoint] Not creating mysql user. MYSQL_USER and MYSQL_PASSWORD must be specified to create a mysql user.' fi echo for f in /docker-entrypoint-initdb.d/*; do From ce2a7f2a1a4db92128419f36048bacb1dc3c9682 Mon Sep 17 00:00:00 2001 From: Robert Neumayer Date: Mon, 28 Aug 2017 12:03:14 +0200 Subject: [PATCH 111/386] Bug #26428488 MYSQL_ROOT_PASSWORD BEHAVES DIFFERENTLY WITH EMPTY VALUE WITH/WITHOUT FROM FILE Read password file first and throw error if it is empty. --- changelog | 4 ++++ template/docker-entrypoint.sh | 13 +++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/changelog b/changelog index bf6d5e86c..79505a357 100644 --- a/changelog +++ b/changelog @@ -6,6 +6,10 @@ Changes in 1.1.1 (not released) Setting -e MYSQL_LOG_STDOUT=true will make the server log to stdout, so the server log is available through Docker's log interface. * Ensure both MYSQL_USER and MYSQL_PASSWORD are set (#86982) + Before, setting only one would cause the option to be silently ignored. + * Read password file first and throw error if it is empty (#87025) + Setting MYSQL_ROOT_PASSWORD to an empty string would be rejected, but + setting it to a file with no content would be accepted. Both are now rejected. Changes in 1.1.0 (2017-07-24) * Fixed broken MYSQL_ONETIME_PASSWORD support (#86523) diff --git a/template/docker-entrypoint.sh b/template/docker-entrypoint.sh index 4990cf1d9..b8348da9f 100644 --- a/template/docker-entrypoint.sh +++ b/template/docker-entrypoint.sh @@ -51,6 +51,15 @@ if [ "$1" = 'mysqld' ]; then fi if [ ! -d "$DATADIR/mysql" ]; then + # If the password variable is a filename we use the contents of the file. We + # read this first to make sure that a proper error is generated for empty files. + if [ -f "$MYSQL_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + if [ -z "$MYSQL_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' + exit 1 + fi + fi if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then echo >&2 '[Entrypoint] ERROR: No password option specified for new database.' echo >&2 '[Entrypoint] You need to specify one of the following:' @@ -59,10 +68,6 @@ if [ "$1" = 'mysqld' ]; then echo >&2 '[Entrypoint] - MYSQL_ALLOW_EMPTY_PASSWORD' exit 1 fi - # If the password variable is a filename we use the contents of the file - if [ -f "$MYSQL_ROOT_PASSWORD" ]; then - MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" - fi mkdir -p "$DATADIR" chown -R mysql:mysql "$DATADIR" From 18eedc767ad77d644cd905a23dbc59d4839529b0 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 29 Aug 2017 13:46:37 +0200 Subject: [PATCH 112/386] Enable MYSQL_RANDOM_ROOT_PASSWORD and MYSQL_ONETIME_PASSWORD by default This is the recommended way to initialize a new database with the Docker image, so it should be the default behavior. Note that MYSQL_ONETIME_PASSWORD has no effect on 5.5 --- changelog | 2 ++ template/docker-entrypoint.sh | 10 ++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/changelog b/changelog index 79505a357..98ee68b6b 100644 --- a/changelog +++ b/changelog @@ -10,6 +10,8 @@ Changes in 1.1.1 (not released) * Read password file first and throw error if it is empty (#87025) Setting MYSQL_ROOT_PASSWORD to an empty string would be rejected, but setting it to a file with no content would be accepted. Both are now rejected. + * MYSQL_RANDOM_ROOT_PASSWORD and MYSQL_ONETIME_PASSWORD are now set by default. + A password option no longer needs to be set explicitly. Changes in 1.1.0 (2017-07-24) * Fixed broken MYSQL_ONETIME_PASSWORD support (#86523) diff --git a/template/docker-entrypoint.sh b/template/docker-entrypoint.sh index b8348da9f..dd3c054d2 100644 --- a/template/docker-entrypoint.sh +++ b/template/docker-entrypoint.sh @@ -61,12 +61,10 @@ if [ "$1" = 'mysqld' ]; then fi fi if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - echo >&2 '[Entrypoint] ERROR: No password option specified for new database.' - echo >&2 '[Entrypoint] You need to specify one of the following:' - echo >&2 '[Entrypoint] - MYSQL_RANDOM_ROOT_PASSWORD (recommended)' - echo >&2 '[Entrypoint] - MYSQL_ROOT_PASSWORD' - echo >&2 '[Entrypoint] - MYSQL_ALLOW_EMPTY_PASSWORD' - exit 1 + echo >&2 '[Entrypoint] No password option specified for new database.' + echo >&2 '[Entrypoint] A random onetime password will be generated.' + MYSQL_RANDOM_ROOT_PASSWORD=true + MYSQL_ONETIME_PASSWORD=true fi mkdir -p "$DATADIR" chown -R mysql:mysql "$DATADIR" From b2691cba4e03d60aec2a7364c41bcd6ad9f00fad Mon Sep 17 00:00:00 2001 From: Robert Neumayer Date: Tue, 29 Aug 2017 12:14:11 +0200 Subject: [PATCH 113/386] Bug #26392293 MYSQL_ROOT_HOST USER MISSING PROXY PRIVILEGED WITH DOCKER IMAGES Make root@$MYSQL_ROOT_HOST identical to root@localhost. If the MYSQL_ROOT_HOST variable is set we add an additional root user for the given host. This user was missing the PROXY privilege. We add the missing privilege so the users are identical. --- changelog | 9 +++++++-- template/docker-entrypoint.sh | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/changelog b/changelog index 98ee68b6b..3e2ca76d3 100644 --- a/changelog +++ b/changelog @@ -10,8 +10,13 @@ Changes in 1.1.1 (not released) * Read password file first and throw error if it is empty (#87025) Setting MYSQL_ROOT_PASSWORD to an empty string would be rejected, but setting it to a file with no content would be accepted. Both are now rejected. - * MYSQL_RANDOM_ROOT_PASSWORD and MYSQL_ONETIME_PASSWORD are now set by default. - A password option no longer needs to be set explicitly. + * MYSQL_RANDOM_ROOT_PASSWORD and MYSQL_ONETIME_PASSWORD are now set by default. (#87515) + A password option no longer needs to be set explicitly. If none are set, a + random, expired password is set. + * Make root@$MYSQL_ROOT_HOST identical to root@localhost (#86945) + If the MYSQL_ROOT_HOST variable is set we add an additional root user for + the given host. This user was missing the PROXY privilege. We add the + missing privilege so the users are identical. Changes in 1.1.0 (2017-07-24) * Fixed broken MYSQL_ONETIME_PASSWORD support (#86523) diff --git a/template/docker-entrypoint.sh b/template/docker-entrypoint.sh index dd3c054d2..5e4d19dde 100644 --- a/template/docker-entrypoint.sh +++ b/template/docker-entrypoint.sh @@ -109,7 +109,8 @@ if [ "$1" = 'mysqld' ]; then else ROOTCREATE="%%PASSWORDSET%% \ CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ - GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ + GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" fi "${mysql[@]}" <<-EOSQL DELETE FROM mysql.user WHERE user NOT IN ('mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); From dbea1d360200eb74959a4e48a11e2280729d2e9a Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Wed, 30 Aug 2017 08:06:19 +0200 Subject: [PATCH 114/386] Generated new files for 1.1.1 release --- 5.5/docker-entrypoint.sh | 34 ++++++++++++++++++++++------------ 5.6/docker-entrypoint.sh | 34 ++++++++++++++++++++++------------ 5.7/docker-entrypoint.sh | 34 ++++++++++++++++++++++------------ 8.0/docker-entrypoint.sh | 34 ++++++++++++++++++++++------------ genOracleLinux.sh | 8 ++++---- 5 files changed, 92 insertions(+), 52 deletions(-) diff --git a/5.5/docker-entrypoint.sh b/5.5/docker-entrypoint.sh index 7973f145d..024f59651 100755 --- a/5.5/docker-entrypoint.sh +++ b/5.5/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.5.57-1.1.1" +echo "[Entrypoint] MySQL Docker Image 5.5.58-1.1.1" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -46,18 +46,25 @@ if [ "$1" = 'mysqld' ]; then DATADIR="$(_get_config 'datadir' "$@")" SOCKET="$(_get_config 'socket' "$@")" + if [ -n "$MYSQL_LOG_STDOUT" ] || [ -n "" ]; then + sed -i 's/^log-error=/#&/' /etc/my.cnf + fi + if [ ! -d "$DATADIR/mysql" ]; then - if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - echo >&2 '[Entrypoint] ERROR: No password option specified for new database.' - echo >&2 '[Entrypoint] You need to specify one of the following:' - echo >&2 '[Entrypoint] - MYSQL_RANDOM_ROOT_PASSWORD (recommended)' - echo >&2 '[Entrypoint] - MYSQL_ROOT_PASSWORD' - echo >&2 '[Entrypoint] - MYSQL_ALLOW_EMPTY_PASSWORD' - exit 1 - fi - # If the password variable is a filename we use the contents of the file + # If the password variable is a filename we use the contents of the file. We + # read this first to make sure that a proper error is generated for empty files. if [ -f "$MYSQL_ROOT_PASSWORD" ]; then MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + if [ -z "$MYSQL_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' + exit 1 + fi + fi + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] No password option specified for new database.' + echo >&2 '[Entrypoint] A random onetime password will be generated.' + MYSQL_RANDOM_ROOT_PASSWORD=true + MYSQL_ONETIME_PASSWORD=true fi mkdir -p "$DATADIR" chown -R mysql:mysql "$DATADIR" @@ -102,7 +109,8 @@ if [ "$1" = 'mysqld' ]; then else ROOTCREATE="SET PASSWORD FOR 'root'@'localhost'=PASSWORD('${MYSQL_ROOT_PASSWORD}'); \ CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ - GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ + GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" fi "${mysql[@]}" <<-EOSQL DELETE FROM mysql.user WHERE user NOT IN ('mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); @@ -132,6 +140,8 @@ EOF fi echo 'FLUSH PRIVILEGES ;' | "${mysql[@]}" + elif [ "$MYSQL_USER" -a ! "$MYSQL_PASSWORD" -o ! "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then + echo '[Entrypoint] Not creating mysql user. MYSQL_USER and MYSQL_PASSWORD must be specified to create a mysql user.' fi echo for f in /docker-entrypoint-initdb.d/*; do @@ -189,7 +199,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.5.57-1.1.1" + echo "[Entrypoint] Starting MySQL 5.5.58-1.1.1" fi exec "$@" diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index 9934403d2..08f1216dd 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.6.37-1.1.1" +echo "[Entrypoint] MySQL Docker Image 5.6.38-1.1.1" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -46,18 +46,25 @@ if [ "$1" = 'mysqld' ]; then DATADIR="$(_get_config 'datadir' "$@")" SOCKET="$(_get_config 'socket' "$@")" + if [ -n "$MYSQL_LOG_STDOUT" ] || [ -n "" ]; then + sed -i 's/^log-error=/#&/' /etc/my.cnf + fi + if [ ! -d "$DATADIR/mysql" ]; then - if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - echo >&2 '[Entrypoint] ERROR: No password option specified for new database.' - echo >&2 '[Entrypoint] You need to specify one of the following:' - echo >&2 '[Entrypoint] - MYSQL_RANDOM_ROOT_PASSWORD (recommended)' - echo >&2 '[Entrypoint] - MYSQL_ROOT_PASSWORD' - echo >&2 '[Entrypoint] - MYSQL_ALLOW_EMPTY_PASSWORD' - exit 1 - fi - # If the password variable is a filename we use the contents of the file + # If the password variable is a filename we use the contents of the file. We + # read this first to make sure that a proper error is generated for empty files. if [ -f "$MYSQL_ROOT_PASSWORD" ]; then MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + if [ -z "$MYSQL_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' + exit 1 + fi + fi + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] No password option specified for new database.' + echo >&2 '[Entrypoint] A random onetime password will be generated.' + MYSQL_RANDOM_ROOT_PASSWORD=true + MYSQL_ONETIME_PASSWORD=true fi mkdir -p "$DATADIR" chown -R mysql:mysql "$DATADIR" @@ -102,7 +109,8 @@ if [ "$1" = 'mysqld' ]; then else ROOTCREATE="SET PASSWORD FOR 'root'@'localhost'=PASSWORD('${MYSQL_ROOT_PASSWORD}'); \ CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ - GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ + GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" fi "${mysql[@]}" <<-EOSQL DELETE FROM mysql.user WHERE user NOT IN ('mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); @@ -132,6 +140,8 @@ EOF fi echo 'FLUSH PRIVILEGES ;' | "${mysql[@]}" + elif [ "$MYSQL_USER" -a ! "$MYSQL_PASSWORD" -o ! "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then + echo '[Entrypoint] Not creating mysql user. MYSQL_USER and MYSQL_PASSWORD must be specified to create a mysql user.' fi echo for f in /docker-entrypoint-initdb.d/*; do @@ -189,7 +199,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.6.37-1.1.1" + echo "[Entrypoint] Starting MySQL 5.6.38-1.1.1" fi exec "$@" diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index eb1e90dd5..1fef6abd4 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.19-1.1.1" +echo "[Entrypoint] MySQL Docker Image 5.7.20-1.1.1" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -46,18 +46,25 @@ if [ "$1" = 'mysqld' ]; then DATADIR="$(_get_config 'datadir' "$@")" SOCKET="$(_get_config 'socket' "$@")" + if [ -n "$MYSQL_LOG_STDOUT" ] || [ -n "" ]; then + sed -i 's/^log-error=/#&/' /etc/my.cnf + fi + if [ ! -d "$DATADIR/mysql" ]; then - if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - echo >&2 '[Entrypoint] ERROR: No password option specified for new database.' - echo >&2 '[Entrypoint] You need to specify one of the following:' - echo >&2 '[Entrypoint] - MYSQL_RANDOM_ROOT_PASSWORD (recommended)' - echo >&2 '[Entrypoint] - MYSQL_ROOT_PASSWORD' - echo >&2 '[Entrypoint] - MYSQL_ALLOW_EMPTY_PASSWORD' - exit 1 - fi - # If the password variable is a filename we use the contents of the file + # If the password variable is a filename we use the contents of the file. We + # read this first to make sure that a proper error is generated for empty files. if [ -f "$MYSQL_ROOT_PASSWORD" ]; then MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + if [ -z "$MYSQL_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' + exit 1 + fi + fi + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] No password option specified for new database.' + echo >&2 '[Entrypoint] A random onetime password will be generated.' + MYSQL_RANDOM_ROOT_PASSWORD=true + MYSQL_ONETIME_PASSWORD=true fi mkdir -p "$DATADIR" chown -R mysql:mysql "$DATADIR" @@ -102,7 +109,8 @@ if [ "$1" = 'mysqld' ]; then else ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ - GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ + GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" fi "${mysql[@]}" <<-EOSQL DELETE FROM mysql.user WHERE user NOT IN ('mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); @@ -132,6 +140,8 @@ EOF fi echo 'FLUSH PRIVILEGES ;' | "${mysql[@]}" + elif [ "$MYSQL_USER" -a ! "$MYSQL_PASSWORD" -o ! "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then + echo '[Entrypoint] Not creating mysql user. MYSQL_USER and MYSQL_PASSWORD must be specified to create a mysql user.' fi echo for f in /docker-entrypoint-initdb.d/*; do @@ -189,7 +199,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.7.19-1.1.1" + echo "[Entrypoint] Starting MySQL 5.7.20-1.1.1" fi exec "$@" diff --git a/8.0/docker-entrypoint.sh b/8.0/docker-entrypoint.sh index 123ec0673..d52dde64c 100755 --- a/8.0/docker-entrypoint.sh +++ b/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.2-dmr-1.1.1" +echo "[Entrypoint] MySQL Docker Image 8.0.3-dmr-1.1.1" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -46,18 +46,25 @@ if [ "$1" = 'mysqld' ]; then DATADIR="$(_get_config 'datadir' "$@")" SOCKET="$(_get_config 'socket' "$@")" + if [ -n "$MYSQL_LOG_STDOUT" ] || [ -n "stdout" ]; then + sed -i 's/^log-error=/#&/' /etc/my.cnf + fi + if [ ! -d "$DATADIR/mysql" ]; then - if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - echo >&2 '[Entrypoint] ERROR: No password option specified for new database.' - echo >&2 '[Entrypoint] You need to specify one of the following:' - echo >&2 '[Entrypoint] - MYSQL_RANDOM_ROOT_PASSWORD (recommended)' - echo >&2 '[Entrypoint] - MYSQL_ROOT_PASSWORD' - echo >&2 '[Entrypoint] - MYSQL_ALLOW_EMPTY_PASSWORD' - exit 1 - fi - # If the password variable is a filename we use the contents of the file + # If the password variable is a filename we use the contents of the file. We + # read this first to make sure that a proper error is generated for empty files. if [ -f "$MYSQL_ROOT_PASSWORD" ]; then MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + if [ -z "$MYSQL_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' + exit 1 + fi + fi + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] No password option specified for new database.' + echo >&2 '[Entrypoint] A random onetime password will be generated.' + MYSQL_RANDOM_ROOT_PASSWORD=true + MYSQL_ONETIME_PASSWORD=true fi mkdir -p "$DATADIR" chown -R mysql:mysql "$DATADIR" @@ -102,7 +109,8 @@ if [ "$1" = 'mysqld' ]; then else ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ - GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ + GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" fi "${mysql[@]}" <<-EOSQL DELETE FROM mysql.user WHERE user NOT IN ('mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); @@ -132,6 +140,8 @@ EOF fi echo 'FLUSH PRIVILEGES ;' | "${mysql[@]}" + elif [ "$MYSQL_USER" -a ! "$MYSQL_PASSWORD" -o ! "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then + echo '[Entrypoint] Not creating mysql user. MYSQL_USER and MYSQL_PASSWORD must be specified to create a mysql user.' fi echo for f in /docker-entrypoint-initdb.d/*; do @@ -189,7 +199,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 8.0.2-dmr-1.1.1" + echo "[Entrypoint] Starting MySQL 8.0.3-dmr-1.1.1" fi exec "$@" diff --git a/genOracleLinux.sh b/genOracleLinux.sh index 0c297a928..3e6e7d5ab 100755 --- a/genOracleLinux.sh +++ b/genOracleLinux.sh @@ -22,10 +22,10 @@ VERSIONS="5.5 5.6 5.7 8.0" VERSION_DOCKERFILES=1.1.1 declare -A SERVER_VERSION_FULL -SERVER_VERSION_FULL["5.5"]="5.5.57-${VERSION_DOCKERFILES}" -SERVER_VERSION_FULL["5.6"]="5.6.37-${VERSION_DOCKERFILES}" -SERVER_VERSION_FULL["5.7"]="5.7.19-${VERSION_DOCKERFILES}" -SERVER_VERSION_FULL["8.0"]="8.0.2-dmr-${VERSION_DOCKERFILES}" +SERVER_VERSION_FULL["5.5"]="5.5.58-${VERSION_DOCKERFILES}" +SERVER_VERSION_FULL["5.6"]="5.6.38-${VERSION_DOCKERFILES}" +SERVER_VERSION_FULL["5.7"]="5.7.20-${VERSION_DOCKERFILES}" +SERVER_VERSION_FULL["8.0"]="8.0.3-dmr-${VERSION_DOCKERFILES}" declare -A PACKAGE_URL PACKAGE_URL["5.5"]="https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.57-2.el7.x86_64.rpm" From 2807d4b849f1e55b3eceb9554b5565ec441a7c73 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Wed, 30 Aug 2017 10:10:36 +0200 Subject: [PATCH 115/386] Change misleading name for console logging When the server logs to console it actually logs to stderr, not stdout. --- 5.5/docker-entrypoint.sh | 2 +- 5.6/docker-entrypoint.sh | 2 +- 5.7/docker-entrypoint.sh | 2 +- 8.0/docker-entrypoint.sh | 2 +- changelog | 4 ++-- genOracleLinux.sh | 4 ++-- template/docker-entrypoint.sh | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/5.5/docker-entrypoint.sh b/5.5/docker-entrypoint.sh index 024f59651..c56c145d3 100755 --- a/5.5/docker-entrypoint.sh +++ b/5.5/docker-entrypoint.sh @@ -46,7 +46,7 @@ if [ "$1" = 'mysqld' ]; then DATADIR="$(_get_config 'datadir' "$@")" SOCKET="$(_get_config 'socket' "$@")" - if [ -n "$MYSQL_LOG_STDOUT" ] || [ -n "" ]; then + if [ -n "$MYSQL_LOG_CONSOLE" ] || [ -n "" ]; then sed -i 's/^log-error=/#&/' /etc/my.cnf fi diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index 08f1216dd..ae3784f5d 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -46,7 +46,7 @@ if [ "$1" = 'mysqld' ]; then DATADIR="$(_get_config 'datadir' "$@")" SOCKET="$(_get_config 'socket' "$@")" - if [ -n "$MYSQL_LOG_STDOUT" ] || [ -n "" ]; then + if [ -n "$MYSQL_LOG_CONSOLE" ] || [ -n "" ]; then sed -i 's/^log-error=/#&/' /etc/my.cnf fi diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 1fef6abd4..6d3989d27 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -46,7 +46,7 @@ if [ "$1" = 'mysqld' ]; then DATADIR="$(_get_config 'datadir' "$@")" SOCKET="$(_get_config 'socket' "$@")" - if [ -n "$MYSQL_LOG_STDOUT" ] || [ -n "" ]; then + if [ -n "$MYSQL_LOG_CONSOLE" ] || [ -n "" ]; then sed -i 's/^log-error=/#&/' /etc/my.cnf fi diff --git a/8.0/docker-entrypoint.sh b/8.0/docker-entrypoint.sh index d52dde64c..2e8c1bf29 100755 --- a/8.0/docker-entrypoint.sh +++ b/8.0/docker-entrypoint.sh @@ -46,7 +46,7 @@ if [ "$1" = 'mysqld' ]; then DATADIR="$(_get_config 'datadir' "$@")" SOCKET="$(_get_config 'socket' "$@")" - if [ -n "$MYSQL_LOG_STDOUT" ] || [ -n "stdout" ]; then + if [ -n "$MYSQL_LOG_CONSOLE" ] || [ -n "console" ]; then sed -i 's/^log-error=/#&/' /etc/my.cnf fi diff --git a/changelog b/changelog index 3e2ca76d3..e548b71e9 100644 --- a/changelog +++ b/changelog @@ -2,8 +2,8 @@ Changes in 1.1.1 (not released) * Disable binlog for all entrypoint client commands (#87305) This was previously only done only for the script to set the root password, but should be done for all client commands, or group replication will fail - * Add flag for logging to stdout (#87458) - Setting -e MYSQL_LOG_STDOUT=true will make the server log to stdout, so the + * Add flag for logging to console (#87458) + Setting -e MYSQL_LOG_CONSOLE=true will make the server log to console, so the server log is available through Docker's log interface. * Ensure both MYSQL_USER and MYSQL_PASSWORD are set (#86982) Before, setting only one would cause the option to be silently ignored. diff --git a/genOracleLinux.sh b/genOracleLinux.sh index 3e6e7d5ab..9315b6c9c 100755 --- a/genOracleLinux.sh +++ b/genOracleLinux.sh @@ -87,12 +87,12 @@ TZINFO_WORKAROUND["5.6"]="sed 's/Local time zone must be set--see zic manual pag TZINFO_WORKAROUND["5.7"]="" TZINFO_WORKAROUND["8.0"]="" -# Logging to stdout makes server log available with the «docker logs command» +# Logging to console (stderr) makes server log available with the «docker logs command» declare -A DEFAULT_LOG DEFAULT_LOG["5.5"]="" DEFAULT_LOG["5.6"]="" DEFAULT_LOG["5.7"]="" -DEFAULT_LOG["8.0"]="stdout" +DEFAULT_LOG["8.0"]="console" for VERSION in ${VERSIONS} do diff --git a/template/docker-entrypoint.sh b/template/docker-entrypoint.sh index 5e4d19dde..a24f3e129 100644 --- a/template/docker-entrypoint.sh +++ b/template/docker-entrypoint.sh @@ -46,7 +46,7 @@ if [ "$1" = 'mysqld' ]; then DATADIR="$(_get_config 'datadir' "$@")" SOCKET="$(_get_config 'socket' "$@")" - if [ -n "$MYSQL_LOG_STDOUT" ] || [ -n "%%DEFAULT_LOG%%" ]; then + if [ -n "$MYSQL_LOG_CONSOLE" ] || [ -n "%%DEFAULT_LOG%%" ]; then sed -i 's/^log-error=/#&/' /etc/my.cnf fi From 79499c101cc92f43b787cd8ae37cff8b58972fce Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Mon, 4 Sep 2017 08:04:07 +0200 Subject: [PATCH 116/386] Only change log-error setting if /etc/my.cnf is not a mount If the file is mounted the command to comment out the setting can fail, causing container failure. Also, we do not wish to override user customizations. --- changelog | 3 ++- template/docker-entrypoint.sh | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/changelog b/changelog index e548b71e9..e87ac1360 100644 --- a/changelog +++ b/changelog @@ -4,7 +4,8 @@ Changes in 1.1.1 (not released) but should be done for all client commands, or group replication will fail * Add flag for logging to console (#87458) Setting -e MYSQL_LOG_CONSOLE=true will make the server log to console, so the - server log is available through Docker's log interface. + server log is available through Docker's log interface. If /etc/my.cnf is + mounted from the host system, this has no effect. * Ensure both MYSQL_USER and MYSQL_PASSWORD are set (#86982) Before, setting only one would cause the option to be silently ignored. * Read password file first and throw error if it is empty (#87025) diff --git a/template/docker-entrypoint.sh b/template/docker-entrypoint.sh index a24f3e129..18b0b31fc 100644 --- a/template/docker-entrypoint.sh +++ b/template/docker-entrypoint.sh @@ -47,7 +47,10 @@ if [ "$1" = 'mysqld' ]; then SOCKET="$(_get_config 'socket' "$@")" if [ -n "$MYSQL_LOG_CONSOLE" ] || [ -n "%%DEFAULT_LOG%%" ]; then - sed -i 's/^log-error=/#&/' /etc/my.cnf + # Don't touch bind-mounted config files + if ! cat /proc/1/mounts | grep "etc/my.cnf"; then + sed -i 's/^log-error=/#&/' /etc/my.cnf + fi fi if [ ! -d "$DATADIR/mysql" ]; then From dcc54e5f902ba436cb482dc89794ec83db1b3e7d Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 12 Sep 2017 08:39:12 +0200 Subject: [PATCH 117/386] 8.0.3 incorrectly tagged as dmr instead of rc --- genOracleLinux.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/genOracleLinux.sh b/genOracleLinux.sh index 9315b6c9c..25e90dd32 100755 --- a/genOracleLinux.sh +++ b/genOracleLinux.sh @@ -25,7 +25,7 @@ declare -A SERVER_VERSION_FULL SERVER_VERSION_FULL["5.5"]="5.5.58-${VERSION_DOCKERFILES}" SERVER_VERSION_FULL["5.6"]="5.6.38-${VERSION_DOCKERFILES}" SERVER_VERSION_FULL["5.7"]="5.7.20-${VERSION_DOCKERFILES}" -SERVER_VERSION_FULL["8.0"]="8.0.3-dmr-${VERSION_DOCKERFILES}" +SERVER_VERSION_FULL["8.0"]="8.0.3-rc-${VERSION_DOCKERFILES}" declare -A PACKAGE_URL PACKAGE_URL["5.5"]="https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.57-2.el7.x86_64.rpm" From ed3d54d4911e11f6f8a06892649ee4d8ced02254 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 12 Sep 2017 08:42:13 +0200 Subject: [PATCH 118/386] Updated shell versions * 5.7 image now has shell 1.0.10 * 8.0 image now has shell 8.0 --- genOracleLinux.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/genOracleLinux.sh b/genOracleLinux.sh index 25e90dd32..e28a2da74 100755 --- a/genOracleLinux.sh +++ b/genOracleLinux.sh @@ -36,8 +36,8 @@ PACKAGE_URL["8.0"]="https://repo.mysql.com/yum/mysql-8.0-community/docker/x86_64 declare -A PACKAGE_URL_SHELL PACKAGE_URL_SHELL["5.5"]="\"\"" PACKAGE_URL_SHELL["5.6"]="\"\"" -PACKAGE_URL_SHELL["5.7"]="https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/mysql-shell-1.0.9-1.el7.x86_64.rpm" -PACKAGE_URL_SHELL["8.0"]="https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/mysql-shell-1.0.9-1.el7.x86_64.rpm" +PACKAGE_URL_SHELL["5.7"]="https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/mysql-shell-1.0.10-1.el7.x86_64.rpm" +PACKAGE_URL_SHELL["8.0"]="https://repo.mysql.com/yum/mysql-tools-preview/el/7/x86_64/mysql-shell-8.0.0-0.1.dmr.el7.x86_64.rpm" # 33060 is the default port for the mysqlx plugin, new to 5.7 declare -A PORTS From 06ddbab83b9d2d74ca8e4b987bd6966a41cec6f8 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Fri, 22 Sep 2017 09:24:54 +0200 Subject: [PATCH 119/386] Separate out version info --- VERSION | 7 +++++++ genOracleLinux.sh | 10 +++++----- 2 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 VERSION diff --git a/VERSION b/VERSION new file mode 100644 index 000000000..832791328 --- /dev/null +++ b/VERSION @@ -0,0 +1,7 @@ +VERSION_DOCKER=1.1.1 +VERSION_SERVER_55=5.5.57 +VERSION_SERVER_56=5.6.37 +VERSION_SERVER_57=5.7.19 +VERSION_SERVER_80=8.0.3 +VERSION_SHELL_10=1.0.10 +VERSION_SHELL_80=8.0.0 diff --git a/genOracleLinux.sh b/genOracleLinux.sh index e28a2da74..7c4607192 100755 --- a/genOracleLinux.sh +++ b/genOracleLinux.sh @@ -19,13 +19,13 @@ # Example: mysql_install_db for 5.5 and 5.6, and mysqld --initialize for newer VERSIONS="5.5 5.6 5.7 8.0" -VERSION_DOCKERFILES=1.1.1 +. VERSION declare -A SERVER_VERSION_FULL -SERVER_VERSION_FULL["5.5"]="5.5.58-${VERSION_DOCKERFILES}" -SERVER_VERSION_FULL["5.6"]="5.6.38-${VERSION_DOCKERFILES}" -SERVER_VERSION_FULL["5.7"]="5.7.20-${VERSION_DOCKERFILES}" -SERVER_VERSION_FULL["8.0"]="8.0.3-rc-${VERSION_DOCKERFILES}" +SERVER_VERSION_FULL["5.5"]="${VERSION_SERVER_55}-${VERSION_DOCKER}" +SERVER_VERSION_FULL["5.6"]="${VERSION_SERVER_56}-${VERSION_DOCKER}" +SERVER_VERSION_FULL["5.7"]="${VERSION_SERVER_57}-${VERSION_DOCKER}" +SERVER_VERSION_FULL["8.0"]="${VERSION_SERVER_80}-${VERSION_DOCKER}" declare -A PACKAGE_URL PACKAGE_URL["5.5"]="https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.57-2.el7.x86_64.rpm" From b985eb1883dfe37a8bb1a102cfe76400e3029b4f Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Fri, 22 Sep 2017 12:31:57 +0200 Subject: [PATCH 120/386] Updated MySQL 8.0 version to 8.0.3-rc --- genOracleLinux.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/genOracleLinux.sh b/genOracleLinux.sh index 7c4607192..9183fee54 100755 --- a/genOracleLinux.sh +++ b/genOracleLinux.sh @@ -31,7 +31,7 @@ declare -A PACKAGE_URL PACKAGE_URL["5.5"]="https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.57-2.el7.x86_64.rpm" PACKAGE_URL["5.6"]="https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.37-2.el7.x86_64.rpm" PACKAGE_URL["5.7"]="https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.19-1.el7.x86_64.rpm" -PACKAGE_URL["8.0"]="https://repo.mysql.com/yum/mysql-8.0-community/docker/x86_64/mysql-community-server-minimal-8.0.2-0.1.dmr.el7.x86_64.rpm" +PACKAGE_URL["8.0"]="https://repo.mysql.com/yum/mysql-8.0-community/docker/x86_64/mysql-community-server-minimal-8.0.3-0.1.rc.el7.x86_64.rpm" declare -A PACKAGE_URL_SHELL PACKAGE_URL_SHELL["5.5"]="\"\"" From 97b0685a6f7355f5204db3b80062913e6bace2dd Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Fri, 22 Sep 2017 12:36:28 +0200 Subject: [PATCH 121/386] Generated version files for 1.1.1 --- 5.5/docker-entrypoint.sh | 9 ++++++--- 5.6/docker-entrypoint.sh | 9 ++++++--- 5.7/Dockerfile | 2 +- 5.7/docker-entrypoint.sh | 9 ++++++--- 8.0/Dockerfile | 4 ++-- 8.0/docker-entrypoint.sh | 9 ++++++--- changelog | 9 +++++---- 7 files changed, 32 insertions(+), 19 deletions(-) diff --git a/5.5/docker-entrypoint.sh b/5.5/docker-entrypoint.sh index c56c145d3..c6bd8a616 100755 --- a/5.5/docker-entrypoint.sh +++ b/5.5/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.5.58-1.1.1" +echo "[Entrypoint] MySQL Docker Image 5.5.57-1.1.1" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -47,7 +47,10 @@ if [ "$1" = 'mysqld' ]; then SOCKET="$(_get_config 'socket' "$@")" if [ -n "$MYSQL_LOG_CONSOLE" ] || [ -n "" ]; then - sed -i 's/^log-error=/#&/' /etc/my.cnf + # Don't touch bind-mounted config files + if ! cat /proc/1/mounts | grep "etc/my.cnf"; then + sed -i 's/^log-error=/#&/' /etc/my.cnf + fi fi if [ ! -d "$DATADIR/mysql" ]; then @@ -199,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.5.58-1.1.1" + echo "[Entrypoint] Starting MySQL 5.5.57-1.1.1" fi exec "$@" diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index ae3784f5d..c8e2730ca 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.6.38-1.1.1" +echo "[Entrypoint] MySQL Docker Image 5.6.37-1.1.1" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -47,7 +47,10 @@ if [ "$1" = 'mysqld' ]; then SOCKET="$(_get_config 'socket' "$@")" if [ -n "$MYSQL_LOG_CONSOLE" ] || [ -n "" ]; then - sed -i 's/^log-error=/#&/' /etc/my.cnf + # Don't touch bind-mounted config files + if ! cat /proc/1/mounts | grep "etc/my.cnf"; then + sed -i 's/^log-error=/#&/' /etc/my.cnf + fi fi if [ ! -d "$DATADIR/mysql" ]; then @@ -199,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.6.38-1.1.1" + echo "[Entrypoint] Starting MySQL 5.6.37-1.1.1" fi exec "$@" diff --git a/5.7/Dockerfile b/5.7/Dockerfile index 224586c90..7049b5677 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -15,7 +15,7 @@ FROM oraclelinux:7-slim ARG PACKAGE_URL=https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.19-1.el7.x86_64.rpm -ARG PACKAGE_URL_SHELL=https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/mysql-shell-1.0.9-1.el7.x86_64.rpm +ARG PACKAGE_URL_SHELL=https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/mysql-shell-1.0.10-1.el7.x86_64.rpm # Install server RUN rpmkeys --import https://repo.mysql.com/RPM-GPG-KEY-mysql \ diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 6d3989d27..fed0b3948 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.20-1.1.1" +echo "[Entrypoint] MySQL Docker Image 5.7.19-1.1.1" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -47,7 +47,10 @@ if [ "$1" = 'mysqld' ]; then SOCKET="$(_get_config 'socket' "$@")" if [ -n "$MYSQL_LOG_CONSOLE" ] || [ -n "" ]; then - sed -i 's/^log-error=/#&/' /etc/my.cnf + # Don't touch bind-mounted config files + if ! cat /proc/1/mounts | grep "etc/my.cnf"; then + sed -i 's/^log-error=/#&/' /etc/my.cnf + fi fi if [ ! -d "$DATADIR/mysql" ]; then @@ -199,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.7.20-1.1.1" + echo "[Entrypoint] Starting MySQL 5.7.19-1.1.1" fi exec "$@" diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 450463a56..1f5d52d06 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG PACKAGE_URL=https://repo.mysql.com/yum/mysql-8.0-community/docker/x86_64/mysql-community-server-minimal-8.0.2-0.1.dmr.el7.x86_64.rpm -ARG PACKAGE_URL_SHELL=https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/mysql-shell-1.0.9-1.el7.x86_64.rpm +ARG PACKAGE_URL=https://repo.mysql.com/yum/mysql-8.0-community/docker/x86_64/mysql-community-server-minimal-8.0.3-0.1.rc.el7.x86_64.rpm +ARG PACKAGE_URL_SHELL=https://repo.mysql.com/yum/mysql-tools-preview/el/7/x86_64/mysql-shell-8.0.0-0.1.dmr.el7.x86_64.rpm # Install server RUN rpmkeys --import https://repo.mysql.com/RPM-GPG-KEY-mysql \ diff --git a/8.0/docker-entrypoint.sh b/8.0/docker-entrypoint.sh index 2e8c1bf29..91aba8f6d 100755 --- a/8.0/docker-entrypoint.sh +++ b/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.3-dmr-1.1.1" +echo "[Entrypoint] MySQL Docker Image 8.0.3-1.1.1" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -47,7 +47,10 @@ if [ "$1" = 'mysqld' ]; then SOCKET="$(_get_config 'socket' "$@")" if [ -n "$MYSQL_LOG_CONSOLE" ] || [ -n "console" ]; then - sed -i 's/^log-error=/#&/' /etc/my.cnf + # Don't touch bind-mounted config files + if ! cat /proc/1/mounts | grep "etc/my.cnf"; then + sed -i 's/^log-error=/#&/' /etc/my.cnf + fi fi if [ ! -d "$DATADIR/mysql" ]; then @@ -199,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 8.0.3-dmr-1.1.1" + echo "[Entrypoint] Starting MySQL 8.0.3-1.1.1" fi exec "$@" diff --git a/changelog b/changelog index e87ac1360..374805a42 100644 --- a/changelog +++ b/changelog @@ -1,11 +1,12 @@ -Changes in 1.1.1 (not released) +Changes in 1.1.1 (2017-09-22) * Disable binlog for all entrypoint client commands (#87305) This was previously only done only for the script to set the root password, but should be done for all client commands, or group replication will fail * Add flag for logging to console (#87458) Setting -e MYSQL_LOG_CONSOLE=true will make the server log to console, so the server log is available through Docker's log interface. If /etc/my.cnf is - mounted from the host system, this has no effect. + mounted from the host system, this has no effect. On 8.0, this is the default + behavior. * Ensure both MYSQL_USER and MYSQL_PASSWORD are set (#86982) Before, setting only one would cause the option to be silently ignored. * Read password file first and throw error if it is empty (#87025) @@ -18,6 +19,8 @@ Changes in 1.1.1 (not released) If the MYSQL_ROOT_HOST variable is set we add an additional root user for the given host. This user was missing the PROXY privilege. We add the missing privilege so the users are identical. + * MySQL Server 8.0 updated to 8.0.3-rc + * MySQL Shell for 5.7 updated to 1.0.10 Changes in 1.1.0 (2017-07-24) * Fixed broken MYSQL_ONETIME_PASSWORD support (#86523) @@ -45,5 +48,3 @@ Known issues: healthcheck script will generate an "Access denied for healthchecker@localhost" message in the server log every time it runs. If connection throttling is enabled this could eventually cause the healthcheck to fail - * 5.7: Shell 1.0.9 is unable to set up innodb-cluster with the default - root@localhost user (#86267) From 405fed7172548e26dab8b264355bc6ff3d9bc933 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Mon, 25 Sep 2017 08:45:48 +0200 Subject: [PATCH 122/386] Reworked tests Tests now build/run all images, not just one. --- test/build.sh | 73 +++++++++++++++++++++++ test/cleanup.sh | 9 --- test/sql_version.sql | 1 - test/test.sh | 139 +++++++++++++++++++++++++++++++++++++++++++ test/testbuild.sh | 29 --------- test/testserver.sh | 52 ---------------- 6 files changed, 212 insertions(+), 91 deletions(-) create mode 100755 test/build.sh delete mode 100755 test/cleanup.sh delete mode 100644 test/sql_version.sql create mode 100755 test/test.sh delete mode 100755 test/testbuild.sh delete mode 100755 test/testserver.sh diff --git a/test/build.sh b/test/build.sh new file mode 100755 index 000000000..103c80c79 --- /dev/null +++ b/test/build.sh @@ -0,0 +1,73 @@ +#!/bin/bash + +set -e + +if [ ! -f "genOracleLinux.sh" ]; then + echo "This script must be run from the base docker source directory" + exit 1 +fi +. VERSION + +echo "Docker image version: $VERSION_DOCKER" +echo "The following server versions will be packaged:" +echo " - $VERSION_SERVER_55" +echo " - $VERSION_SERVER_56" +echo " - $VERSION_SERVER_57" +echo " - $VERSION_SERVER_80" +echo "The following shell versions will be packaged:" +echo " - For 5.7: $VERSION_SHELL_10" +echo " - For 8.0: $VERSION_SHELL_80" +read -p "Is this correct? (y/n) " -n 1 -r +echo +if [[ ! $REPLY =~ ^[Yy]$ ]] +then + echo "Aborting" + exit 0 +fi + +echo "...Locating server packages" + +for VERSION_SERVER in $VERSION_SERVER_55 $VERSION_SERVER_56 $VERSION_SERVER_57 $VERSION_SERVER_80 +do + VERSION_PART=${VERSION_SERVER:0:3} + REPOURL=https://repo.mysql.com/yum/mysql-$VERSION_PART-community/docker/x86_64/ + FILENAME=$(wget -q -O - $REPOURL | grep mysql-community-server-minimal-$VERSION_SERVER | cut -d \" -f 6 | sort -r | head -1) + if [ -z "$FILENAME" ]; + then + echo "Unable to locate server package for $VERSION_SERVER. Aborting" + exit 1 + fi + sed -i "s#^PACKAGE_URL\[\"${VERSION_PART}\"\].*#PACKAGE_URL\[\"${VERSION_PART}\"\]=\"${REPOURL}${FILENAME}\"#" genOracleLinux.sh +done + +echo "...Locating shell packages" + +REPOURL_SHELL_10="https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/" +REPOURL_SHELL_80="https://repo.mysql.com/yum/mysql-tools-preview/el/7/x86_64/" +FILENAME_SHELL_10=$(wget -q -O - $REPOURL_SHELL_10 | grep mysql-shell-$VERSION_SHELL_10 | cut -d \" -f 6 | sort -r | head -1) +FILENAME_SHELL_80=$(wget -q -O - $REPOURL_SHELL_80 | grep mysql-shell-$VERSION_SHELL_80 | cut -d \" -f 6 | sort -r | head -1) +if [ -z "$FILENAME_SHELL_10" ]; +then + echo "Unable to locate shell package for $VERSION_SHELL_10. Aborting." + exit 1 +fi +if [ -z "$FILENAME_SHELL_80" ]; +then + echo "Unable to locate shell package for $VERSION_SHELL_80. Aborting." + exit 1 +fi +sed -i "s#^PACKAGE_URL_SHELL\[\"5.7\"\].*#PACKAGE_URL_SHELL\[\"5.7\"\]=\"${REPOURL_SHELL_10}${FILENAME_SHELL_10}\"#" genOracleLinux.sh +sed -i "s#^PACKAGE_URL_SHELL\[\"8.0\"\].*#PACKAGE_URL_SHELL\[\"8.0\"\]=\"${REPOURL_SHELL_80}${FILENAME_SHELL_80}\"#" genOracleLinux.sh +echo "...Generating image source" +./genOracleLinux.sh + +for MAJOR_VERSION in 5.5 5.6 5.7 8.0 +do + if [ -n "$http_proxy" ] && [ -n "$https_proxy" ]; + then + echo "Building with proxy values found in env" + docker build -t mysql/mysql-server:$MAJOR_VERSION --build-arg http_proxy=$http_proxy --build-arg https_proxy=$https_proxy $MAJOR_VERSION + else + docker build -t mysql/mysql-server:$MAJOR_VERSION $MAJOR_VERSION + fi +done diff --git a/test/cleanup.sh b/test/cleanup.sh deleted file mode 100755 index 9c6d578aa..000000000 --- a/test/cleanup.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -VERSION=$1 -echo "Running cleanup" -docker kill testserver -docker rm testserver -docker rmi "mysql/mysql-server:$VERSION" -echo "Cleanup complete" - diff --git a/test/sql_version.sql b/test/sql_version.sql deleted file mode 100644 index 4ce0ef2d1..000000000 --- a/test/sql_version.sql +++ /dev/null @@ -1 +0,0 @@ -show variables like 'version'; diff --git a/test/test.sh b/test/test.sh new file mode 100755 index 000000000..3858f01f3 --- /dev/null +++ b/test/test.sh @@ -0,0 +1,139 @@ +#!/bin/bash + +if [ ! -f "genOracleLinux.sh" ]; then + echo "This script must be run from the base docker source directory" + exit 1 +fi +. VERSION + +echo "...Starting images" + +docker run -d --rm --name=mysqlserver55 --health-interval=5s -e MYSQL_ROOT_PASSWORD=rot mysql/mysql-server:5.5 > /dev/null +docker run -d --rm --name=mysqlserver56 --health-interval=5s -e MYSQL_ROOT_PASSWORD=rot mysql/mysql-server:5.6 > /dev/null +docker run -d --rm --name=mysqlserver57 --health-interval=5s -e MYSQL_ROOT_PASSWORD=rot mysql/mysql-server:5.7 > /dev/null +docker run -d --rm --name=mysqlserver80 --health-interval=5s -e MYSQL_ROOT_PASSWORD=rot mysql/mysql-server:8.0 > /dev/null + +echo "...Waiting for health checks" +for i in {1..12} +do + echo "." + sleep 5 + if [ -z "$STATUS55" ]; + then + if docker ps | grep mysqlserver55 | grep healthy | grep -v unhealthy > /dev/null; then + echo "...MySQL 5.5 Image Started" + if docker logs mysqlserver55 2>&1 | grep "MySQL Docker Image $VERSION_SERVER_55-$VERSION_DOCKER" > /dev/null; then + RESPONSE=$(docker exec mysqlserver55 mysql -uroot -prot -e "SELECT VERSION();" 2>&1) + if [[ "$RESPONSE" =~ "$VERSION_SERVER_55" ]]; + then + echo "...MySQL $VERSION_SERVER_55 OK" + STATUS55="OK" + else + echo "...Unexpected response from 5.5: $RESPONSE" + STATUS55=$RESPONSE + exit 1 + fi + else + echo "...Bad Docker script version" + STATUS55="Incorrect Docker script version" + fi + fi + fi + if [ -z "$STATUS56" ]; + then + if docker ps | grep mysqlserver56 | grep healthy | grep -v unhealthy > /dev/null; then + echo "...MySQL 5.6 Image Started" + if docker logs mysqlserver56 2>&1 | grep "MySQL Docker Image $VERSION_SERVER_56-$VERSION_DOCKER" > /dev/null; then + RESPONSE=$(docker exec mysqlserver56 mysql -uroot -prot -e "SELECT VERSION();" 2>&1) + if [[ "$RESPONSE" =~ "$VERSION_SERVER_56" ]]; + then + echo "...MySQL $VERSION_SERVER_56 OK" + STATUS56="OK" + else + echo "...Unexpected response from 5.6: $RESPONSE" + STATUS56=$RESPONSE + exit 1 + fi + else + echo "...Bad Docker script version" + STATUS56="Incorrect Docker script version" + fi + fi + fi + if [ -z "$STATUS57" ]; + then + if docker ps | grep mysqlserver57 | grep healthy | grep -v unhealthy > /dev/null; then + echo "...MySQL 5.7 Image Started" + if docker logs mysqlserver57 2>&1 | grep "MySQL Docker Image $VERSION_SERVER_57-$VERSION_DOCKER" > /dev/null; then + RESPONSE=$(docker exec mysqlserver57 mysql -uroot -prot -e "SELECT VERSION();" 2>&1) + if [[ "$RESPONSE" =~ "$VERSION_SERVER_57" ]]; + then + echo "...MySQL $VERSION_SERVER_57 OK" + RESPONSE=$(docker exec mysqlserver57 mysqlsh --version) + if [[ "$RESPONSE" =~ "$VERSION_SHELL_10" ]]; + then + echo "...Shell $VERSION_SHELL_10 OK" + STATUS57="OK" + else + echo "...Bad Shell version in 5.7 image" + STATUS57="$RESPONSE" + fi + else + echo "...Unexpected response from 5.7: $RESPONSE" + STATUS57=$RESPONSE + exit 1 + fi + else + echo "...Bad Docker script version" + STATUS57="Incorrect Docker script version" + fi + fi + fi + if [ -z "$STATUS80" ]; + then + if docker ps | grep mysqlserver80 | grep healthy | grep -v unhealthy > /dev/null; then + echo "...MySQL 8.0 Image Started" + if docker logs mysqlserver80 2>&1 | grep "MySQL Docker Image $VERSION_SERVER_80-$VERSION_DOCKER" > /dev/null; then + RESPONSE=$(docker exec mysqlserver80 mysql -uroot -prot -e "SELECT VERSION();" 2>&1) + if [[ "$RESPONSE" =~ "$VERSION_SERVER_80" ]]; + then + echo "...MySQL $VERSION_SERVER_80 OK" + RESPONSE=$(docker exec mysqlserver80 mysqlsh --version) + if [[ "$RESPONSE" =~ "$VERSION_SHELL_80" ]]; + then + echo "...Shell $VERSION_SHELL_80 OK" + STATUS80="OK" + else + echo "...Bad Shell version in 5.7 image" + STATUS80="$RESPONSE" + fi + STATUS80="OK" + else + echo "...Unexpected response from 8.0: $RESPONSE" + STATUS80=$RESPONSE + exit 1 + fi + else + echo "...Bad Docker script version" + STATUS80="Incorrect Docker script version" + fi + fi + fi + if [ -n "$STATUS55" ] && [ -n "$STATUS56" ] && [ -n "$STATUS57" ] && [ -n "$STATUS80" ];then + break + fi +done + +echo "...Tests complete" +if [ "$STATUS55" = "OK" ] && [ "$STATUS56" = "OK" ] && [ "$STATUS57" = "OK" ] && [ "$STATUS80" = "OK" ]; +then + echo "...All tests OK. Cleaning up containers." + docker kill mysqlserver55 mysqlserver56 mysqlserver57 mysqlserver80 > /dev/null + exit 0 +fi + +echo "... There were test failures. Containers not removed." +echo "5.5: $STATUS55" +echo "5.6: $STATUS56" +echo "5.7: $STATUS57" +echo "8.0: $STATUS80" diff --git a/test/testbuild.sh b/test/testbuild.sh deleted file mode 100755 index 264293b60..000000000 --- a/test/testbuild.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -VERSION=$1 -DIRECTORY=$2 - -echo "Building image mysql/mysql-server:$VERSION" -docker build -t mysql/mysql-server:$VERSION $DIRECTORY -RES=$? -if [ $RES -eq 0 ]; -then - echo "Image built" -else - echo "Image build failed" - exit 0 -fi - - -IMAGELIST=$(docker images | grep $VERSION) -versionregex="mysql/mysql-server\s*$VERSION" -if [[ $IMAGELIST =~ $versionregex ]]; -then - echo "Test passed" - exit 0 -else - echo "Test failed. Image not in list" - exit 1 -fi - - diff --git a/test/testserver.sh b/test/testserver.sh deleted file mode 100755 index 891da5246..000000000 --- a/test/testserver.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash - -VERSION="$1" -SERVERSTART=0 -SERVERCONNECT=0 -SUCCESS=false -echo "Starting image with MySQL version $VERSION" -docker run -e MYSQL_ROOT_PASSWORD=rot -e MYSQL_ROOT_HOST="%" --name=testserver -p 3306:3306 -d mysql/mysql-server:$VERSION -RES=$? -if [ ! $RES = 0 ]; then - echo "Server start failed with error code $RES" -else - SERVERSTART=1 -fi -echo "Connecting to server..." -if [ $SERVERSTART ]; -then - for i in $(seq 30 -1 0); do - OUTPUT="$(mysql -uroot -prot -h127.0.0.1 -P3306 < 'test/sql_version.sql')" - RES=$? - if [ $RES -eq 0 ]; then - SERVERCONNECT=1 - break - fi - sleep 1 - done - if [ $i = 0 ]; then - echo >&2 "Unable to connect to server." - fi -fi - -if [ $SERVERCONNECT ]; -then - versionregex="version $VERSION" - if [[ $OUTPUT =~ $versionregex ]]; - then - echo "Version check ok" - SUCCESS=true - else - echo "Expected to see version $VERSION. Actual output: $OUTPUT" - fi -fi - -if [ $SUCCESS == true ]; -then - echo "Test passed" - exit 0 -else - echo "Test failed" - exit 1 -fi - From 69a28974ca3dee19f626f60398b967192496c211 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Mon, 25 Sep 2017 08:58:39 +0200 Subject: [PATCH 123/386] Rename test directory to scripts --- {test => scripts}/build.sh | 0 {test => scripts}/test.sh | 0 test/README.md | 2 -- 3 files changed, 2 deletions(-) rename {test => scripts}/build.sh (100%) rename {test => scripts}/test.sh (100%) delete mode 100644 test/README.md diff --git a/test/build.sh b/scripts/build.sh similarity index 100% rename from test/build.sh rename to scripts/build.sh diff --git a/test/test.sh b/scripts/test.sh similarity index 100% rename from test/test.sh rename to scripts/test.sh diff --git a/test/README.md b/test/README.md deleted file mode 100644 index 4ffe43472..000000000 --- a/test/README.md +++ /dev/null @@ -1,2 +0,0 @@ -Some simple test scripts to check the image is built and running the correct version. Used during release -Run from the project root directory From fe347167018f1edb3cb4a35c63acc54bea4962e3 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Mon, 25 Sep 2017 12:13:06 +0200 Subject: [PATCH 124/386] Build script output cleanup --- scripts/build.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 103c80c79..d6e850333 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -61,13 +61,14 @@ sed -i "s#^PACKAGE_URL_SHELL\[\"8.0\"\].*#PACKAGE_URL_SHELL\[\"8.0\"\]=\"${REPOU echo "...Generating image source" ./genOracleLinux.sh +echo "...Building Docker images" for MAJOR_VERSION in 5.5 5.6 5.7 8.0 do + echo "...$MAJOR_VERSION" if [ -n "$http_proxy" ] && [ -n "$https_proxy" ]; then - echo "Building with proxy values found in env" - docker build -t mysql/mysql-server:$MAJOR_VERSION --build-arg http_proxy=$http_proxy --build-arg https_proxy=$https_proxy $MAJOR_VERSION + docker build -t mysql/mysql-server:$MAJOR_VERSION --build-arg http_proxy=$http_proxy --build-arg https_proxy=$https_proxy $MAJOR_VERSION 2>&1>buildlog.txt else - docker build -t mysql/mysql-server:$MAJOR_VERSION $MAJOR_VERSION + docker build -t mysql/mysql-server:$MAJOR_VERSION $MAJOR_VERSION 2>&1>buildlog.txt fi done From 92a202f94f81c8fffb6b3c5861bf4f699d979135 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Mon, 16 Oct 2017 15:10:19 +0200 Subject: [PATCH 125/386] 1.1.2 release --- 5.5/Dockerfile | 2 +- 5.5/docker-entrypoint.sh | 4 ++-- 5.6/Dockerfile | 2 +- 5.6/docker-entrypoint.sh | 4 ++-- 5.7/Dockerfile | 2 +- 5.7/docker-entrypoint.sh | 4 ++-- 8.0/Dockerfile | 2 +- 8.0/docker-entrypoint.sh | 4 ++-- VERSION | 10 +++++----- changelog | 4 ++++ genOracleLinux.sh | 8 ++++---- 11 files changed, 25 insertions(+), 21 deletions(-) diff --git a/5.5/Dockerfile b/5.5/Dockerfile index 3fcd279cc..0cd0309ab 100644 --- a/5.5/Dockerfile +++ b/5.5/Dockerfile @@ -14,7 +14,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG PACKAGE_URL=https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.57-2.el7.x86_64.rpm +ARG PACKAGE_URL=https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.58-2.el7.x86_64.rpm ARG PACKAGE_URL_SHELL="" # Install server diff --git a/5.5/docker-entrypoint.sh b/5.5/docker-entrypoint.sh index c6bd8a616..c33dfa053 100755 --- a/5.5/docker-entrypoint.sh +++ b/5.5/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.5.57-1.1.1" +echo "[Entrypoint] MySQL Docker Image 5.5.58-1.1.2" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.5.57-1.1.1" + echo "[Entrypoint] Starting MySQL 5.5.58-1.1.2" fi exec "$@" diff --git a/5.6/Dockerfile b/5.6/Dockerfile index b2eee8af4..1ff7783de 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -14,7 +14,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG PACKAGE_URL=https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.37-2.el7.x86_64.rpm +ARG PACKAGE_URL=https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.38-2.el7.x86_64.rpm ARG PACKAGE_URL_SHELL="" # Install server diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index c8e2730ca..18fb5004e 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.6.37-1.1.1" +echo "[Entrypoint] MySQL Docker Image 5.6.38-1.1.2" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.6.37-1.1.1" + echo "[Entrypoint] Starting MySQL 5.6.38-1.1.2" fi exec "$@" diff --git a/5.7/Dockerfile b/5.7/Dockerfile index 7049b5677..e8d68935a 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -14,7 +14,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG PACKAGE_URL=https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.19-1.el7.x86_64.rpm +ARG PACKAGE_URL=https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.20-1.el7.x86_64.rpm ARG PACKAGE_URL_SHELL=https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/mysql-shell-1.0.10-1.el7.x86_64.rpm # Install server diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index fed0b3948..3fbfefadf 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.19-1.1.1" +echo "[Entrypoint] MySQL Docker Image 5.7.20-1.1.2" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.7.19-1.1.1" + echo "[Entrypoint] Starting MySQL 5.7.20-1.1.2" fi exec "$@" diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 1f5d52d06..e4e9c69e6 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -15,7 +15,7 @@ FROM oraclelinux:7-slim ARG PACKAGE_URL=https://repo.mysql.com/yum/mysql-8.0-community/docker/x86_64/mysql-community-server-minimal-8.0.3-0.1.rc.el7.x86_64.rpm -ARG PACKAGE_URL_SHELL=https://repo.mysql.com/yum/mysql-tools-preview/el/7/x86_64/mysql-shell-8.0.0-0.1.dmr.el7.x86_64.rpm +ARG PACKAGE_URL_SHELL=https://repo.mysql.com/yum/mysql-tools-preview/el/7/x86_64/mysql-shell-8.0.3-0.1.dmr.el7.x86_64.rpm # Install server RUN rpmkeys --import https://repo.mysql.com/RPM-GPG-KEY-mysql \ diff --git a/8.0/docker-entrypoint.sh b/8.0/docker-entrypoint.sh index 91aba8f6d..fc0e9ea8f 100755 --- a/8.0/docker-entrypoint.sh +++ b/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.3-1.1.1" +echo "[Entrypoint] MySQL Docker Image 8.0.3-1.1.2" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 8.0.3-1.1.1" + echo "[Entrypoint] Starting MySQL 8.0.3-1.1.2" fi exec "$@" diff --git a/VERSION b/VERSION index 832791328..c25dec5fd 100644 --- a/VERSION +++ b/VERSION @@ -1,7 +1,7 @@ -VERSION_DOCKER=1.1.1 -VERSION_SERVER_55=5.5.57 -VERSION_SERVER_56=5.6.37 -VERSION_SERVER_57=5.7.19 +VERSION_DOCKER=1.1.2 +VERSION_SERVER_55=5.5.58 +VERSION_SERVER_56=5.6.38 +VERSION_SERVER_57=5.7.20 VERSION_SERVER_80=8.0.3 VERSION_SHELL_10=1.0.10 -VERSION_SHELL_80=8.0.0 +VERSION_SHELL_80=8.0.3 diff --git a/changelog b/changelog index 374805a42..a308a987e 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,7 @@ +Changes in 1.1.2 (2017-10-16) + * Bumped server versions to 5.5.58, 5.6.38, 5.7.20 + * Bumped Shell 8.0 version to 8.0.3 + Changes in 1.1.1 (2017-09-22) * Disable binlog for all entrypoint client commands (#87305) This was previously only done only for the script to set the root password, diff --git a/genOracleLinux.sh b/genOracleLinux.sh index 9183fee54..158ed5236 100755 --- a/genOracleLinux.sh +++ b/genOracleLinux.sh @@ -28,16 +28,16 @@ SERVER_VERSION_FULL["5.7"]="${VERSION_SERVER_57}-${VERSION_DOCKER}" SERVER_VERSION_FULL["8.0"]="${VERSION_SERVER_80}-${VERSION_DOCKER}" declare -A PACKAGE_URL -PACKAGE_URL["5.5"]="https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.57-2.el7.x86_64.rpm" -PACKAGE_URL["5.6"]="https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.37-2.el7.x86_64.rpm" -PACKAGE_URL["5.7"]="https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.19-1.el7.x86_64.rpm" +PACKAGE_URL["5.5"]="https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.58-2.el7.x86_64.rpm" +PACKAGE_URL["5.6"]="https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.38-2.el7.x86_64.rpm" +PACKAGE_URL["5.7"]="https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.20-1.el7.x86_64.rpm" PACKAGE_URL["8.0"]="https://repo.mysql.com/yum/mysql-8.0-community/docker/x86_64/mysql-community-server-minimal-8.0.3-0.1.rc.el7.x86_64.rpm" declare -A PACKAGE_URL_SHELL PACKAGE_URL_SHELL["5.5"]="\"\"" PACKAGE_URL_SHELL["5.6"]="\"\"" PACKAGE_URL_SHELL["5.7"]="https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/mysql-shell-1.0.10-1.el7.x86_64.rpm" -PACKAGE_URL_SHELL["8.0"]="https://repo.mysql.com/yum/mysql-tools-preview/el/7/x86_64/mysql-shell-8.0.0-0.1.dmr.el7.x86_64.rpm" +PACKAGE_URL_SHELL["8.0"]="https://repo.mysql.com/yum/mysql-tools-preview/el/7/x86_64/mysql-shell-8.0.3-0.1.dmr.el7.x86_64.rpm" # 33060 is the default port for the mysqlx plugin, new to 5.7 declare -A PORTS From a7f1d48aabc660c00be8997d4134638e44e433c9 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Mon, 20 Nov 2017 08:23:21 +0100 Subject: [PATCH 126/386] Update README Documentation has been rewritten --- README.md | 252 ++++++++++++++++++++++++------------------------------ 1 file changed, 110 insertions(+), 142 deletions(-) diff --git a/README.md b/README.md index 31f546c63..7fd366afe 100644 --- a/README.md +++ b/README.md @@ -1,215 +1,183 @@ ![logo](https://www.mysql.com/common/logos/logo-mysql-170x115.png) -# What is MySQL? +What is MySQL? +-------------- -MySQL is the world's most popular open source database. With its proven performance, reliability and ease-of-use, MySQL has become the leading database choice for web-based applications, covering the entire range from personal projects and websites, via online shops and information services, all the way to high profile web properties including Facebook, Twitter, YouTube, Yahoo! and many more. +MySQL is the world's most popular open source database. With its proven performance, reliability, and ease-of-use, MySQL has become the leading choice of database for web applications of all sorts, ranging from personal websites and small online shops all the way to large-scale, high profile web operations like Facebook, Twitter, and YouTube. -For more information and related downloads for MySQL Server and other MySQL products, please visit http://www.mysql.com. +For more information and related downloads for MySQL Server and other MySQL products, please visit . -# MySQL Server Docker Images +Supported Tags and Respective Dockerfile Links +---------------------------------------------- -These are optimized MySQL Server Docker images, created and maintained by the MySQL team at Oracle. The available versions are: +These are tags for some of the optimized MySQL Server Docker images, created and maintained by the MySQL team at Oracle (for a full list, see [the Tags tab of this page](https://hub.docker.com/r/mysql/mysql-server/tags/)). - MySQL Server 5.5 (tag: 5.5) - MySQL Server 5.6 (tag: 5.6) - MySQL Server 5.7, the latest GA version (tag: 5.7 or latest) - MySQL Server 8.0, preview release (tag: 8.0) +- MySQL Server 5.5 (tag: [`5.5`, `5.5.58`, `5.5.58-1.1.2`](https://github.com/mysql/mysql-docker/blob/mysql-server/5.5/Dockerfile)) ([mysql-server/5.5/Dockerfile](https://github.com/mysql/mysql-docker/blob/mysql-server/5.5/Dockerfile)) -Images are updated when new MySQL Server maintenance releases and development milestones are published. Please note that milestone releases are for preview purposes only and should not be used in production setups. +- MySQL Server 5.6 (tag: [`5.6`, `5.6.38`, `5.6.38-1.1.2`](https://github.com/mysql/mysql-docker/blob/mysql-server/5.6/Dockerfile)) ([mysql-server/5.6/Dockerfile](https://github.com/mysql/mysql-docker/blob/mysql-server/5.6/Dockerfile)) -We also from time to time publish special MySQL Server images that contain experimental features. Please take a look at the [MySQL Docker image list](https://hub.docker.com/r/mysql/) to see what is available. +- MySQL Server 5.7, the latest GA (tag: [`5.7`, `5.7.20`, `5.7.20-1.1.2`](https://github.com/mysql/mysql-docker/blob/mysql-server/5.7/Dockerfile)) ([mysql-server/5.7/Dockerfile](https://github.com/mysql/mysql-docker/blob/mysql-server/5.7/Dockerfile)) -# How to Use the MySQL Images +- MySQL Server 8.0, Release Candidate (tag: [`8.0`, `8.0.3-rc`, `8.0.3-rc-1.1.2`](https://github.com/mysql/mysql-docker/blob/mysql-server/8.0/Dockerfile)) ([mysql-server/8.0/Dockerfile](https://github.com/mysql/mysql-docker/blob/mysql-server/8.0/Dockerfile)) -## Start a MySQL Server Instance +Images are updated when new MySQL Server maintenance releases and development milestones are published. Please note that non-GA releases are for preview purposes only and should not be used in production setups. -Start a MySQL instance as follows (but make sure you also read the sections *Secure Container Startup* and *Where to Store Data* below): +We also from time to time publish special MySQL Server images that contain experimental features. Please take a look at the [MySQL Docker image list](https://hub.docker.com/r/mysql/) to see what are available. - docker run --name my-container-name -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql/mysql-server:tag +Quick Reference +--------------- -... where `my-container-name` is the name you want to assign to your container, `my-secret-pw` is the password to be set for the MySQL root user and `tag` is the tag specifying the MySQL version you want. See the list above for relevant tags, or look at the [full list of tags](https://registry.hub.docker.com/u/mysql/mysql-server/tags/manage/). +- *Detailed documentation:* See [Deploying MySQL on Linux with Docker](https://dev.mysql.com/doc/refman/5.7/en/linux-installation-docker.html) in the [MySQL Reference Manual](https://dev.mysql.com/doc/refman/5.7/en/). -## Connect to MySQL from an Application in Another Docker Container +- *Where to file issues:* Please submit a bug report at under the category “MySQL Package Repos and Docker Images”. -This image exposes the standard MySQL port (3306), so container linking makes the MySQL instance available to other application containers. Start your application container like this in order to link it to the MySQL container: +- *Maintained by:* The MySQL team at Oracle - docker run --name app-container-name --link my-container-name:mysql -d app-that-uses-mysql +- *Source of this image:* The [Image repository for the `mysql/mysql-server` container](https://github.com/mysql/mysql-docker) -## Connect to MySQL from the MySQL Command Line Client +- *Supported Docker versions:* The latest stable release is supported. Support for older versions (down to 1.0) is provided on a best-effort basis, but we strongly recommend using the most recent stable Docker version, which this documentation assumes. -The following command starts a new process inside an existing MySQL container instance and runs the `mysql` command line client against your original MySQL server, allowing you to execute SQL statements against your database: +How to Use the MySQL Images +--------------------------- - docker exec -it my-container-name mysql -uroot -p +### Downloading a MySQL Server Docker Image -... where `my-container-name` is the name of your original MySQL Server container. Note that if the main container process (the server) exits, the process started by exec will also exit. +Downloading the server image in a separate step is not strictly necessary; however, performing this before you create your Docker container ensures your local image is up to date. -More information about the MySQL command line client can be found in the MySQL reference documentation at http://dev.mysql.com/doc/refman/en/ +To download the MySQL Community Edition image, run this command: -## Container Shell Access and Viewing MySQL Log Files + docker pull mysql/mysql-server:tag + + -The `docker exec` command allows you to run commands inside a Docker container. The following command line will give you a bash shell inside your MySQL container: +Refer to the list of supported tags above. If `:tag + ` is omitted, the `latest` tag is used, and the image for the latest GA version of MySQL Server is downloaded. - docker exec -it my-container-name bash +### Starting a MySQL Server Instance -The MySQL Server log is located at `/var/log/mysqld.log` inside the container, and the following command line from a shell inside the container will let you inspect it: +Start a new Docker container for the MySQL Community Server with this command: - more /var/log/mysqld.log + docker run --name=mysql1 -d mysql/mysql-server:tag + + -## Running custom init scripts at database creation +The `--name` option, for supplying a custom name for your server container (`mysql1` in the example), is optional; if no container name is supplied, a random one is generated. If the Docker image of the specified name and tag has not been downloaded by an earlier `docker pull` or `docker run` command, the image is now downloaded. After download completes, initialization for the container begins, and the container appears in the list of running containers when you run the `docker ps` command; for example: -After the database is created, the entrypoint script will execute any .sh or .sql scripts found in /docker-entrypoint-initdb.d/ -If you wish to execute any custom initialization scripts (e.g. for extra database or user creation), map them to this location -the first time you start up the image. + shell> docker ps + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + a24888f0d6f4 mysql/mysql-server "/entrypoint.sh my..." 14 seconds ago Up 13 seconds (health: starting) 3306/tcp, 33060/tcp mysql1 -# Environment Variables +The container initialization might take some time. When the server is ready for use, the `STATUS` of the container in the output of the `docker ps` command changes from `(health: starting)` to `(healthy)`. -When you start the MySQL image, you can adjust the configuration of the MySQL instance by passing one or more environment variables on the `docker run` command line. Do note that none of the variables below will have any effect if you start the container with a data directory that already contains a database: any pre-existing database will always be left untouched on container startup. +The `-d` option used in the `docker + run` command above makes the container run in the background. Use this command to monitor the output from the container: -Most of the variables listed below are optional, but one of the variables `MYSQL_ROOT_PASSWORD`, `MYSQL_ALLOW_EMPTY_PASSWORD`, `MYSQL_RANDOM_ROOT_PASSWORD` must be given. + docker logs mysql1 + -## `MYSQL_ROOT_PASSWORD` +Once initialization is finished, the command's output is going to contain the random password generated for the root user; check the password with, for example, this command: -This variable specifies a password that will be set for the MySQL root superuser account. In the above example, it was set `to my-secret-pw`. **NOTE:** Setting the MySQL root user password on the command line is insecure. See the section *Secure Container Startup* below for an alternative. + shell> docker logs mysql1 2>&1 | grep GENERATED + GENERATED ROOT PASSWORD: Axegh3kAJyDLaRuBemecis&EShOs -As an alternative to specifying the password explicitly, if the variable is set to a file path, the contents of the file will be used as the root password. +### Connecting to MySQL Server from within the Container -## `MYSQL_RANDOM_ROOT_PASSWORD` +Once the server is ready, you can run the `mysql` client within the MySQL Server container you just started and connect it to the MySQL Server. Use the `docker exec -it` command to start a `mysql` client inside the Docker container you have started, like this: -When this variable is set to `yes`, a random password for the server's root user will be generated. The password will be printed to stdout in the container, and it can be obtained by using the command `docker logs my-container-name`. + docker exec -it mysql1 mysql -uroot -p + -## `MYSQL_ONETIME_PASSWORD` +When asked, enter the generated root password (see the instructions above on how to find it). Because the `MYSQL_ONETIME_PASSWORD` option is true by default, after you started the server container with the sample command above and connected a `mysql` client to the server, you must reset the server root password by issuing this statement: -This variable is optional. When set to `yes`, the root user's password will be set as expired, and must be changed before MySQL can be used normally. This is only supported by MySQL 5.6 or newer. + mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'newpassword'; + -## `MYSQL_DATABASE` +Substitute `newpassword` with the password of your choice. Once the password is reset, the server is ready for use. -This variable is optional. It allows you to specify the name of a database to be created on image startup. If a user/password was supplied (see below) then that user will be granted superuser access (corresponding to GRANT ALL) to this database. +### Container Shell Access -## `MYSQL_USER`, `MYSQL_PASSWORD` +To have shell access to your MySQL Server container, use the `docker exec -it` command to start a bash shell inside the container: -These variables are optional, used in conjunction to create a new user and set that user's password. This user will be granted superuser permissions (see above) for the database specified by the `MYSQL_DATABASE` variable. Both variables are required for a user to be created. - -Do note that there is no need to use this mechanism to create the `root` superuser, that user gets created by default with the password set by either of the mechanisms (given or generated) discussed above. + shell> docker exec -it mysql1 bash + bash-4.2# -## `MYSQL_ALLOW_EMPTY_PASSWORD` +You can then run Linux commands inside the container at the bash prompt. -Set to `yes` to allow the container to be started with a blank password for the root user. **NOTE:** Setting this variable to `yes` is not recommended unless you really know what you are doing, since this will leave your MySQL instance completely unprotected, allowing anyone to gain complete superuser access. +### Stopping and Deleting a MySQL Container -## `MYSQL_ROOT_HOST` +To stop the MySQL Server container we have created, use this command: -By default, MySQL creates the 'root'@'localhost' account. This account can only be connected to from inside the container, requiring the use of the docker exec command as noted under `Connect to MySQL from the MySQL Command Line Client`. To allow connections from other hosts, set this environment variable. As an example, the value "172.17.0.1", which is the default Docker gateway IP, will allow connections from the Docker host machine. + docker stop mysql1 + -# Notes, Tips, Gotchas +`docker stop` sends a SIGTERM signal to the `mysqld` process, so that the server is shut down gracefully. -## Secure Container Startup +Also notice that when the main process of a container (`mysqld` in the case of a MySQL Server container) is stopped, the Docker container stops automatically. -In many use cases, employing the `MYSQL_ROOT_PASSWORD` variable to specify the MySQL root user password on initial container startup is insecure. Instead, to keep your setup as secure as possible, we strongly recommend using the `MYSQL_RANDOM_ROOT_PASSWORD` option. To further secure your instance, we also recommend using the `MYSQL_ONETIME_PASSWORD` variable if you use MySQL version 5.6 or higher. +To start the MySQL Server container again: -This is the full procedure: + docker start mysql1 + - docker run --name my-container-name -e MYSQL_RANDOM_ROOT_PASSWORD=yes -e MYSQL_ONETIME_PASSWORD=yes -d mysql/mysql-server:tag - docker logs my-container-name +To stop and start again the MySQL Server container with a single command: -Look for the "GENERATED ROOT PASSWORD" line in the output. + docker restart mysql1 + -If you also set the `MYSQL_ONETIME_PASSWORD` variable, you must now start a bash shell inside the container in order to set a new root password: +To delete the MySQL container, stop it first, and then use the `docker rm` command: - docker exec -it my-container-name bash - -Start the MySQL command line client and log in using the randomly set root password: + docker stop mysql1 + + docker rm mysql1 + - mysql -u root -p +If you want the [Docker volume for the server's data directory](https://dev.mysql.com/doc/refman/5.7/en/docker-mysql-more-topics.html#docker-persisting-data-configuration) to be deleted at the same time, add the `-v` option to the `docker rm` command. -And finally, on the mysql client command line, set a new, secure root password for MySQL: +### More Topics on Deploying MySQL Server with Docker - ALTER USER 'root'@'localhost' IDENTIFIED BY 'my-secret-pw'; +For more topics on deploying MySQL Server with Docker like server configuration, persisting data and configuration, and server error log, see [More Topics on Deploying MySQL Server with Docker](https://dev.mysql.com/doc/refman/5.7/en/docker-mysql-more-topics.html) in the MySQL Server manual. -An alternative is to use MYSQL_ROOT_PASSWORD, but set it to point to a file that contains the password. This provides better security than having the password on the command line and is easier to use in automated processes than the random password: +Docker Environment Variables +---------------------------- - docker run --name my-container-name -e MYSQL_ROOT_PASSWORD=/tmp/password.txt -v mypasswordfile:/tmp/password.txt -e MYSQL_ONETIME_PASSWORD=yes -d mysql/mysql-server:tag +When you create a MySQL Server container, you can configure the MySQL instance by using the `--env` option (`-e` in short) and specifying one or more of the following environment variables. -## Where to Store Data +> **Notes** +> +> - None of the variables below has any effect if you mount a data directory that is not empty, as no server initialization is going to be attempted then (see [Persisting Data and Configuration Changes](https://dev.mysql.com/doc/refman/5.7/en/docker-mysql-more-topics.html#docker-persisting-data-configuration) for more details). Any pre-existing contents in the folder, including any old server settings, are not modified during the container startup. +> +> - The boolean variables including `MYSQL_RANDOM_ROOT_PASSWORD`, `MYSQL_ONETIME_PASSWORD`, `MYSQL_ALLOW_EMPTY_PASSWORD`, and `MYSQL_LOG_CONSOLE` are made true by setting them with any strings of non-zero lengths. Therefore, setting them to, for example, “0”, “false”, or “no” does not make them false, but actually makes them true. This is a known issue of the MySQL Server containers. +> +  -There are basically two ways to store data used by applications that run in Docker containers. We encourage users of MySQL with Docker to familiarize themselves with the options available, including: +- `MYSQL_RANDOM_ROOT_PASSWORD`: When this variable is true (which is its default state, unless `MYSQL_ROOT_PASSWORD` is set or `MYSQL_ALLOW_EMPTY_PASSWORD` is set to true), a random password for the server's root user is generated when the Docker container is started. The password is printed to `stdout` of the container and can be found by looking at the container’s log. -* Let Docker manage the storage of your database data by writing the database files to disk on the host system using its own internal volume management. This is the default and is easy and fairly transparent to the user. The downside is that the files may be hard to locate for tools and applications that run directly on the host system, i.e. outside containers. -* Create a data directory on the host system (outside the container) and mount this to a directory visible from inside the container. This places the database files in a known location on the host system, and makes it easy for tools and applications on the host system to access the files. The downside is that the user needs to make sure that the directory exists, and that e.g. directory permissions and other security mechanisms on the host system are set up correctly. +- `MYSQL_ONETIME_PASSWORD`: When the variable is true (which is its default state, unless `MYSQL_ROOT_PASSWORD` is set or `MYSQL_ALLOW_EMPTY_PASSWORD` is set to true), the root user's password is set as expired and must be changed before MySQL can be used normally. This variable is only supported for MySQL 5.6 and later. -The Docker documentation is a good starting point for understanding the different storage options and variations, and there are multiple blog and forum postings that discuss and give advice in this area. We will simply show the basic procedure here for the latter option above: +- `MYSQL_DATABASE`: This variable allows you to specify the name of a database to be created on image startup. If a user name and a password are supplied with `MYSQL_USER` and `MYSQL_PASSWORD`, the user is created and granted superuser access to this database (corresponding to `GRANT ALL`). The specified database is created by a [CREATE DATABASE IF NOT EXIST](#create-database) statement, so that the variable has no effect if the database already exists. -1. Create a data directory on a suitable volume on your host system, e.g. `/my/own/datadir`. -2. Start your MySQL container like this: +- `MYSQL_USER`, `MYSQL_PASSWORD`: These variables are used in conjunction to create a user and set that user's password, and the user is granted superuser permissions for the database specified by the `MYSQL_DATABASE` variable. Both `MYSQL_USER` and `MYSQL_PASSWORD` are required for a user to be created; if any of the two variables is not set, the other is ignored. If both variables are set but `MYSQL_DATABASE` is not, the user is created without any privileges. -``` - docker run --name my-container-name -v /my/own/datadir:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql/mysql-server:tag -``` + > **Note** + > + > There is no need to use this mechanism to create the root superuser, which is created by default with the password set by either one of the mechanisms discussed in the descriptions for `MYSQL_ROOT_PASSWORD` and `MYSQL_RANDOM_ROOT_PASSWORD`, unless `MYSQL_ALLOW_EMPTY_PASSWORD` is true. -The `-v /my/own/datadir:/var/lib/mysql` part of the command mounts the `/my/own/datadir` directory from the underlying host system as `/var/lib/mysql` inside the container, where MySQL by default will write its data files. +- `MYSQL_ROOT_HOST`: By default, MySQL creates the `'root'@'localhost'` account. This account can only be connected to from inside the container. To allow root connections from other hosts, set this environment variable. For example, the value `172.17.0.1`, which is the default Docker gateway IP, allows connections from the host machine that runs the container. The option accepts only one entry, but wildcards are allowed (for example, `MYSQL_ROOT_HOST=172.*.*.*` or `MYSQL_ROOT_HOST=%`). -Note that users on systems with SELinux enabled may experience problems with this. The current workaround is to assign the relevant SELinux policy type to the new data directory so that the container will be allowed to access it: +- `MYSQL_LOG_CONSOLE`: When the variable is true (which is its default state for MySQL 8.0 server containers), the MySQL Server's error log is redirected to `stderr`, so that the error log goes into the Docker container's log and is viewable using the `docker logs` command. - chcon -Rt svirt_sandbox_file_t /my/own/datadir + > **Note** + > + > The variable has no effect if a server configuration file from the host has been mounted (see [Persisting Data and Configuration Changes](https://dev.mysql.com/doc/refman/5.7/en/docker-mysql-more-topics.html#docker-persisting-data-configuration) on bind-mounting a configuration file). -## Usage Against an Existing Database +- `MYSQL_ROOT_PASSWORD`: This variable specifies a password that is set for the MySQL root account. -If you start your MySQL container instance with a data directory that already contains a database (specifically, a `mysql` subdirectory), the `$MYSQL_ROOT_PASSWORD` variable should be omitted from the `docker run` command line; it will in any case be ignored, and the pre-existing database will not be changed in any way. + > **Warning** + > + > Setting the MySQL root user password on the command line is insecure. As an alternative to specifying the password explicitly, you can set the variable with a container file path for a password file, and then mount a file from your host that contains the password at the container file path. This is still not very secure, as the location of the password file is still exposed. It is preferable to use the default settings of `MYSQL_RANDOM_ROOT_PASSWORD` and `MYSQL_ONETIME_PASSWORD` being both true. -## Port forwarding +- `MYSQL_ALLOW_EMPTY_PASSWORD`. Set it to true to allow the container to be started with a blank password for the root user. -Docker allows mapping of ports on the container to ports on the host system by using the -p option. If you start the container as follows, you can connect to the database by connecting your client to a port on the host machine, in this example port 6603: - - docker run --name my-container-name -p 6603:3306 -d mysql/mysql-server - -## Passing options to the server - -You can pass arbitrary command line options to the MySQL server by appending them to the `run command`: - - docker run --name my-container-name -d mysql/mysql-server --option1=value --option2=value - -In this case, the values of option1 and option2 will be passed directly to the server when it is started. The following command will for instance start your container with UTF-8 as the default setting for character set and collation for all databases in MySQL: - - docker run --name my-container-name -d mysql/mysql-server --character-set-server=utf8 --collation-server=utf8_general_ci - -## Using a Custom MySQL Config File - -The MySQL startup configuration in these Docker images is specified in the file `/etc/my.cnf`. If you want to customize this configuration for your own purposes, you can create your alternative configuration file in a directory on the host machine and then mount this file in the appropriate location inside the MySQL container, effectively replacing the standard configuration file. - -If you want to base your changes on the standard configuration file, start your MySQL container in the standard way described above, then do: - - docker exec -it my-container-name cat /etc/my.cnf > /my/custom/config-file - -... where ´/my/custom/config-file´ is the path and name of the new configuration file. Then start a new MySQL container like this: - - docker run --name my-new-container-name -v /my/custom/config-file:/etc/my.cnf -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql/mysql-server:tag - -This will start a new MySQL container ´my-new-container-name´ where the MySQL instance uses the startup options specified in ´/my/custom/config-file´. - -Note that users on systems where SELinux is enabled may experience problems with this. The current workaround is to assign the relevant SELinux policy type to your new config file so that the container will be allowed to mount it: - - chcon -Rt svirt_sandbox_file_t /my/custom/config-file - -## Docker Optimized MySQL Install - -These Docker images are optimized for size, which means that we have reduced the contents to what is expected to be relevant for a large majority of users who run Docker based MySQL instances. The key differences compared to a default MySQL install are: - -* All binaries are stripped, non-debug only -* Included binaries are limited to: - -``` - /usr/bin/my_print_defaults - /usr/bin/mysql - /usr/bin/mysql_config - /usr/bin/mysql_install_db - /usr/bin/mysql_tzinfo_to_sql - /usr/bin/mysql_upgrade - /usr/bin/mysqldump - /usr/sbin/mysqld -``` - -# Supported Docker Versions - -These images are created by the MySQL team for use on the latest version of Docker. Support for older versions (down to 1.0) is provided on a best-effort basis, but we strongly recommend running on the most recent version, since that is assumed for parts of the documentation above. - -# User Feedback - -We welcome your feedback! For general comments or discussion, please drop us a line in the Comments section below. For bugs and issues, please submit a bug report at http://bugs.mysql.com under the category "MySQL Package Repos and Docker Images". + > **Warning** + > + > Setting this variable to true is insecure, because it is going to leave your MySQL instance completely unprotected, allowing anyone to gain complete superuser access. It is preferable to use the default settings of `MYSQL_RANDOM_ROOT_PASSWORD` and `MYSQL_ONETIME_PASSWORD` being both true. From a365126d263d921e2ae7391518c83ca9dfeee39d Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Thu, 23 Nov 2017 14:10:09 +0100 Subject: [PATCH 127/386] Bug#26994759 HANDLE NEW MYSQL.INFOSCHEMA USER IN DOCKER IMAGES Include new user in list of users not to erase --- template/docker-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/docker-entrypoint.sh b/template/docker-entrypoint.sh index 18b0b31fc..33b063099 100644 --- a/template/docker-entrypoint.sh +++ b/template/docker-entrypoint.sh @@ -116,7 +116,7 @@ if [ "$1" = 'mysqld' ]; then GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" fi "${mysql[@]}" <<-EOSQL - DELETE FROM mysql.user WHERE user NOT IN ('mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; ${ROOTCREATE} FLUSH PRIVILEGES ; From 4a9be147c0cb3f594c7a4441b957a671f6a8cda1 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Mon, 27 Nov 2017 09:28:16 +0100 Subject: [PATCH 128/386] Added changelog entry for 1.1.3 --- changelog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/changelog b/changelog index a308a987e..af928506a 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,6 @@ +Changes in 1.1.3 (Not yet released) + * Added support for new infoschema system user in 8.0.4 + Changes in 1.1.2 (2017-10-16) * Bumped server versions to 5.5.58, 5.6.38, 5.7.20 * Bumped Shell 8.0 version to 8.0.3 From 87a6b300f8f6c7075546ba564e0d308e3925a4cb Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 28 Nov 2017 08:28:45 +0100 Subject: [PATCH 129/386] Bumped docker image version to 1.1.3 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index c25dec5fd..b7fc2ddbe 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ -VERSION_DOCKER=1.1.2 +VERSION_DOCKER=1.1.3 VERSION_SERVER_55=5.5.58 VERSION_SERVER_56=5.6.38 VERSION_SERVER_57=5.7.20 From 3df656c127082662a205dc823ed25669e61948e6 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Fri, 8 Dec 2017 11:06:04 +0100 Subject: [PATCH 130/386] Bumped server versions --- VERSION | 8 ++++---- changelog | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index b7fc2ddbe..e8280d0d6 100644 --- a/VERSION +++ b/VERSION @@ -1,7 +1,7 @@ VERSION_DOCKER=1.1.3 -VERSION_SERVER_55=5.5.58 -VERSION_SERVER_56=5.6.38 -VERSION_SERVER_57=5.7.20 -VERSION_SERVER_80=8.0.3 +VERSION_SERVER_55=5.5.59 +VERSION_SERVER_56=5.6.39 +VERSION_SERVER_57=5.7.21 +VERSION_SERVER_80=8.0.4 VERSION_SHELL_10=1.0.10 VERSION_SHELL_80=8.0.3 diff --git a/changelog b/changelog index af928506a..a8b37388a 100644 --- a/changelog +++ b/changelog @@ -1,5 +1,6 @@ Changes in 1.1.3 (Not yet released) * Added support for new infoschema system user in 8.0.4 + * Bumped server versions to 5.5.59, 5.6.39, 5.7.21, 8.0.4 Changes in 1.1.2 (2017-10-16) * Bumped server versions to 5.5.58, 5.6.38, 5.7.20 From 64fd620e7f0c83ef86e01c43f5a0c727b386373c Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Mon, 15 Jan 2018 18:01:33 +0100 Subject: [PATCH 131/386] 1.1.3 release --- 5.5/Dockerfile | 2 +- 5.5/docker-entrypoint.sh | 6 +++--- 5.6/Dockerfile | 2 +- 5.6/docker-entrypoint.sh | 6 +++--- 5.7/Dockerfile | 4 ++-- 5.7/docker-entrypoint.sh | 6 +++--- 8.0/docker-entrypoint.sh | 6 +++--- VERSION | 4 ++-- changelog | 6 +++--- genOracleLinux.sh | 8 ++++---- 10 files changed, 25 insertions(+), 25 deletions(-) diff --git a/5.5/Dockerfile b/5.5/Dockerfile index 0cd0309ab..a50186a12 100644 --- a/5.5/Dockerfile +++ b/5.5/Dockerfile @@ -14,7 +14,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG PACKAGE_URL=https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.58-2.el7.x86_64.rpm +ARG PACKAGE_URL=https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.59-2.el7.x86_64.rpm ARG PACKAGE_URL_SHELL="" # Install server diff --git a/5.5/docker-entrypoint.sh b/5.5/docker-entrypoint.sh index c33dfa053..fd49410c3 100755 --- a/5.5/docker-entrypoint.sh +++ b/5.5/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.5.58-1.1.2" +echo "[Entrypoint] MySQL Docker Image 5.5.59-1.1.3" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -116,7 +116,7 @@ if [ "$1" = 'mysqld' ]; then GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" fi "${mysql[@]}" <<-EOSQL - DELETE FROM mysql.user WHERE user NOT IN ('mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; ${ROOTCREATE} FLUSH PRIVILEGES ; @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.5.58-1.1.2" + echo "[Entrypoint] Starting MySQL 5.5.59-1.1.3" fi exec "$@" diff --git a/5.6/Dockerfile b/5.6/Dockerfile index 1ff7783de..ef7001e8d 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -14,7 +14,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG PACKAGE_URL=https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.38-2.el7.x86_64.rpm +ARG PACKAGE_URL=https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.39-2.el7.x86_64.rpm ARG PACKAGE_URL_SHELL="" # Install server diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index 18fb5004e..c3ce49885 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.6.38-1.1.2" +echo "[Entrypoint] MySQL Docker Image 5.6.39-1.1.3" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -116,7 +116,7 @@ if [ "$1" = 'mysqld' ]; then GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" fi "${mysql[@]}" <<-EOSQL - DELETE FROM mysql.user WHERE user NOT IN ('mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; ${ROOTCREATE} FLUSH PRIVILEGES ; @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.6.38-1.1.2" + echo "[Entrypoint] Starting MySQL 5.6.39-1.1.3" fi exec "$@" diff --git a/5.7/Dockerfile b/5.7/Dockerfile index e8d68935a..a6f58e642 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG PACKAGE_URL=https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.20-1.el7.x86_64.rpm -ARG PACKAGE_URL_SHELL=https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/mysql-shell-1.0.10-1.el7.x86_64.rpm +ARG PACKAGE_URL=https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.21-1.el7.x86_64.rpm +ARG PACKAGE_URL_SHELL=https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/mysql-shell-1.0.11-1.el7.x86_64.rpm # Install server RUN rpmkeys --import https://repo.mysql.com/RPM-GPG-KEY-mysql \ diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 3fbfefadf..5253fca8a 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.20-1.1.2" +echo "[Entrypoint] MySQL Docker Image 5.7.21-1.1.3" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -116,7 +116,7 @@ if [ "$1" = 'mysqld' ]; then GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" fi "${mysql[@]}" <<-EOSQL - DELETE FROM mysql.user WHERE user NOT IN ('mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; ${ROOTCREATE} FLUSH PRIVILEGES ; @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.7.20-1.1.2" + echo "[Entrypoint] Starting MySQL 5.7.21-1.1.3" fi exec "$@" diff --git a/8.0/docker-entrypoint.sh b/8.0/docker-entrypoint.sh index fc0e9ea8f..3a08f02d5 100755 --- a/8.0/docker-entrypoint.sh +++ b/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.3-1.1.2" +echo "[Entrypoint] MySQL Docker Image 8.0.3-1.1.3" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -116,7 +116,7 @@ if [ "$1" = 'mysqld' ]; then GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" fi "${mysql[@]}" <<-EOSQL - DELETE FROM mysql.user WHERE user NOT IN ('mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; ${ROOTCREATE} FLUSH PRIVILEGES ; @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 8.0.3-1.1.2" + echo "[Entrypoint] Starting MySQL 8.0.3-1.1.3" fi exec "$@" diff --git a/VERSION b/VERSION index e8280d0d6..b96f5543c 100644 --- a/VERSION +++ b/VERSION @@ -2,6 +2,6 @@ VERSION_DOCKER=1.1.3 VERSION_SERVER_55=5.5.59 VERSION_SERVER_56=5.6.39 VERSION_SERVER_57=5.7.21 -VERSION_SERVER_80=8.0.4 -VERSION_SHELL_10=1.0.10 +VERSION_SERVER_80=8.0.3 +VERSION_SHELL_10=1.0.11 VERSION_SHELL_80=8.0.3 diff --git a/changelog b/changelog index a8b37388a..6b03a242e 100644 --- a/changelog +++ b/changelog @@ -1,6 +1,6 @@ -Changes in 1.1.3 (Not yet released) - * Added support for new infoschema system user in 8.0.4 - * Bumped server versions to 5.5.59, 5.6.39, 5.7.21, 8.0.4 +Changes in 1.1.3 (2018-01-15) + * Bumped server versions to 5.5.59, 5.6.39, 5.7.21 + * Bumped Shell 1.0 version to 1.0.11 Changes in 1.1.2 (2017-10-16) * Bumped server versions to 5.5.58, 5.6.38, 5.7.20 diff --git a/genOracleLinux.sh b/genOracleLinux.sh index 158ed5236..5edc4c2ae 100755 --- a/genOracleLinux.sh +++ b/genOracleLinux.sh @@ -28,15 +28,15 @@ SERVER_VERSION_FULL["5.7"]="${VERSION_SERVER_57}-${VERSION_DOCKER}" SERVER_VERSION_FULL["8.0"]="${VERSION_SERVER_80}-${VERSION_DOCKER}" declare -A PACKAGE_URL -PACKAGE_URL["5.5"]="https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.58-2.el7.x86_64.rpm" -PACKAGE_URL["5.6"]="https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.38-2.el7.x86_64.rpm" -PACKAGE_URL["5.7"]="https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.20-1.el7.x86_64.rpm" +PACKAGE_URL["5.5"]="https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.59-2.el7.x86_64.rpm" +PACKAGE_URL["5.6"]="https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.39-2.el7.x86_64.rpm" +PACKAGE_URL["5.7"]="https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.21-1.el7.x86_64.rpm" PACKAGE_URL["8.0"]="https://repo.mysql.com/yum/mysql-8.0-community/docker/x86_64/mysql-community-server-minimal-8.0.3-0.1.rc.el7.x86_64.rpm" declare -A PACKAGE_URL_SHELL PACKAGE_URL_SHELL["5.5"]="\"\"" PACKAGE_URL_SHELL["5.6"]="\"\"" -PACKAGE_URL_SHELL["5.7"]="https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/mysql-shell-1.0.10-1.el7.x86_64.rpm" +PACKAGE_URL_SHELL["5.7"]="https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/mysql-shell-1.0.11-1.el7.x86_64.rpm" PACKAGE_URL_SHELL["8.0"]="https://repo.mysql.com/yum/mysql-tools-preview/el/7/x86_64/mysql-shell-8.0.3-0.1.dmr.el7.x86_64.rpm" # 33060 is the default port for the mysqlx plugin, new to 5.7 From a2c1c1b4d9081c82a9000916cda0ee1c09db1538 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Wed, 24 Jan 2018 09:45:08 +0100 Subject: [PATCH 132/386] Bumped 8.0 server version --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index b96f5543c..327802e3e 100644 --- a/VERSION +++ b/VERSION @@ -2,6 +2,6 @@ VERSION_DOCKER=1.1.3 VERSION_SERVER_55=5.5.59 VERSION_SERVER_56=5.6.39 VERSION_SERVER_57=5.7.21 -VERSION_SERVER_80=8.0.3 +VERSION_SERVER_80=8.0.4 VERSION_SHELL_10=1.0.11 VERSION_SHELL_80=8.0.3 From 6398fa614aa68e3ae614d51f9634aaad8f740deb Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 24 Jan 2018 10:14:57 +0100 Subject: [PATCH 133/386] 1.1.4 release --- 5.5/docker-entrypoint.sh | 4 ++-- 5.6/docker-entrypoint.sh | 4 ++-- 5.7/docker-entrypoint.sh | 4 ++-- 8.0/Dockerfile | 2 +- 8.0/docker-entrypoint.sh | 4 ++-- VERSION | 2 +- changelog | 3 +++ genOracleLinux.sh | 2 +- 8 files changed, 14 insertions(+), 11 deletions(-) diff --git a/5.5/docker-entrypoint.sh b/5.5/docker-entrypoint.sh index fd49410c3..0411e1531 100755 --- a/5.5/docker-entrypoint.sh +++ b/5.5/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.5.59-1.1.3" +echo "[Entrypoint] MySQL Docker Image 5.5.59-1.1.4" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.5.59-1.1.3" + echo "[Entrypoint] Starting MySQL 5.5.59-1.1.4" fi exec "$@" diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index c3ce49885..82e0415db 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.6.39-1.1.3" +echo "[Entrypoint] MySQL Docker Image 5.6.39-1.1.4" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.6.39-1.1.3" + echo "[Entrypoint] Starting MySQL 5.6.39-1.1.4" fi exec "$@" diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 5253fca8a..d1bc165ff 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.21-1.1.3" +echo "[Entrypoint] MySQL Docker Image 5.7.21-1.1.4" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.7.21-1.1.3" + echo "[Entrypoint] Starting MySQL 5.7.21-1.1.4" fi exec "$@" diff --git a/8.0/Dockerfile b/8.0/Dockerfile index e4e9c69e6..a62088981 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -14,7 +14,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG PACKAGE_URL=https://repo.mysql.com/yum/mysql-8.0-community/docker/x86_64/mysql-community-server-minimal-8.0.3-0.1.rc.el7.x86_64.rpm +ARG PACKAGE_URL=https://repo.mysql.com/yum/mysql-8.0-community/docker/x86_64/mysql-community-server-minimal-8.0.4-0.1.rc.el7.x86_64.rpm ARG PACKAGE_URL_SHELL=https://repo.mysql.com/yum/mysql-tools-preview/el/7/x86_64/mysql-shell-8.0.3-0.1.dmr.el7.x86_64.rpm # Install server diff --git a/8.0/docker-entrypoint.sh b/8.0/docker-entrypoint.sh index 3a08f02d5..f3b23ea03 100755 --- a/8.0/docker-entrypoint.sh +++ b/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.3-1.1.3" +echo "[Entrypoint] MySQL Docker Image 8.0.4-1.1.4" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 8.0.3-1.1.3" + echo "[Entrypoint] Starting MySQL 8.0.4-1.1.4" fi exec "$@" diff --git a/VERSION b/VERSION index 327802e3e..6ccd0098a 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ -VERSION_DOCKER=1.1.3 +VERSION_DOCKER=1.1.4 VERSION_SERVER_55=5.5.59 VERSION_SERVER_56=5.6.39 VERSION_SERVER_57=5.7.21 diff --git a/changelog b/changelog index 6b03a242e..191e59fb2 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,6 @@ +Changes in 1.1.4 (2018-01-24) + * MySQL Server 8.0 updated to 8.0.4-rc + Changes in 1.1.3 (2018-01-15) * Bumped server versions to 5.5.59, 5.6.39, 5.7.21 * Bumped Shell 1.0 version to 1.0.11 diff --git a/genOracleLinux.sh b/genOracleLinux.sh index 5edc4c2ae..2381ff0c1 100755 --- a/genOracleLinux.sh +++ b/genOracleLinux.sh @@ -31,7 +31,7 @@ declare -A PACKAGE_URL PACKAGE_URL["5.5"]="https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.59-2.el7.x86_64.rpm" PACKAGE_URL["5.6"]="https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.39-2.el7.x86_64.rpm" PACKAGE_URL["5.7"]="https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.21-1.el7.x86_64.rpm" -PACKAGE_URL["8.0"]="https://repo.mysql.com/yum/mysql-8.0-community/docker/x86_64/mysql-community-server-minimal-8.0.3-0.1.rc.el7.x86_64.rpm" +PACKAGE_URL["8.0"]="https://repo.mysql.com/yum/mysql-8.0-community/docker/x86_64/mysql-community-server-minimal-8.0.4-0.1.rc.el7.x86_64.rpm" declare -A PACKAGE_URL_SHELL PACKAGE_URL_SHELL["5.5"]="\"\"" From a54341511e0b32e60dbd2e1281055c0900c84d56 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 27 Feb 2018 11:40:19 +0100 Subject: [PATCH 134/386] Bumped versions --- VERSION | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/VERSION b/VERSION index 6ccd0098a..70587a91b 100644 --- a/VERSION +++ b/VERSION @@ -1,7 +1,7 @@ -VERSION_DOCKER=1.1.4 -VERSION_SERVER_55=5.5.59 -VERSION_SERVER_56=5.6.39 -VERSION_SERVER_57=5.7.21 -VERSION_SERVER_80=8.0.4 +VERSION_DOCKER=1.1.5 +VERSION_SERVER_55=5.5.60 +VERSION_SERVER_56=5.6.40 +VERSION_SERVER_57=5.7.22 +VERSION_SERVER_80=8.0.5 VERSION_SHELL_10=1.0.11 VERSION_SHELL_80=8.0.3 From 336a946c17e81d841a9382c7d70c41292c605276 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Mon, 19 Mar 2018 07:47:20 +0100 Subject: [PATCH 135/386] Bump server version 8.0.11 To get all products in sync the server version was changed from 8.0.5 to 8.0.11 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 70587a91b..181c0e609 100644 --- a/VERSION +++ b/VERSION @@ -2,6 +2,6 @@ VERSION_DOCKER=1.1.5 VERSION_SERVER_55=5.5.60 VERSION_SERVER_56=5.6.40 VERSION_SERVER_57=5.7.22 -VERSION_SERVER_80=8.0.5 +VERSION_SERVER_80=8.0.11 VERSION_SHELL_10=1.0.11 VERSION_SHELL_80=8.0.3 From f5bbba9b8eb5bd7c4602f9e53f5e36dd2691935f Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Mon, 9 Apr 2018 10:25:15 +0200 Subject: [PATCH 136/386] Bump shell version to 8.0.11 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 181c0e609..61dfadb9e 100644 --- a/VERSION +++ b/VERSION @@ -4,4 +4,4 @@ VERSION_SERVER_56=5.6.40 VERSION_SERVER_57=5.7.22 VERSION_SERVER_80=8.0.11 VERSION_SHELL_10=1.0.11 -VERSION_SHELL_80=8.0.3 +VERSION_SHELL_80=8.0.11 From 6c4a6defc2f74a0b4b5eb54847f849463b92d5bb Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Thu, 19 Apr 2018 07:20:36 +0200 Subject: [PATCH 137/386] 1.1.5 release --- 5.5/Dockerfile | 2 +- 5.5/docker-entrypoint.sh | 4 ++-- 5.6/Dockerfile | 2 +- 5.6/docker-entrypoint.sh | 4 ++-- 5.7/Dockerfile | 2 +- 5.7/docker-entrypoint.sh | 4 ++-- 8.0/Dockerfile | 4 ++-- 8.0/docker-entrypoint.sh | 4 ++-- changelog | 5 +++++ genOracleLinux.sh | 10 +++++----- scripts/build.sh | 3 ++- 11 files changed, 25 insertions(+), 19 deletions(-) diff --git a/5.5/Dockerfile b/5.5/Dockerfile index a50186a12..899f87e2b 100644 --- a/5.5/Dockerfile +++ b/5.5/Dockerfile @@ -14,7 +14,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG PACKAGE_URL=https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.59-2.el7.x86_64.rpm +ARG PACKAGE_URL=https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.60-2.el7.x86_64.rpm ARG PACKAGE_URL_SHELL="" # Install server diff --git a/5.5/docker-entrypoint.sh b/5.5/docker-entrypoint.sh index 0411e1531..1a68051ea 100755 --- a/5.5/docker-entrypoint.sh +++ b/5.5/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.5.59-1.1.4" +echo "[Entrypoint] MySQL Docker Image 5.5.60-1.1.5" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.5.59-1.1.4" + echo "[Entrypoint] Starting MySQL 5.5.60-1.1.5" fi exec "$@" diff --git a/5.6/Dockerfile b/5.6/Dockerfile index ef7001e8d..7bc052f0e 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -14,7 +14,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG PACKAGE_URL=https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.39-2.el7.x86_64.rpm +ARG PACKAGE_URL=https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.40-2.el7.x86_64.rpm ARG PACKAGE_URL_SHELL="" # Install server diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index 82e0415db..23a15ca0c 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.6.39-1.1.4" +echo "[Entrypoint] MySQL Docker Image 5.6.40-1.1.5" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.6.39-1.1.4" + echo "[Entrypoint] Starting MySQL 5.6.40-1.1.5" fi exec "$@" diff --git a/5.7/Dockerfile b/5.7/Dockerfile index a6f58e642..a78c2c025 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -14,7 +14,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG PACKAGE_URL=https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.21-1.el7.x86_64.rpm +ARG PACKAGE_URL=https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.22-1.el7.x86_64.rpm ARG PACKAGE_URL_SHELL=https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/mysql-shell-1.0.11-1.el7.x86_64.rpm # Install server diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index d1bc165ff..1521c79ac 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.21-1.1.4" +echo "[Entrypoint] MySQL Docker Image 5.7.22-1.1.5" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.7.21-1.1.4" + echo "[Entrypoint] Starting MySQL 5.7.22-1.1.5" fi exec "$@" diff --git a/8.0/Dockerfile b/8.0/Dockerfile index a62088981..8f7bbab8f 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG PACKAGE_URL=https://repo.mysql.com/yum/mysql-8.0-community/docker/x86_64/mysql-community-server-minimal-8.0.4-0.1.rc.el7.x86_64.rpm -ARG PACKAGE_URL_SHELL=https://repo.mysql.com/yum/mysql-tools-preview/el/7/x86_64/mysql-shell-8.0.3-0.1.dmr.el7.x86_64.rpm +ARG PACKAGE_URL=https://repo.mysql.com/yum/mysql-8.0-community/docker/x86_64/mysql-community-server-minimal-8.0.11-1.el7.x86_64.rpm +ARG PACKAGE_URL_SHELL=https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/mysql-shell-8.0.11-1.el7.x86_64.rpm # Install server RUN rpmkeys --import https://repo.mysql.com/RPM-GPG-KEY-mysql \ diff --git a/8.0/docker-entrypoint.sh b/8.0/docker-entrypoint.sh index f3b23ea03..eb2d5dba3 100755 --- a/8.0/docker-entrypoint.sh +++ b/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.4-1.1.4" +echo "[Entrypoint] MySQL Docker Image 8.0.11-1.1.5" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 8.0.4-1.1.4" + echo "[Entrypoint] Starting MySQL 8.0.11-1.1.5" fi exec "$@" diff --git a/changelog b/changelog index 191e59fb2..6730d35c6 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,8 @@ +Changes in 1.1.5 (2018-04-19) + * Bumped server versions to 5.5.60, 5.6.40, 5.7.22 + * MySQL Server 8.0 updated to 8.0.11 + * Bumped Shell 8.0 version to 8.0.11 + Changes in 1.1.4 (2018-01-24) * MySQL Server 8.0 updated to 8.0.4-rc diff --git a/genOracleLinux.sh b/genOracleLinux.sh index 2381ff0c1..45850faa8 100755 --- a/genOracleLinux.sh +++ b/genOracleLinux.sh @@ -28,16 +28,16 @@ SERVER_VERSION_FULL["5.7"]="${VERSION_SERVER_57}-${VERSION_DOCKER}" SERVER_VERSION_FULL["8.0"]="${VERSION_SERVER_80}-${VERSION_DOCKER}" declare -A PACKAGE_URL -PACKAGE_URL["5.5"]="https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.59-2.el7.x86_64.rpm" -PACKAGE_URL["5.6"]="https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.39-2.el7.x86_64.rpm" -PACKAGE_URL["5.7"]="https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.21-1.el7.x86_64.rpm" -PACKAGE_URL["8.0"]="https://repo.mysql.com/yum/mysql-8.0-community/docker/x86_64/mysql-community-server-minimal-8.0.4-0.1.rc.el7.x86_64.rpm" +PACKAGE_URL["5.5"]="https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.60-2.el7.x86_64.rpm" +PACKAGE_URL["5.6"]="https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.40-2.el7.x86_64.rpm" +PACKAGE_URL["5.7"]="https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.22-1.el7.x86_64.rpm" +PACKAGE_URL["8.0"]="https://repo.mysql.com/yum/mysql-8.0-community/docker/x86_64/mysql-community-server-minimal-8.0.11-1.el7.x86_64.rpm" declare -A PACKAGE_URL_SHELL PACKAGE_URL_SHELL["5.5"]="\"\"" PACKAGE_URL_SHELL["5.6"]="\"\"" PACKAGE_URL_SHELL["5.7"]="https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/mysql-shell-1.0.11-1.el7.x86_64.rpm" -PACKAGE_URL_SHELL["8.0"]="https://repo.mysql.com/yum/mysql-tools-preview/el/7/x86_64/mysql-shell-8.0.3-0.1.dmr.el7.x86_64.rpm" +PACKAGE_URL_SHELL["8.0"]="https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/mysql-shell-8.0.11-1.el7.x86_64.rpm" # 33060 is the default port for the mysqlx plugin, new to 5.7 declare -A PORTS diff --git a/scripts/build.sh b/scripts/build.sh index d6e850333..a9a71e279 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -43,7 +43,8 @@ done echo "...Locating shell packages" REPOURL_SHELL_10="https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/" -REPOURL_SHELL_80="https://repo.mysql.com/yum/mysql-tools-preview/el/7/x86_64/" +REPOURL_SHELL_80="https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/" +#REPOURL_SHELL_80="https://repo.mysql.com/yum/mysql-tools-preview/el/7/x86_64/" FILENAME_SHELL_10=$(wget -q -O - $REPOURL_SHELL_10 | grep mysql-shell-$VERSION_SHELL_10 | cut -d \" -f 6 | sort -r | head -1) FILENAME_SHELL_80=$(wget -q -O - $REPOURL_SHELL_80 | grep mysql-shell-$VERSION_SHELL_80 | cut -d \" -f 6 | sort -r | head -1) if [ -z "$FILENAME_SHELL_10" ]; From a15b763c2ca2df12e338142ef096ac89121eaa85 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Fri, 8 Jun 2018 12:20:57 +0200 Subject: [PATCH 138/386] Updated VERSION for server MRU --- VERSION | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/VERSION b/VERSION index 61dfadb9e..90fd6198c 100644 --- a/VERSION +++ b/VERSION @@ -1,7 +1,7 @@ -VERSION_DOCKER=1.1.5 -VERSION_SERVER_55=5.5.60 -VERSION_SERVER_56=5.6.40 -VERSION_SERVER_57=5.7.22 -VERSION_SERVER_80=8.0.11 +VERSION_DOCKER=1.1.6 +VERSION_SERVER_55=5.5.61 +VERSION_SERVER_56=5.6.41 +VERSION_SERVER_57=5.7.23 +VERSION_SERVER_80=8.0.12 VERSION_SHELL_10=1.0.11 VERSION_SHELL_80=8.0.11 From 709939c70863c8351cec59316eb88926af5d1170 Mon Sep 17 00:00:00 2001 From: Robert Neumayer Date: Fri, 2 Mar 2018 15:05:16 +0100 Subject: [PATCH 139/386] Homogenise build process VERSION file containing version numbers of server and shell, this is the only file that should be changed in connection with releases. gen_dockerfiles.sh generates dockerfiles based on VERSION build.sh builds based on dockerfiles Contains some refactoring particularly when it comes to usage of variables and parameters. --- VERSION | 26 +++-- build.sh | 20 ++++ genOracleLinux.sh => gen_dockerfiles.sh | 65 ++++++----- scripts/build.sh | 75 ------------- scripts/test.sh | 139 ------------------------ template/Dockerfile | 6 +- template/docker-entrypoint.sh | 4 +- 7 files changed, 84 insertions(+), 251 deletions(-) create mode 100755 build.sh rename genOracleLinux.sh => gen_dockerfiles.sh (69%) delete mode 100755 scripts/build.sh delete mode 100755 scripts/test.sh diff --git a/VERSION b/VERSION index 90fd6198c..1a15a7778 100644 --- a/VERSION +++ b/VERSION @@ -1,7 +1,19 @@ -VERSION_DOCKER=1.1.6 -VERSION_SERVER_55=5.5.61 -VERSION_SERVER_56=5.6.41 -VERSION_SERVER_57=5.7.23 -VERSION_SERVER_80=8.0.12 -VERSION_SHELL_10=1.0.11 -VERSION_SHELL_80=8.0.11 +IMAGE_VERSION=1.1.6 + +declare -A MYSQL_SERVER_VERSIONS +MYSQL_SERVER_VERSIONS["5.5"]=5.5.61 +MYSQL_SERVER_VERSIONS["5.6"]=5.6.41 +MYSQL_SERVER_VERSIONS["5.7"]=5.7.23 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.12 + +declare -A MYSQL_SHELL_VERSIONS +MYSQL_SHELL_VERSIONS["5.5"]="" +MYSQL_SHELL_VERSIONS["5.6"]="" +MYSQL_SHELL_VERSIONS["5.7"]=1.0.11 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.11 + +declare -A FULL_SERVER_VERSIONS +FULL_SERVER_VERSIONS["5.5"]="${MYSQL_SERVER_VERSIONS["5.5"]}-${IMAGE_VERSION}" +FULL_SERVER_VERSIONS["5.6"]="${MYSQL_SERVER_VERSIONS["5.6"]}-${IMAGE_VERSION}" +FULL_SERVER_VERSIONS["5.7"]="${MYSQL_SERVER_VERSIONS["5.7"]}-${IMAGE_VERSION}" +FULL_SERVER_VERSIONS["8.0"]="${MYSQL_SERVER_VERSIONS["8.0"]}-${IMAGE_VERSION}" diff --git a/build.sh b/build.sh new file mode 100755 index 000000000..e7d722ddb --- /dev/null +++ b/build.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e +source VERSION +for MAJOR_VERSION in "${!MYSQL_SERVER_VERSIONS[@]}"; do + docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$http_proxy --build-arg no_proxy=$no_proxy -t mysql-server:$MAJOR_VERSION $MAJOR_VERSION +done diff --git a/genOracleLinux.sh b/gen_dockerfiles.sh similarity index 69% rename from genOracleLinux.sh rename to gen_dockerfiles.sh index 45850faa8..b7b46e235 100755 --- a/genOracleLinux.sh +++ b/gen_dockerfiles.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -14,30 +14,34 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +function get_full_filename() { + FILEPATH=$1 + PACKAGE_STRING=$2 + FILENAME=$(curl -s $FILEPATH/ | grep $PACKAGE_STRING | sed -e 's/.*href=\"//i' -e 's/\".*//') + if [ -z "$FILENAME" ]; then + echo &< "Unable to locate package for $PACKAGE_STRING. Aborting" + exit 1 + fi + COUNT=$(echo $FILENAME | tr " " "\n" | wc -l) + if [ $COUNT -gt 1 ]; then + echo &<2 "Found multiple file names for package $PACKAGE_STRING. Aborting" + exit 1 + fi + echo $FILENAME +} + # This script will simply use sed to replace placeholder variables in the # files in template/ with version-specific variants. -# Example: mysql_install_db for 5.5 and 5.6, and mysqld --initialize for newer -VERSIONS="5.5 5.6 5.7 8.0" . VERSION -declare -A SERVER_VERSION_FULL -SERVER_VERSION_FULL["5.5"]="${VERSION_SERVER_55}-${VERSION_DOCKER}" -SERVER_VERSION_FULL["5.6"]="${VERSION_SERVER_56}-${VERSION_DOCKER}" -SERVER_VERSION_FULL["5.7"]="${VERSION_SERVER_57}-${VERSION_DOCKER}" -SERVER_VERSION_FULL["8.0"]="${VERSION_SERVER_80}-${VERSION_DOCKER}" - -declare -A PACKAGE_URL -PACKAGE_URL["5.5"]="https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.60-2.el7.x86_64.rpm" -PACKAGE_URL["5.6"]="https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.40-2.el7.x86_64.rpm" -PACKAGE_URL["5.7"]="https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.22-1.el7.x86_64.rpm" -PACKAGE_URL["8.0"]="https://repo.mysql.com/yum/mysql-8.0-community/docker/x86_64/mysql-community-server-minimal-8.0.11-1.el7.x86_64.rpm" - -declare -A PACKAGE_URL_SHELL -PACKAGE_URL_SHELL["5.5"]="\"\"" -PACKAGE_URL_SHELL["5.6"]="\"\"" -PACKAGE_URL_SHELL["5.7"]="https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/mysql-shell-1.0.11-1.el7.x86_64.rpm" -PACKAGE_URL_SHELL["8.0"]="https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/mysql-shell-8.0.11-1.el7.x86_64.rpm" +if [ -z "$1" ]; then + REPO=https://repo.mysql.com +else + REPO=$1 +fi # 33060 is the default port for the mysqlx plugin, new to 5.7 declare -A PORTS @@ -94,11 +98,22 @@ DEFAULT_LOG["5.6"]="" DEFAULT_LOG["5.7"]="" DEFAULT_LOG["8.0"]="console" -for VERSION in ${VERSIONS} + +for VERSION in "${!MYSQL_SHELL_VERSIONS[@]}" do - # Dockerfile - sed 's#%%PACKAGE_URL%%#'"${PACKAGE_URL[${VERSION}]}"'#g' template/Dockerfile > tmpfile - sed -i 's#%%PACKAGE_URL_SHELL%%#'"${PACKAGE_URL_SHELL[${VERSION}]}"'#g' tmpfile + # Dockerfiles + MYSQL_SERVER_REPOPATH=yum/mysql-$VERSION-community/docker/x86_64 + MYSQL_CLUSTER_PACKAGE_URL=$REPO/$MYSQL_SERVER_REPOPATH/$(get_full_filename $REPO/$MYSQL_SERVER_REPOPATH mysql-community-server-minimal-${MYSQL_SERVER_VERSIONS[${VERSION}]}) + sed 's#%%MYSQL_SERVER_PACKAGE_URL%%#'"$MYSQL_CLUSTER_PACKAGE_URL"'#g' template/Dockerfile > tmpfile + + if [[ ! -z ${MYSQL_SHELL_VERSIONS[${VERSION}]} ]]; then + MYSQL_SHELL_REPOPATH=yum/mysql-tools-community/el/7/x86_64 + MYSQL_SHELL_PACKAGE_URL=$REPO/$MYSQL_SHELL_REPOPATH/$(get_full_filename $REPO/$MYSQL_SHELL_REPOPATH mysql-shell-${MYSQL_SHELL_VERSIONS[${VERSION}]}) + sed -i 's#%%MYSQL_SHELL_PACKAGE_URL%%#'"$MYSQL_SHELL_PACKAGE_URL"'#g' tmpfile + else + sed -i 's#%%MYSQL_SHELL_PACKAGE_URL%%#'""'#g' tmpfile + fi + sed -i 's/%%PORTS%%/'"${PORTS[${VERSION}]}"'/g' tmpfile mv tmpfile ${VERSION}/Dockerfile @@ -109,7 +124,7 @@ do sed -i 's#%%SED_TZINFO%%#'"${TZINFO_WORKAROUND[${VERSION}]}"'#g' tmpfile sed -i 's#%%INIT_STARTUP%%#'"${INIT_STARTUP[${VERSION}]}"'#g' tmpfile sed -i 's#%%STARTUP_WAIT%%#'"${STARTUP_WAIT[${VERSION}]}"'#g' tmpfile - sed -i 's#%%SERVER_VERSION_FULL%%#'"${SERVER_VERSION_FULL[${VERSION}]}"'#g' tmpfile + sed -i 's#%%FULL_SERVER_VERSION%%#'"${FULL_SERVER_VERSIONS[${VERSION}]}"'#g' tmpfile sed -i 's#%%DEFAULT_LOG%%#'"${DEFAULT_LOG[${VERSION}]}"'#g' tmpfile mv tmpfile ${VERSION}/docker-entrypoint.sh chmod +x ${VERSION}/docker-entrypoint.sh diff --git a/scripts/build.sh b/scripts/build.sh deleted file mode 100755 index a9a71e279..000000000 --- a/scripts/build.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash - -set -e - -if [ ! -f "genOracleLinux.sh" ]; then - echo "This script must be run from the base docker source directory" - exit 1 -fi -. VERSION - -echo "Docker image version: $VERSION_DOCKER" -echo "The following server versions will be packaged:" -echo " - $VERSION_SERVER_55" -echo " - $VERSION_SERVER_56" -echo " - $VERSION_SERVER_57" -echo " - $VERSION_SERVER_80" -echo "The following shell versions will be packaged:" -echo " - For 5.7: $VERSION_SHELL_10" -echo " - For 8.0: $VERSION_SHELL_80" -read -p "Is this correct? (y/n) " -n 1 -r -echo -if [[ ! $REPLY =~ ^[Yy]$ ]] -then - echo "Aborting" - exit 0 -fi - -echo "...Locating server packages" - -for VERSION_SERVER in $VERSION_SERVER_55 $VERSION_SERVER_56 $VERSION_SERVER_57 $VERSION_SERVER_80 -do - VERSION_PART=${VERSION_SERVER:0:3} - REPOURL=https://repo.mysql.com/yum/mysql-$VERSION_PART-community/docker/x86_64/ - FILENAME=$(wget -q -O - $REPOURL | grep mysql-community-server-minimal-$VERSION_SERVER | cut -d \" -f 6 | sort -r | head -1) - if [ -z "$FILENAME" ]; - then - echo "Unable to locate server package for $VERSION_SERVER. Aborting" - exit 1 - fi - sed -i "s#^PACKAGE_URL\[\"${VERSION_PART}\"\].*#PACKAGE_URL\[\"${VERSION_PART}\"\]=\"${REPOURL}${FILENAME}\"#" genOracleLinux.sh -done - -echo "...Locating shell packages" - -REPOURL_SHELL_10="https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/" -REPOURL_SHELL_80="https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/" -#REPOURL_SHELL_80="https://repo.mysql.com/yum/mysql-tools-preview/el/7/x86_64/" -FILENAME_SHELL_10=$(wget -q -O - $REPOURL_SHELL_10 | grep mysql-shell-$VERSION_SHELL_10 | cut -d \" -f 6 | sort -r | head -1) -FILENAME_SHELL_80=$(wget -q -O - $REPOURL_SHELL_80 | grep mysql-shell-$VERSION_SHELL_80 | cut -d \" -f 6 | sort -r | head -1) -if [ -z "$FILENAME_SHELL_10" ]; -then - echo "Unable to locate shell package for $VERSION_SHELL_10. Aborting." - exit 1 -fi -if [ -z "$FILENAME_SHELL_80" ]; -then - echo "Unable to locate shell package for $VERSION_SHELL_80. Aborting." - exit 1 -fi -sed -i "s#^PACKAGE_URL_SHELL\[\"5.7\"\].*#PACKAGE_URL_SHELL\[\"5.7\"\]=\"${REPOURL_SHELL_10}${FILENAME_SHELL_10}\"#" genOracleLinux.sh -sed -i "s#^PACKAGE_URL_SHELL\[\"8.0\"\].*#PACKAGE_URL_SHELL\[\"8.0\"\]=\"${REPOURL_SHELL_80}${FILENAME_SHELL_80}\"#" genOracleLinux.sh -echo "...Generating image source" -./genOracleLinux.sh - -echo "...Building Docker images" -for MAJOR_VERSION in 5.5 5.6 5.7 8.0 -do - echo "...$MAJOR_VERSION" - if [ -n "$http_proxy" ] && [ -n "$https_proxy" ]; - then - docker build -t mysql/mysql-server:$MAJOR_VERSION --build-arg http_proxy=$http_proxy --build-arg https_proxy=$https_proxy $MAJOR_VERSION 2>&1>buildlog.txt - else - docker build -t mysql/mysql-server:$MAJOR_VERSION $MAJOR_VERSION 2>&1>buildlog.txt - fi -done diff --git a/scripts/test.sh b/scripts/test.sh deleted file mode 100755 index 3858f01f3..000000000 --- a/scripts/test.sh +++ /dev/null @@ -1,139 +0,0 @@ -#!/bin/bash - -if [ ! -f "genOracleLinux.sh" ]; then - echo "This script must be run from the base docker source directory" - exit 1 -fi -. VERSION - -echo "...Starting images" - -docker run -d --rm --name=mysqlserver55 --health-interval=5s -e MYSQL_ROOT_PASSWORD=rot mysql/mysql-server:5.5 > /dev/null -docker run -d --rm --name=mysqlserver56 --health-interval=5s -e MYSQL_ROOT_PASSWORD=rot mysql/mysql-server:5.6 > /dev/null -docker run -d --rm --name=mysqlserver57 --health-interval=5s -e MYSQL_ROOT_PASSWORD=rot mysql/mysql-server:5.7 > /dev/null -docker run -d --rm --name=mysqlserver80 --health-interval=5s -e MYSQL_ROOT_PASSWORD=rot mysql/mysql-server:8.0 > /dev/null - -echo "...Waiting for health checks" -for i in {1..12} -do - echo "." - sleep 5 - if [ -z "$STATUS55" ]; - then - if docker ps | grep mysqlserver55 | grep healthy | grep -v unhealthy > /dev/null; then - echo "...MySQL 5.5 Image Started" - if docker logs mysqlserver55 2>&1 | grep "MySQL Docker Image $VERSION_SERVER_55-$VERSION_DOCKER" > /dev/null; then - RESPONSE=$(docker exec mysqlserver55 mysql -uroot -prot -e "SELECT VERSION();" 2>&1) - if [[ "$RESPONSE" =~ "$VERSION_SERVER_55" ]]; - then - echo "...MySQL $VERSION_SERVER_55 OK" - STATUS55="OK" - else - echo "...Unexpected response from 5.5: $RESPONSE" - STATUS55=$RESPONSE - exit 1 - fi - else - echo "...Bad Docker script version" - STATUS55="Incorrect Docker script version" - fi - fi - fi - if [ -z "$STATUS56" ]; - then - if docker ps | grep mysqlserver56 | grep healthy | grep -v unhealthy > /dev/null; then - echo "...MySQL 5.6 Image Started" - if docker logs mysqlserver56 2>&1 | grep "MySQL Docker Image $VERSION_SERVER_56-$VERSION_DOCKER" > /dev/null; then - RESPONSE=$(docker exec mysqlserver56 mysql -uroot -prot -e "SELECT VERSION();" 2>&1) - if [[ "$RESPONSE" =~ "$VERSION_SERVER_56" ]]; - then - echo "...MySQL $VERSION_SERVER_56 OK" - STATUS56="OK" - else - echo "...Unexpected response from 5.6: $RESPONSE" - STATUS56=$RESPONSE - exit 1 - fi - else - echo "...Bad Docker script version" - STATUS56="Incorrect Docker script version" - fi - fi - fi - if [ -z "$STATUS57" ]; - then - if docker ps | grep mysqlserver57 | grep healthy | grep -v unhealthy > /dev/null; then - echo "...MySQL 5.7 Image Started" - if docker logs mysqlserver57 2>&1 | grep "MySQL Docker Image $VERSION_SERVER_57-$VERSION_DOCKER" > /dev/null; then - RESPONSE=$(docker exec mysqlserver57 mysql -uroot -prot -e "SELECT VERSION();" 2>&1) - if [[ "$RESPONSE" =~ "$VERSION_SERVER_57" ]]; - then - echo "...MySQL $VERSION_SERVER_57 OK" - RESPONSE=$(docker exec mysqlserver57 mysqlsh --version) - if [[ "$RESPONSE" =~ "$VERSION_SHELL_10" ]]; - then - echo "...Shell $VERSION_SHELL_10 OK" - STATUS57="OK" - else - echo "...Bad Shell version in 5.7 image" - STATUS57="$RESPONSE" - fi - else - echo "...Unexpected response from 5.7: $RESPONSE" - STATUS57=$RESPONSE - exit 1 - fi - else - echo "...Bad Docker script version" - STATUS57="Incorrect Docker script version" - fi - fi - fi - if [ -z "$STATUS80" ]; - then - if docker ps | grep mysqlserver80 | grep healthy | grep -v unhealthy > /dev/null; then - echo "...MySQL 8.0 Image Started" - if docker logs mysqlserver80 2>&1 | grep "MySQL Docker Image $VERSION_SERVER_80-$VERSION_DOCKER" > /dev/null; then - RESPONSE=$(docker exec mysqlserver80 mysql -uroot -prot -e "SELECT VERSION();" 2>&1) - if [[ "$RESPONSE" =~ "$VERSION_SERVER_80" ]]; - then - echo "...MySQL $VERSION_SERVER_80 OK" - RESPONSE=$(docker exec mysqlserver80 mysqlsh --version) - if [[ "$RESPONSE" =~ "$VERSION_SHELL_80" ]]; - then - echo "...Shell $VERSION_SHELL_80 OK" - STATUS80="OK" - else - echo "...Bad Shell version in 5.7 image" - STATUS80="$RESPONSE" - fi - STATUS80="OK" - else - echo "...Unexpected response from 8.0: $RESPONSE" - STATUS80=$RESPONSE - exit 1 - fi - else - echo "...Bad Docker script version" - STATUS80="Incorrect Docker script version" - fi - fi - fi - if [ -n "$STATUS55" ] && [ -n "$STATUS56" ] && [ -n "$STATUS57" ] && [ -n "$STATUS80" ];then - break - fi -done - -echo "...Tests complete" -if [ "$STATUS55" = "OK" ] && [ "$STATUS56" = "OK" ] && [ "$STATUS57" = "OK" ] && [ "$STATUS80" = "OK" ]; -then - echo "...All tests OK. Cleaning up containers." - docker kill mysqlserver55 mysqlserver56 mysqlserver57 mysqlserver80 > /dev/null - exit 0 -fi - -echo "... There were test failures. Containers not removed." -echo "5.5: $STATUS55" -echo "5.6: $STATUS56" -echo "5.7: $STATUS57" -echo "8.0: $STATUS80" diff --git a/template/Dockerfile b/template/Dockerfile index 0a594e4ac..c9a0c9a50 100644 --- a/template/Dockerfile +++ b/template/Dockerfile @@ -14,12 +14,12 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG PACKAGE_URL=%%PACKAGE_URL%% -ARG PACKAGE_URL_SHELL=%%PACKAGE_URL_SHELL%% +ARG MYSQL_SERVER_PACKAGE_URL=%%MYSQL_SERVER_PACKAGE_URL%% +ARG MYSQL_SHELL_PACKAGE_URL=%%MYSQL_SHELL_PACKAGE_URL%% # Install server RUN rpmkeys --import https://repo.mysql.com/RPM-GPG-KEY-mysql \ - && yum install -y $PACKAGE_URL $PACKAGE_URL_SHELL libpwquality \ + && yum install -y $MYSQL_SERVER_PACKAGE_URL $MYSQL_SHELL_PACKAGE_URL libpwquality \ && yum clean all \ && mkdir /docker-entrypoint-initdb.d diff --git a/template/docker-entrypoint.sh b/template/docker-entrypoint.sh index 33b063099..806f213ba 100644 --- a/template/docker-entrypoint.sh +++ b/template/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image %%SERVER_VERSION_FULL%%" +echo "[Entrypoint] MySQL Docker Image %%FULL_SERVER_VERSION%%" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL %%SERVER_VERSION_FULL%%" + echo "[Entrypoint] Starting MySQL %%FULL_SERVER_VERSION%%" fi exec "$@" From 8e8a22d1f78c47ac6d80ba0636de04fa34116e55 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Sun, 29 Jul 2018 11:35:50 +0200 Subject: [PATCH 140/386] 1.1.6 release - 5.5.61 - 5.6.41 - 5.7.23 - 8.0.12 --- 5.5/Dockerfile | 6 +++--- 5.5/docker-entrypoint.sh | 4 ++-- 5.6/Dockerfile | 6 +++--- 5.6/docker-entrypoint.sh | 4 ++-- 5.7/Dockerfile | 6 +++--- 5.7/docker-entrypoint.sh | 4 ++-- 8.0/Dockerfile | 6 +++--- 8.0/docker-entrypoint.sh | 4 ++-- build.sh | 2 +- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/5.5/Dockerfile b/5.5/Dockerfile index 899f87e2b..7b33c692d 100644 --- a/5.5/Dockerfile +++ b/5.5/Dockerfile @@ -14,12 +14,12 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG PACKAGE_URL=https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.60-2.el7.x86_64.rpm -ARG PACKAGE_URL_SHELL="" +ARG MYSQL_SERVER_PACKAGE_URL=https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.61-2.el7.x86_64.rpm +ARG MYSQL_SHELL_PACKAGE_URL= # Install server RUN rpmkeys --import https://repo.mysql.com/RPM-GPG-KEY-mysql \ - && yum install -y $PACKAGE_URL $PACKAGE_URL_SHELL libpwquality \ + && yum install -y $MYSQL_SERVER_PACKAGE_URL $MYSQL_SHELL_PACKAGE_URL libpwquality \ && yum clean all \ && mkdir /docker-entrypoint-initdb.d diff --git a/5.5/docker-entrypoint.sh b/5.5/docker-entrypoint.sh index 1a68051ea..261df51a9 100755 --- a/5.5/docker-entrypoint.sh +++ b/5.5/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.5.60-1.1.5" +echo "[Entrypoint] MySQL Docker Image 5.5.61-1.1.6" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.5.60-1.1.5" + echo "[Entrypoint] Starting MySQL 5.5.61-1.1.6" fi exec "$@" diff --git a/5.6/Dockerfile b/5.6/Dockerfile index 7bc052f0e..89b27ab62 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -14,12 +14,12 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG PACKAGE_URL=https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.40-2.el7.x86_64.rpm -ARG PACKAGE_URL_SHELL="" +ARG MYSQL_SERVER_PACKAGE_URL=https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.41-2.el7.x86_64.rpm +ARG MYSQL_SHELL_PACKAGE_URL= # Install server RUN rpmkeys --import https://repo.mysql.com/RPM-GPG-KEY-mysql \ - && yum install -y $PACKAGE_URL $PACKAGE_URL_SHELL libpwquality \ + && yum install -y $MYSQL_SERVER_PACKAGE_URL $MYSQL_SHELL_PACKAGE_URL libpwquality \ && yum clean all \ && mkdir /docker-entrypoint-initdb.d diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index 23a15ca0c..57fb31a5f 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.6.40-1.1.5" +echo "[Entrypoint] MySQL Docker Image 5.6.41-1.1.6" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.6.40-1.1.5" + echo "[Entrypoint] Starting MySQL 5.6.41-1.1.6" fi exec "$@" diff --git a/5.7/Dockerfile b/5.7/Dockerfile index a78c2c025..47a5af287 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -14,12 +14,12 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG PACKAGE_URL=https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.22-1.el7.x86_64.rpm -ARG PACKAGE_URL_SHELL=https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/mysql-shell-1.0.11-1.el7.x86_64.rpm +ARG MYSQL_SERVER_PACKAGE_URL=https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.23-1.el7.x86_64.rpm +ARG MYSQL_SHELL_PACKAGE_URL=https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/mysql-shell-1.0.11-1.el7.x86_64.rpm # Install server RUN rpmkeys --import https://repo.mysql.com/RPM-GPG-KEY-mysql \ - && yum install -y $PACKAGE_URL $PACKAGE_URL_SHELL libpwquality \ + && yum install -y $MYSQL_SERVER_PACKAGE_URL $MYSQL_SHELL_PACKAGE_URL libpwquality \ && yum clean all \ && mkdir /docker-entrypoint-initdb.d diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 1521c79ac..56285e3fa 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.22-1.1.5" +echo "[Entrypoint] MySQL Docker Image 5.7.23-1.1.6" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.7.22-1.1.5" + echo "[Entrypoint] Starting MySQL 5.7.23-1.1.6" fi exec "$@" diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 8f7bbab8f..0d5f91b41 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -14,12 +14,12 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG PACKAGE_URL=https://repo.mysql.com/yum/mysql-8.0-community/docker/x86_64/mysql-community-server-minimal-8.0.11-1.el7.x86_64.rpm -ARG PACKAGE_URL_SHELL=https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/mysql-shell-8.0.11-1.el7.x86_64.rpm +ARG MYSQL_SERVER_PACKAGE_URL=https://repo.mysql.com/yum/mysql-8.0-community/docker/x86_64/mysql-community-server-minimal-8.0.12-1.el7.x86_64.rpm +ARG MYSQL_SHELL_PACKAGE_URL=https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/mysql-shell-8.0.12-1.el7.x86_64.rpm # Install server RUN rpmkeys --import https://repo.mysql.com/RPM-GPG-KEY-mysql \ - && yum install -y $PACKAGE_URL $PACKAGE_URL_SHELL libpwquality \ + && yum install -y $MYSQL_SERVER_PACKAGE_URL $MYSQL_SHELL_PACKAGE_URL libpwquality \ && yum clean all \ && mkdir /docker-entrypoint-initdb.d diff --git a/8.0/docker-entrypoint.sh b/8.0/docker-entrypoint.sh index eb2d5dba3..d12c24514 100755 --- a/8.0/docker-entrypoint.sh +++ b/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.11-1.1.5" +echo "[Entrypoint] MySQL Docker Image 8.0.12-1.1.6" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 8.0.11-1.1.5" + echo "[Entrypoint] Starting MySQL 8.0.12-1.1.6" fi exec "$@" diff --git a/build.sh b/build.sh index e7d722ddb..3646b2775 100755 --- a/build.sh +++ b/build.sh @@ -16,5 +16,5 @@ set -e source VERSION for MAJOR_VERSION in "${!MYSQL_SERVER_VERSIONS[@]}"; do - docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$http_proxy --build-arg no_proxy=$no_proxy -t mysql-server:$MAJOR_VERSION $MAJOR_VERSION + docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$http_proxy --build-arg no_proxy=$no_proxy -t mysql/mysql-server:$MAJOR_VERSION $MAJOR_VERSION done From cda77e68171ea591c773bf9c99953f40dbbb979a Mon Sep 17 00:00:00 2001 From: Robert Neumayer Date: Tue, 24 Jul 2018 12:08:06 +0200 Subject: [PATCH 141/386] Add inspec tests --- gen_dockerfiles.sh | 13 +++++++++++++ template/control.rb | 24 ++++++++++++++++++++++++ template/control_pre57.rb | 17 +++++++++++++++++ test.sh | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 87 insertions(+) create mode 100644 template/control.rb create mode 100644 template/control_pre57.rb create mode 100755 test.sh diff --git a/gen_dockerfiles.sh b/gen_dockerfiles.sh index b7b46e235..42dd9857e 100755 --- a/gen_dockerfiles.sh +++ b/gen_dockerfiles.sh @@ -117,6 +117,19 @@ do sed -i 's/%%PORTS%%/'"${PORTS[${VERSION}]}"'/g' tmpfile mv tmpfile ${VERSION}/Dockerfile + # Dockerfile_spec.rb + if [ ! -d "${VERSION}/inspec" ]; then + mkdir "${VERSION}/inspec" + fi + if [ "${VERSION}" == "5.7" ] || [ "${VERSION}" == "8.0" ]; then + sed 's#%%MYSQL_SERVER_PACKAGE_VERSION%%#'"${MYSQL_SERVER_VERSIONS[${VERSION}]}"'#g' template/control.rb > tmpFile + sed -i 's#%%MYSQL_SHELL_PACKAGE_VERSION%%#'"${MYSQL_SHELL_VERSIONS[${VERSION}]}"'#g' tmpFile + mv tmpFile "${VERSION}/inspec/control.rb" + else + sed 's#%%MYSQL_SERVER_PACKAGE_VERSION%%#'"${MYSQL_SERVER_VERSIONS[${VERSION}]}"'#g' template/control_pre57.rb > tmpFile + mv tmpFile "${VERSION}/inspec/control.rb" + fi + # Entrypoint sed 's#%%PASSWORDSET%%#'"${PASSWORDSET[${VERSION}]}"'#g' template/docker-entrypoint.sh > tmpfile sed -i 's#%%DATABASE_INIT%%#'"${DATABASE_INIT[${VERSION}]}"'#g' tmpfile diff --git a/template/control.rb b/template/control.rb new file mode 100644 index 000000000..8c8d823a2 --- /dev/null +++ b/template/control.rb @@ -0,0 +1,24 @@ +control 'container' do + impact 0.5 + describe docker_container('mysql-server') do + it { should exist } + it { should be_running } + its('repo') { should eq 'mysql/mysql-server' } + its('ports') { should eq '3306/tcp, 33060/tcp' } + its('command') { should match '/entrypoint.sh mysqld' } + end +end +control 'server-package' do + impact 0.5 + describe package('mysql-community-server-minimal') do + it { should be_installed } + its ('version') { should match '%%MYSQL_SERVER_PACKAGE_VERSION%%.*' } + end +end +control 'shell-package' do + impact 0.5 + describe package('mysql-shell') do + it { should be_installed } + its ('version') { should match '%%MYSQL_SHELL_PACKAGE_VERSION%%.*' } + end +end diff --git a/template/control_pre57.rb b/template/control_pre57.rb new file mode 100644 index 000000000..f08a1dfb8 --- /dev/null +++ b/template/control_pre57.rb @@ -0,0 +1,17 @@ +control 'container' do + impact 0.5 + describe docker_container('mysql-server') do + it { should exist } + it { should be_running } + its('repo') { should eq 'mysql/mysql-server' } + its('ports') { should eq '3306/tcp' } + its('command') { should match '/entrypoint.sh mysqld' } + end +end +control 'server-package' do + impact 0.5 + describe package('mysql-community-server-minimal') do + it { should be_installed } + its ('version') { should match '%%MYSQL_SERVER_PACKAGE_VERSION%%.*' } + end +end diff --git a/test.sh b/test.sh new file mode 100755 index 000000000..1ac3c0aae --- /dev/null +++ b/test.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# This script will simply use sed to replace placeholder variables in the +# files in template/ with version-specific variants. + +set -e +source VERSION + +for MAJOR_VERSION in "${!MYSQL_SERVER_VERSIONS[@]}" +do + docker run -d --name mysql-server mysql/mysql-server:$MAJOR_VERSION + inspec exec $MAJOR_VERSION/inspec/control.rb --controls container + inspec exec $MAJOR_VERSION/inspec/control.rb -t docker://mysql-server --controls server-package + if [ "${MAJOR_VERSION}" == "5.7" ] || [ "${MAJOR_VERSION}" == "8.0" ]; then + inspec exec $MAJOR_VERSION/inspec/control.rb -t docker://mysql-server --controls shell-package + fi + docker stop mysql-server + docker rm mysql-server +done From 4b6d4cf55f7a05e7e922c64c18e7021aa34fa8a1 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Thu, 9 Aug 2018 07:24:27 +0200 Subject: [PATCH 142/386] Update shell versions to 8.0.12 for both 5.7 and 8.0 images Bump image version to 1.1.7 --- VERSION | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index 1a15a7778..c01a9db22 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.1.6 +IMAGE_VERSION=1.1.7 declare -A MYSQL_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["5.5"]=5.5.61 @@ -9,8 +9,8 @@ MYSQL_SERVER_VERSIONS["8.0"]=8.0.12 declare -A MYSQL_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["5.5"]="" MYSQL_SHELL_VERSIONS["5.6"]="" -MYSQL_SHELL_VERSIONS["5.7"]=1.0.11 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.11 +MYSQL_SHELL_VERSIONS["5.7"]=8.0.12 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.12 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["5.5"]="${MYSQL_SERVER_VERSIONS["5.5"]}-${IMAGE_VERSION}" From e2e97fd6a6435172f08a1cc0cc1090ea25757eaa Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Thu, 9 Aug 2018 10:44:17 +0200 Subject: [PATCH 143/386] 1.1.7 release Shell version for 5.7 image bumped to 8.0.12 --- 5.5/docker-entrypoint.sh | 4 ++-- 5.6/docker-entrypoint.sh | 4 ++-- 5.7/Dockerfile | 2 +- 5.7/docker-entrypoint.sh | 4 ++-- 8.0/docker-entrypoint.sh | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/5.5/docker-entrypoint.sh b/5.5/docker-entrypoint.sh index 261df51a9..41bea3239 100755 --- a/5.5/docker-entrypoint.sh +++ b/5.5/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.5.61-1.1.6" +echo "[Entrypoint] MySQL Docker Image 5.5.61-1.1.7" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.5.61-1.1.6" + echo "[Entrypoint] Starting MySQL 5.5.61-1.1.7" fi exec "$@" diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index 57fb31a5f..6c6762e35 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.6.41-1.1.6" +echo "[Entrypoint] MySQL Docker Image 5.6.41-1.1.7" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.6.41-1.1.6" + echo "[Entrypoint] Starting MySQL 5.6.41-1.1.7" fi exec "$@" diff --git a/5.7/Dockerfile b/5.7/Dockerfile index 47a5af287..8cdc46a87 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -15,7 +15,7 @@ FROM oraclelinux:7-slim ARG MYSQL_SERVER_PACKAGE_URL=https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.23-1.el7.x86_64.rpm -ARG MYSQL_SHELL_PACKAGE_URL=https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/mysql-shell-1.0.11-1.el7.x86_64.rpm +ARG MYSQL_SHELL_PACKAGE_URL=https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/mysql-shell-8.0.12-1.el7.x86_64.rpm # Install server RUN rpmkeys --import https://repo.mysql.com/RPM-GPG-KEY-mysql \ diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 56285e3fa..1a1efd03b 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.23-1.1.6" +echo "[Entrypoint] MySQL Docker Image 5.7.23-1.1.7" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.7.23-1.1.6" + echo "[Entrypoint] Starting MySQL 5.7.23-1.1.7" fi exec "$@" diff --git a/8.0/docker-entrypoint.sh b/8.0/docker-entrypoint.sh index d12c24514..1e2edb3d8 100755 --- a/8.0/docker-entrypoint.sh +++ b/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.12-1.1.6" +echo "[Entrypoint] MySQL Docker Image 8.0.12-1.1.7" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 8.0.12-1.1.6" + echo "[Entrypoint] Starting MySQL 8.0.12-1.1.7" fi exec "$@" From 0917f70c15e4c71b6c9630cf00e2d3a78a12ca06 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Thu, 30 Aug 2018 14:05:03 +0200 Subject: [PATCH 144/386] Bump image version and server 5.6.42 and 5.7.24 --- VERSION | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index c01a9db22..4e96d89a5 100644 --- a/VERSION +++ b/VERSION @@ -1,9 +1,9 @@ -IMAGE_VERSION=1.1.7 +IMAGE_VERSION=1.1.8 declare -A MYSQL_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["5.5"]=5.5.61 -MYSQL_SERVER_VERSIONS["5.6"]=5.6.41 -MYSQL_SERVER_VERSIONS["5.7"]=5.7.23 +MYSQL_SERVER_VERSIONS["5.6"]=5.6.42 +MYSQL_SERVER_VERSIONS["5.7"]=5.7.24 MYSQL_SERVER_VERSIONS["8.0"]=8.0.12 declare -A MYSQL_SHELL_VERSIONS From 3ce2d910b0cba94554e4e525580b20353ecf5cd0 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Fri, 31 Aug 2018 07:23:13 +0200 Subject: [PATCH 145/386] Bump 5.5 server version to 5.5.62 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 4e96d89a5..ec64c0069 100644 --- a/VERSION +++ b/VERSION @@ -1,7 +1,7 @@ IMAGE_VERSION=1.1.8 declare -A MYSQL_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["5.5"]=5.5.61 +MYSQL_SERVER_VERSIONS["5.5"]=5.5.62 MYSQL_SERVER_VERSIONS["5.6"]=5.6.42 MYSQL_SERVER_VERSIONS["5.7"]=5.7.24 MYSQL_SERVER_VERSIONS["8.0"]=8.0.12 From 1f6d47f44a4c2290b734eb95aa6d1e8082085dc9 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Mon, 10 Sep 2018 17:53:17 +0200 Subject: [PATCH 146/386] Bump server version to 8.0.13 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index ec64c0069..5e794f05b 100644 --- a/VERSION +++ b/VERSION @@ -4,7 +4,7 @@ declare -A MYSQL_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["5.5"]=5.5.62 MYSQL_SERVER_VERSIONS["5.6"]=5.6.42 MYSQL_SERVER_VERSIONS["5.7"]=5.7.24 -MYSQL_SERVER_VERSIONS["8.0"]=8.0.12 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.13 declare -A MYSQL_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["5.5"]="" From f24836cced9803f591867dd9a51dfb4f86335239 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 18 Sep 2018 12:19:39 +0200 Subject: [PATCH 147/386] Bump shell version to 8.0.13 --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 5e794f05b..ee48e300f 100644 --- a/VERSION +++ b/VERSION @@ -9,8 +9,8 @@ MYSQL_SERVER_VERSIONS["8.0"]=8.0.13 declare -A MYSQL_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["5.5"]="" MYSQL_SHELL_VERSIONS["5.6"]="" -MYSQL_SHELL_VERSIONS["5.7"]=8.0.12 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.12 +MYSQL_SHELL_VERSIONS["5.7"]=8.0.13 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.13 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["5.5"]="${MYSQL_SERVER_VERSIONS["5.5"]}-${IMAGE_VERSION}" From 1d53abb900830ceee5d70a1e82287fb954f8d31d Mon Sep 17 00:00:00 2001 From: Robert Neumayer Date: Mon, 10 Sep 2018 10:15:10 +0200 Subject: [PATCH 148/386] Iterate over correct version variable --- gen_dockerfiles.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gen_dockerfiles.sh b/gen_dockerfiles.sh index 42dd9857e..fdde67003 100755 --- a/gen_dockerfiles.sh +++ b/gen_dockerfiles.sh @@ -99,12 +99,12 @@ DEFAULT_LOG["5.7"]="" DEFAULT_LOG["8.0"]="console" -for VERSION in "${!MYSQL_SHELL_VERSIONS[@]}" +for VERSION in "${!MYSQL_SERVER_VERSIONS[@]}" do # Dockerfiles MYSQL_SERVER_REPOPATH=yum/mysql-$VERSION-community/docker/x86_64 - MYSQL_CLUSTER_PACKAGE_URL=$REPO/$MYSQL_SERVER_REPOPATH/$(get_full_filename $REPO/$MYSQL_SERVER_REPOPATH mysql-community-server-minimal-${MYSQL_SERVER_VERSIONS[${VERSION}]}) - sed 's#%%MYSQL_SERVER_PACKAGE_URL%%#'"$MYSQL_CLUSTER_PACKAGE_URL"'#g' template/Dockerfile > tmpfile + MYSQL_SERVER_PACKAGE_URL=$REPO/$MYSQL_SERVER_REPOPATH/$(get_full_filename $REPO/$MYSQL_SERVER_REPOPATH mysql-community-server-minimal-${MYSQL_SERVER_VERSIONS[${VERSION}]}) + sed 's#%%MYSQL_SERVER_PACKAGE_URL%%#'"$MYSQL_SERVER_PACKAGE_URL"'#g' template/Dockerfile > tmpfile if [[ ! -z ${MYSQL_SHELL_VERSIONS[${VERSION}]} ]]; then MYSQL_SHELL_REPOPATH=yum/mysql-tools-community/el/7/x86_64 From 503cd0eb08f77118b19912a0fa5bb24bd9cbc1b7 Mon Sep 17 00:00:00 2001 From: Robert Neumayer Date: Mon, 24 Sep 2018 12:48:37 +0200 Subject: [PATCH 149/386] Use yum repos to install packages --- gen_dockerfiles.sh | 34 +++++++++------------------------- template/Dockerfile | 13 +++++++++---- template/control.rb | 4 ++-- template/control_pre57.rb | 2 +- 4 files changed, 21 insertions(+), 32 deletions(-) diff --git a/gen_dockerfiles.sh b/gen_dockerfiles.sh index fdde67003..96636b809 100755 --- a/gen_dockerfiles.sh +++ b/gen_dockerfiles.sh @@ -16,22 +16,6 @@ set -e -function get_full_filename() { - FILEPATH=$1 - PACKAGE_STRING=$2 - FILENAME=$(curl -s $FILEPATH/ | grep $PACKAGE_STRING | sed -e 's/.*href=\"//i' -e 's/\".*//') - if [ -z "$FILENAME" ]; then - echo &< "Unable to locate package for $PACKAGE_STRING. Aborting" - exit 1 - fi - COUNT=$(echo $FILENAME | tr " " "\n" | wc -l) - if [ $COUNT -gt 1 ]; then - echo &<2 "Found multiple file names for package $PACKAGE_STRING. Aborting" - exit 1 - fi - echo $FILENAME -} - # This script will simply use sed to replace placeholder variables in the # files in template/ with version-specific variants. @@ -103,15 +87,15 @@ for VERSION in "${!MYSQL_SERVER_VERSIONS[@]}" do # Dockerfiles MYSQL_SERVER_REPOPATH=yum/mysql-$VERSION-community/docker/x86_64 - MYSQL_SERVER_PACKAGE_URL=$REPO/$MYSQL_SERVER_REPOPATH/$(get_full_filename $REPO/$MYSQL_SERVER_REPOPATH mysql-community-server-minimal-${MYSQL_SERVER_VERSIONS[${VERSION}]}) - sed 's#%%MYSQL_SERVER_PACKAGE_URL%%#'"$MYSQL_SERVER_PACKAGE_URL"'#g' template/Dockerfile > tmpfile + sed 's#%%MYSQL_SERVER_PACKAGE%%#'"mysql-community-server-minimal-${MYSQL_SERVER_VERSIONS[${VERSION}]}"'#g' template/Dockerfile > tmpfile + sed -i 's#%%REPO%%#'"${REPO}"'#g' tmpfile + REPO_VERSION=${VERSION//\./} + sed -i 's#%%REPO_VERSION%%#'"${REPO_VERSION}"'#g' tmpfile if [[ ! -z ${MYSQL_SHELL_VERSIONS[${VERSION}]} ]]; then - MYSQL_SHELL_REPOPATH=yum/mysql-tools-community/el/7/x86_64 - MYSQL_SHELL_PACKAGE_URL=$REPO/$MYSQL_SHELL_REPOPATH/$(get_full_filename $REPO/$MYSQL_SHELL_REPOPATH mysql-shell-${MYSQL_SHELL_VERSIONS[${VERSION}]}) - sed -i 's#%%MYSQL_SHELL_PACKAGE_URL%%#'"$MYSQL_SHELL_PACKAGE_URL"'#g' tmpfile + sed -i 's#%%MYSQL_SHELL_PACKAGE%%#'"mysql-shell-${MYSQL_SHELL_VERSIONS[${VERSION}]}"'#g' tmpfile else - sed -i 's#%%MYSQL_SHELL_PACKAGE_URL%%#'""'#g' tmpfile + sed -i 's#%%MYSQL_SHELL_PACKAGE%%#'""'#g' tmpfile fi sed -i 's/%%PORTS%%/'"${PORTS[${VERSION}]}"'/g' tmpfile @@ -122,11 +106,11 @@ do mkdir "${VERSION}/inspec" fi if [ "${VERSION}" == "5.7" ] || [ "${VERSION}" == "8.0" ]; then - sed 's#%%MYSQL_SERVER_PACKAGE_VERSION%%#'"${MYSQL_SERVER_VERSIONS[${VERSION}]}"'#g' template/control.rb > tmpFile - sed -i 's#%%MYSQL_SHELL_PACKAGE_VERSION%%#'"${MYSQL_SHELL_VERSIONS[${VERSION}]}"'#g' tmpFile + sed 's#%%MYSQL_SERVER_VERSION%%#'"${MYSQL_SERVER_VERSIONS[${VERSION}]}"'#g' template/control.rb > tmpFile + sed -i 's#%%MYSQL_SHELL_VERSION%%#'"${MYSQL_SHELL_VERSIONS[${VERSION}]}"'#g' tmpFile mv tmpFile "${VERSION}/inspec/control.rb" else - sed 's#%%MYSQL_SERVER_PACKAGE_VERSION%%#'"${MYSQL_SERVER_VERSIONS[${VERSION}]}"'#g' template/control_pre57.rb > tmpFile + sed 's#%%MYSQL_SERVER_VERSION%%#'"${MYSQL_SERVER_VERSIONS[${VERSION}]}"'#g' template/control_pre57.rb > tmpFile mv tmpFile "${VERSION}/inspec/control.rb" fi diff --git a/template/Dockerfile b/template/Dockerfile index c9a0c9a50..23942be9e 100644 --- a/template/Dockerfile +++ b/template/Dockerfile @@ -14,12 +14,17 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE_URL=%%MYSQL_SERVER_PACKAGE_URL%% -ARG MYSQL_SHELL_PACKAGE_URL=%%MYSQL_SHELL_PACKAGE_URL%% +ARG MYSQL_SERVER_PACKAGE=%%MYSQL_SERVER_PACKAGE%% +ARG MYSQL_SHELL_PACKAGE=%%MYSQL_SHELL_PACKAGE%% # Install server -RUN rpmkeys --import https://repo.mysql.com/RPM-GPG-KEY-mysql \ - && yum install -y $MYSQL_SERVER_PACKAGE_URL $MYSQL_SHELL_PACKAGE_URL libpwquality \ +RUN yum install -y %%REPO%%/mysql-community-minimal-release-el7.rpm \ + %%REPO%%/mysql-community-release-el7.rpm \ + && yum-config-manager --enable mysql%%REPO_VERSION%%-server-minimal \ + && yum install -y \ + $MYSQL_SERVER_PACKAGE \ + $MYSQL_SHELL_PACKAGE \ + libpwquality \ && yum clean all \ && mkdir /docker-entrypoint-initdb.d diff --git a/template/control.rb b/template/control.rb index 8c8d823a2..850058f9c 100644 --- a/template/control.rb +++ b/template/control.rb @@ -12,13 +12,13 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '%%MYSQL_SERVER_PACKAGE_VERSION%%.*' } + its ('version') { should match '%%MYSQL_SERVER_VERSION%%.*' } end end control 'shell-package' do impact 0.5 describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '%%MYSQL_SHELL_PACKAGE_VERSION%%.*' } + its ('version') { should match '%%MYSQL_SHELL_VERSION%%.*' } end end diff --git a/template/control_pre57.rb b/template/control_pre57.rb index f08a1dfb8..44dff62ae 100644 --- a/template/control_pre57.rb +++ b/template/control_pre57.rb @@ -12,6 +12,6 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '%%MYSQL_SERVER_PACKAGE_VERSION%%.*' } + its ('version') { should match '%%MYSQL_SERVER_VERSION%%.*' } end end From 519456722eeb40512dfecf45081c4472125a3be0 Mon Sep 17 00:00:00 2001 From: Robert Neumayer Date: Fri, 28 Sep 2018 09:52:56 +0200 Subject: [PATCH 150/386] Update build and test scripts We add architecture and major version parameters. --- VERSION | 3 +++ build.sh | 19 ++++++++++++++++--- gen_dockerfiles.sh | 8 ++------ manifest.sh | 29 +++++++++++++++++++++++++++++ tag.sh | 33 +++++++++++++++++++++++++++++++++ test.sh | 23 ++++++++++++++++------- 6 files changed, 99 insertions(+), 16 deletions(-) create mode 100755 manifest.sh create mode 100755 tag.sh diff --git a/VERSION b/VERSION index ee48e300f..9cbf74efc 100644 --- a/VERSION +++ b/VERSION @@ -17,3 +17,6 @@ FULL_SERVER_VERSIONS["5.5"]="${MYSQL_SERVER_VERSIONS["5.5"]}-${IMAGE_VERSION}" FULL_SERVER_VERSIONS["5.6"]="${MYSQL_SERVER_VERSIONS["5.6"]}-${IMAGE_VERSION}" FULL_SERVER_VERSIONS["5.7"]="${MYSQL_SERVER_VERSIONS["5.7"]}-${IMAGE_VERSION}" FULL_SERVER_VERSIONS["8.0"]="${MYSQL_SERVER_VERSIONS["8.0"]}-${IMAGE_VERSION}" + +MULTIARCH_VERSIONS="8.0" +SINGLEARCH_VERSIONS="5.5 5.6 5.7" diff --git a/build.sh b/build.sh index 3646b2775..39439c78b 100755 --- a/build.sh +++ b/build.sh @@ -14,7 +14,20 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -source VERSION -for MAJOR_VERSION in "${!MYSQL_SERVER_VERSIONS[@]}"; do - docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$http_proxy --build-arg no_proxy=$no_proxy -t mysql/mysql-server:$MAJOR_VERSION $MAJOR_VERSION +source ./VERSION + +ARCH=amd64; [ -n "$1" ] && ARCH=$1 +MAJOR_VERSIONS=("${!MYSQL_SERVER_VERSIONS[@]}"); [ -n "$2" ] && MAJOR_VERSIONS=("${@:2}") + +for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do + for MULTIARCH_VERSION in ${MULTIARCH_VERSIONS}; do + if [[ "$MULTIARCH_VERSION" == "$MAJOR_VERSION" ]]; then + docker build --build-arg http_proxy="$http_proxy" --build-arg https_proxy="$http_proxy" --build-arg no_proxy="$no_proxy" -t mysql/mysql-server:"$MAJOR_VERSION"-$ARCH "$MAJOR_VERSION" + fi + done + for SINGLEARCH_VERSION in $SINGLEARCH_VERSIONS; do + if [[ "$SINGLEARCH_VERSION" == "$MAJOR_VERSION" ]]; then + docker build --build-arg http_proxy="$http_proxy" --build-arg https_proxy="$http_proxy" --build-arg no_proxy="$no_proxy" -t mysql/mysql-server:"$MAJOR_VERSION" "$MAJOR_VERSION" + fi + done done diff --git a/gen_dockerfiles.sh b/gen_dockerfiles.sh index 96636b809..c7a404a7f 100755 --- a/gen_dockerfiles.sh +++ b/gen_dockerfiles.sh @@ -19,13 +19,9 @@ set -e # This script will simply use sed to replace placeholder variables in the # files in template/ with version-specific variants. -. VERSION +source ./VERSION -if [ -z "$1" ]; then - REPO=https://repo.mysql.com -else - REPO=$1 -fi +REPO=mysql/mysql-server [ -n "$1" ] && REPO=$1 # 33060 is the default port for the mysqlx plugin, new to 5.7 declare -A PORTS diff --git a/manifest.sh b/manifest.sh new file mode 100755 index 000000000..0bd3b56b2 --- /dev/null +++ b/manifest.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e +source ./VERSION + +REPO=mysql/mysql-server [ -n "$1" ] && REPO=$1 + +for MAJOR_VERSION in ${MULTIARCH_VERSIONS}; do + MANIFEST_VERSIONS=$(./tag.sh "$ARCH" "$MAJOR_VERSION") + for MANIFEST_VERSION in $MANIFEST_VERSIONS; do + docker manifest create "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-aarch64" "$REPO:$MANIFEST_VERSION-amd64" + docker manifest annotate "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-aarch64" --os linux --arch arm64 + docker manifest annotate "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-amd64" --os linux --arch amd64 + docker manifest push "$REPO:$MANIFEST_VERSION" + done +done diff --git a/tag.sh b/tag.sh new file mode 100755 index 000000000..cd19c7790 --- /dev/null +++ b/tag.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e +source VERSION + +SUFFIX='' [ -n "$1" ] && SUFFIX=$1 +MAJOR_VERSIONS=("${!MYSQL_SERVER_VERSIONS[@]}"); [ -n "$2" ] && MAJOR_VERSIONS=("${@:2}") + +for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do + for MULTIARCH_VERSION in ${MULTIARCH_VERSIONS}; do + if [[ "$MULTIARCH_VERSION" == "$MAJOR_VERSION" ]]; then + echo "$MAJOR_VERSION$SUFFIX ${MYSQL_SERVER_VERSIONS["$MAJOR_VERSION"]}$SUFFIX ${FULL_SERVER_VERSIONS["$MAJOR_VERSION"]}$SUFFIX" + fi + done + for SINGLEARCH_VERSION in $SINGLEARCH_VERSIONS; do + if [[ "$SINGLEARCH_VERSION" == "$MAJOR_VERSION" ]]; then + echo "$MAJOR_VERSION ${MYSQL_SERVER_VERSIONS["$MAJOR_VERSION"]} ${FULL_SERVER_VERSIONS["$MAJOR_VERSION"]}" + fi + done +done diff --git a/test.sh b/test.sh index 1ac3c0aae..0efdd5b3d 100755 --- a/test.sh +++ b/test.sh @@ -18,15 +18,24 @@ # files in template/ with version-specific variants. set -e -source VERSION +source ./VERSION -for MAJOR_VERSION in "${!MYSQL_SERVER_VERSIONS[@]}" -do - docker run -d --name mysql-server mysql/mysql-server:$MAJOR_VERSION - inspec exec $MAJOR_VERSION/inspec/control.rb --controls container - inspec exec $MAJOR_VERSION/inspec/control.rb -t docker://mysql-server --controls server-package +ARCH=amd64; [ -n "$1" ] && ARCH=$1 +MAJOR_VERSIONS=("${!MYSQL_SERVER_VERSIONS[@]}"); [ -n "$2" ] && MAJOR_VERSIONS=("${@:2}") + + +for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do + ARCH_SUFFIX="" + for MULTIARCH_VERSION in ${MULTIARCH_VERSIONS}; do + if [[ "$MULTIARCH_VERSION" == "$MAJOR_VERSION" ]]; then + ARCH_SUFFIX="-$ARCH" + fi + done + docker run -d --name mysql-server mysql/mysql-server:"$MAJOR_VERSION$ARCH_SUFFIX" + inspec exec "$MAJOR_VERSION/inspec/control.rb" --controls container + inspec exec "$MAJOR_VERSION/inspec/control.rb" -t docker://mysql-server --controls server-package if [ "${MAJOR_VERSION}" == "5.7" ] || [ "${MAJOR_VERSION}" == "8.0" ]; then - inspec exec $MAJOR_VERSION/inspec/control.rb -t docker://mysql-server --controls shell-package + inspec exec "$MAJOR_VERSION/inspec/control.rb" -t docker://mysql-server --controls shell-package fi docker stop mysql-server docker rm mysql-server From 45a8b001c94ba34acbd0cef0a086bcd8835e0cd3 Mon Sep 17 00:00:00 2001 From: Robert Neumayer Date: Tue, 16 Oct 2018 09:16:08 +0200 Subject: [PATCH 151/386] Fix script syntax --- gen_dockerfiles.sh | 2 +- manifest.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gen_dockerfiles.sh b/gen_dockerfiles.sh index c7a404a7f..277293707 100755 --- a/gen_dockerfiles.sh +++ b/gen_dockerfiles.sh @@ -21,7 +21,7 @@ set -e source ./VERSION -REPO=mysql/mysql-server [ -n "$1" ] && REPO=$1 +REPO=https://repo.mysql.com; [ -n "$1" ] && REPO=$1 # 33060 is the default port for the mysqlx plugin, new to 5.7 declare -A PORTS diff --git a/manifest.sh b/manifest.sh index 0bd3b56b2..73aacf2c6 100755 --- a/manifest.sh +++ b/manifest.sh @@ -16,7 +16,7 @@ set -e source ./VERSION -REPO=mysql/mysql-server [ -n "$1" ] && REPO=$1 +REPO=mysql/mysql-server; [ -n "$1" ] && REPO=$1 for MAJOR_VERSION in ${MULTIARCH_VERSIONS}; do MANIFEST_VERSIONS=$(./tag.sh "$ARCH" "$MAJOR_VERSION") From 21860a28d6d30b2c980bea6b0d8c8b802ce14202 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Tue, 23 Oct 2018 07:01:51 +0000 Subject: [PATCH 152/386] Release version 1.1.8 * Fix script syntax * Update build and test scripts * Use yum repos to install packages * Iterate over correct version variable * Bump shell version to 8.0.13 * Bump server version to 8.0.13 * Bump 5.5 server version to 5.5.62 * Bump image version and server 5.6.42 and 5.7.24 --- 5.5/Dockerfile | 13 +++++++++---- 5.5/docker-entrypoint.sh | 4 ++-- 5.5/inspec/control.rb | 17 +++++++++++++++++ 5.6/Dockerfile | 13 +++++++++---- 5.6/docker-entrypoint.sh | 4 ++-- 5.6/inspec/control.rb | 17 +++++++++++++++++ 5.7/Dockerfile | 13 +++++++++---- 5.7/docker-entrypoint.sh | 4 ++-- 5.7/inspec/control.rb | 24 ++++++++++++++++++++++++ 8.0/Dockerfile | 13 +++++++++---- 8.0/docker-entrypoint.sh | 4 ++-- 8.0/inspec/control.rb | 24 ++++++++++++++++++++++++ 12 files changed, 126 insertions(+), 24 deletions(-) create mode 100644 5.5/inspec/control.rb create mode 100644 5.6/inspec/control.rb create mode 100644 5.7/inspec/control.rb create mode 100644 8.0/inspec/control.rb diff --git a/5.5/Dockerfile b/5.5/Dockerfile index 7b33c692d..ff481f020 100644 --- a/5.5/Dockerfile +++ b/5.5/Dockerfile @@ -14,12 +14,17 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE_URL=https://repo.mysql.com/yum/mysql-5.5-community/docker/x86_64/mysql-community-server-minimal-5.5.61-2.el7.x86_64.rpm -ARG MYSQL_SHELL_PACKAGE_URL= +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.5.62 +ARG MYSQL_SHELL_PACKAGE= # Install server -RUN rpmkeys --import https://repo.mysql.com/RPM-GPG-KEY-mysql \ - && yum install -y $MYSQL_SERVER_PACKAGE_URL $MYSQL_SHELL_PACKAGE_URL libpwquality \ +RUN yum install -y https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ + https://repo.mysql.com/mysql-community-release-el7.rpm \ + && yum-config-manager --enable mysql55-server-minimal \ + && yum install -y \ + $MYSQL_SERVER_PACKAGE \ + $MYSQL_SHELL_PACKAGE \ + libpwquality \ && yum clean all \ && mkdir /docker-entrypoint-initdb.d diff --git a/5.5/docker-entrypoint.sh b/5.5/docker-entrypoint.sh index 41bea3239..1ab3eb329 100755 --- a/5.5/docker-entrypoint.sh +++ b/5.5/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.5.61-1.1.7" +echo "[Entrypoint] MySQL Docker Image 5.5.62-1.1.8" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.5.61-1.1.7" + echo "[Entrypoint] Starting MySQL 5.5.62-1.1.8" fi exec "$@" diff --git a/5.5/inspec/control.rb b/5.5/inspec/control.rb new file mode 100644 index 000000000..49b63cc38 --- /dev/null +++ b/5.5/inspec/control.rb @@ -0,0 +1,17 @@ +control 'container' do + impact 0.5 + describe docker_container('mysql-server') do + it { should exist } + it { should be_running } + its('repo') { should eq 'mysql/mysql-server' } + its('ports') { should eq '3306/tcp' } + its('command') { should match '/entrypoint.sh mysqld' } + end +end +control 'server-package' do + impact 0.5 + describe package('mysql-community-server-minimal') do + it { should be_installed } + its ('version') { should match '5.5.62.*' } + end +end diff --git a/5.6/Dockerfile b/5.6/Dockerfile index 89b27ab62..ba496c97e 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -14,12 +14,17 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE_URL=https://repo.mysql.com/yum/mysql-5.6-community/docker/x86_64/mysql-community-server-minimal-5.6.41-2.el7.x86_64.rpm -ARG MYSQL_SHELL_PACKAGE_URL= +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.6.42 +ARG MYSQL_SHELL_PACKAGE= # Install server -RUN rpmkeys --import https://repo.mysql.com/RPM-GPG-KEY-mysql \ - && yum install -y $MYSQL_SERVER_PACKAGE_URL $MYSQL_SHELL_PACKAGE_URL libpwquality \ +RUN yum install -y https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ + https://repo.mysql.com/mysql-community-release-el7.rpm \ + && yum-config-manager --enable mysql56-server-minimal \ + && yum install -y \ + $MYSQL_SERVER_PACKAGE \ + $MYSQL_SHELL_PACKAGE \ + libpwquality \ && yum clean all \ && mkdir /docker-entrypoint-initdb.d diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index 6c6762e35..3beb4648e 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.6.41-1.1.7" +echo "[Entrypoint] MySQL Docker Image 5.6.42-1.1.8" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.6.41-1.1.7" + echo "[Entrypoint] Starting MySQL 5.6.42-1.1.8" fi exec "$@" diff --git a/5.6/inspec/control.rb b/5.6/inspec/control.rb new file mode 100644 index 000000000..47eb9279c --- /dev/null +++ b/5.6/inspec/control.rb @@ -0,0 +1,17 @@ +control 'container' do + impact 0.5 + describe docker_container('mysql-server') do + it { should exist } + it { should be_running } + its('repo') { should eq 'mysql/mysql-server' } + its('ports') { should eq '3306/tcp' } + its('command') { should match '/entrypoint.sh mysqld' } + end +end +control 'server-package' do + impact 0.5 + describe package('mysql-community-server-minimal') do + it { should be_installed } + its ('version') { should match '5.6.42.*' } + end +end diff --git a/5.7/Dockerfile b/5.7/Dockerfile index 8cdc46a87..4670a5ead 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -14,12 +14,17 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE_URL=https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.23-1.el7.x86_64.rpm -ARG MYSQL_SHELL_PACKAGE_URL=https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/mysql-shell-8.0.12-1.el7.x86_64.rpm +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.24 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.13 # Install server -RUN rpmkeys --import https://repo.mysql.com/RPM-GPG-KEY-mysql \ - && yum install -y $MYSQL_SERVER_PACKAGE_URL $MYSQL_SHELL_PACKAGE_URL libpwquality \ +RUN yum install -y https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ + https://repo.mysql.com/mysql-community-release-el7.rpm \ + && yum-config-manager --enable mysql57-server-minimal \ + && yum install -y \ + $MYSQL_SERVER_PACKAGE \ + $MYSQL_SHELL_PACKAGE \ + libpwquality \ && yum clean all \ && mkdir /docker-entrypoint-initdb.d diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 1a1efd03b..c2dce057e 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.23-1.1.7" +echo "[Entrypoint] MySQL Docker Image 5.7.24-1.1.8" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.7.23-1.1.7" + echo "[Entrypoint] Starting MySQL 5.7.24-1.1.8" fi exec "$@" diff --git a/5.7/inspec/control.rb b/5.7/inspec/control.rb new file mode 100644 index 000000000..e8c3a8aad --- /dev/null +++ b/5.7/inspec/control.rb @@ -0,0 +1,24 @@ +control 'container' do + impact 0.5 + describe docker_container('mysql-server') do + it { should exist } + it { should be_running } + its('repo') { should eq 'mysql/mysql-server' } + its('ports') { should eq '3306/tcp, 33060/tcp' } + its('command') { should match '/entrypoint.sh mysqld' } + end +end +control 'server-package' do + impact 0.5 + describe package('mysql-community-server-minimal') do + it { should be_installed } + its ('version') { should match '5.7.24.*' } + end +end +control 'shell-package' do + impact 0.5 + describe package('mysql-shell') do + it { should be_installed } + its ('version') { should match '8.0.13.*' } + end +end diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 0d5f91b41..3aa264948 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -14,12 +14,17 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE_URL=https://repo.mysql.com/yum/mysql-8.0-community/docker/x86_64/mysql-community-server-minimal-8.0.12-1.el7.x86_64.rpm -ARG MYSQL_SHELL_PACKAGE_URL=https://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/mysql-shell-8.0.12-1.el7.x86_64.rpm +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.13 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.13 # Install server -RUN rpmkeys --import https://repo.mysql.com/RPM-GPG-KEY-mysql \ - && yum install -y $MYSQL_SERVER_PACKAGE_URL $MYSQL_SHELL_PACKAGE_URL libpwquality \ +RUN yum install -y https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ + https://repo.mysql.com/mysql-community-release-el7.rpm \ + && yum-config-manager --enable mysql80-server-minimal \ + && yum install -y \ + $MYSQL_SERVER_PACKAGE \ + $MYSQL_SHELL_PACKAGE \ + libpwquality \ && yum clean all \ && mkdir /docker-entrypoint-initdb.d diff --git a/8.0/docker-entrypoint.sh b/8.0/docker-entrypoint.sh index 1e2edb3d8..da4f2a3bc 100755 --- a/8.0/docker-entrypoint.sh +++ b/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.12-1.1.7" +echo "[Entrypoint] MySQL Docker Image 8.0.13-1.1.8" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 8.0.12-1.1.7" + echo "[Entrypoint] Starting MySQL 8.0.13-1.1.8" fi exec "$@" diff --git a/8.0/inspec/control.rb b/8.0/inspec/control.rb new file mode 100644 index 000000000..b9be32e16 --- /dev/null +++ b/8.0/inspec/control.rb @@ -0,0 +1,24 @@ +control 'container' do + impact 0.5 + describe docker_container('mysql-server') do + it { should exist } + it { should be_running } + its('repo') { should eq 'mysql/mysql-server' } + its('ports') { should eq '3306/tcp, 33060/tcp' } + its('command') { should match '/entrypoint.sh mysqld' } + end +end +control 'server-package' do + impact 0.5 + describe package('mysql-community-server-minimal') do + it { should be_installed } + its ('version') { should match '8.0.13.*' } + end +end +control 'shell-package' do + impact 0.5 + describe package('mysql-shell') do + it { should be_installed } + its ('version') { should match '8.0.13.*' } + end +end From 56fe48266e84c3398b3c2e01272b4f92c98faad6 Mon Sep 17 00:00:00 2001 From: Robert Neumayer Date: Thu, 25 Oct 2018 09:57:20 +0200 Subject: [PATCH 153/386] Update readme --- README.md | 145 +++++++++++++----------------------------------------- 1 file changed, 34 insertions(+), 111 deletions(-) diff --git a/README.md b/README.md index 7fd366afe..c6a4ff7f5 100644 --- a/README.md +++ b/README.md @@ -10,24 +10,30 @@ For more information and related downloads for MySQL Server and other MySQL prod Supported Tags and Respective Dockerfile Links ---------------------------------------------- -These are tags for some of the optimized MySQL Server Docker images, created and maintained by the MySQL team at Oracle (for a full list, see [the Tags tab of this page](https://hub.docker.com/r/mysql/mysql-server/tags/)). +> **Warning** +> +> The MySQL Docker images maintained by the MySQL team are built specifically for Linux platforms. Other platforms are not supported, and users using these MySQL Docker images on them are doing so at their own risk. See [the discussion here](https://dev.mysql.com/doc/refman/8.0/en/deploy-mysql-nonlinux-docker.html) for some known limitations for running these containers on non-Linux operating systems. + +These are tags for some of the optimized MySQL Server Docker images, created and maintained by the MySQL team at Oracle (for a full list, see [the Tags tab of this page](https://hub.docker.com/r/mysql/mysql-server/tags/)). [DS] The tags are updated directly on the posted Markdown versions by RE after eahc release, so it might remain outdated in this DocBook source file. + +- MySQL Server 5.5 (tag: [`5.5`, `5.5.62`, `5.5.62-1.1.8`](https://github.com/mysql/mysql-docker/blob/mysql-server/5.5/Dockerfile)) ([mysql-server/5.5/Dockerfile](https://github.com/mysql/mysql-docker/blob/mysql-server/5.5/Dockerfile)) -- MySQL Server 5.5 (tag: [`5.5`, `5.5.58`, `5.5.58-1.1.2`](https://github.com/mysql/mysql-docker/blob/mysql-server/5.5/Dockerfile)) ([mysql-server/5.5/Dockerfile](https://github.com/mysql/mysql-docker/blob/mysql-server/5.5/Dockerfile)) +- MySQL Server 5.6 (tag: [`5.6`, `5.6.42`, `5.6.42-1.1.8`](https://github.com/mysql/mysql-docker/blob/mysql-server/5.6/Dockerfile)) ([mysql-server/5.6/Dockerfile](https://github.com/mysql/mysql-docker/blob/mysql-server/5.6/Dockerfile)) -- MySQL Server 5.6 (tag: [`5.6`, `5.6.38`, `5.6.38-1.1.2`](https://github.com/mysql/mysql-docker/blob/mysql-server/5.6/Dockerfile)) ([mysql-server/5.6/Dockerfile](https://github.com/mysql/mysql-docker/blob/mysql-server/5.6/Dockerfile)) +- MySQL Server 5.7 (tag: [`5.7`, `5.7.24`, `5.7.24-1.1.8`](https://github.com/mysql/mysql-docker/blob/mysql-server/5.7/Dockerfile)) ([mysql-server/5.7/Dockerfile](https://github.com/mysql/mysql-docker/blob/mysql-server/5.7/Dockerfile)) -- MySQL Server 5.7, the latest GA (tag: [`5.7`, `5.7.20`, `5.7.20-1.1.2`](https://github.com/mysql/mysql-docker/blob/mysql-server/5.7/Dockerfile)) ([mysql-server/5.7/Dockerfile](https://github.com/mysql/mysql-docker/blob/mysql-server/5.7/Dockerfile)) +- MySQL Server 8.0, the latest GA (tag: [`8.0`, `8.0.13`, `8.0.13-1.1.8`, `latest`](https://github.com/mysql/mysql-docker/blob/mysql-server/8.0/Dockerfile)) ([mysql-server/8.0/Dockerfile](https://github.com/mysql/mysql-docker/blob/mysql-server/8.0/Dockerfile)) -- MySQL Server 8.0, Release Candidate (tag: [`8.0`, `8.0.3-rc`, `8.0.3-rc-1.1.2`](https://github.com/mysql/mysql-docker/blob/mysql-server/8.0/Dockerfile)) ([mysql-server/8.0/Dockerfile](https://github.com/mysql/mysql-docker/blob/mysql-server/8.0/Dockerfile)) +- MySQL Server 8.0 is also available for AArch64 (ARM64), using the same tags. -Images are updated when new MySQL Server maintenance releases and development milestones are published. Please note that non-GA releases are for preview purposes only and should not be used in production setups. +Images are updated when new MySQL Server maintenance releases and development milestones are published. Please note that any non-GA releases are for preview purposes only and should not be used in production setups. -We also from time to time publish special MySQL Server images that contain experimental features. Please take a look at the [MySQL Docker image list](https://hub.docker.com/r/mysql/) to see what are available. +We also from time to time publish special MySQL Server images that contain experimental features. Quick Reference --------------- -- *Detailed documentation:* See [Deploying MySQL on Linux with Docker](https://dev.mysql.com/doc/refman/5.7/en/linux-installation-docker.html) in the [MySQL Reference Manual](https://dev.mysql.com/doc/refman/5.7/en/). +- *Detailed documentation:* See [Deploying MySQL on Linux with Docker](https://dev.mysql.com/doc/refman/8.0/en/linux-installation-docker.html) in the [MySQL Reference Manual](https://dev.mysql.com/doc/refman/8.0/en/). - *Where to file issues:* Please submit a bug report at under the category “MySQL Package Repos and Docker Images”. @@ -46,10 +52,8 @@ Downloading the server image in a separate step is not strictly necessary; howev To download the MySQL Community Edition image, run this command: - docker pull mysql/mysql-server:tag - - - + shell> docker pull mysql/mysql-server:tag +  Refer to the list of supported tags above. If `:tag ` is omitted, the `latest` tag is used, and the image for the latest GA version of MySQL Server is downloaded. @@ -57,127 +61,46 @@ Refer to the list of supported tags above. If `:tag Start a new Docker container for the MySQL Community Server with this command: - docker run --name=mysql1 -d mysql/mysql-server:tag - - - + shell> docker run --name=mysql1 -d mysql/mysql-server:tag +  The `--name` option, for supplying a custom name for your server container (`mysql1` in the example), is optional; if no container name is supplied, a random one is generated. If the Docker image of the specified name and tag has not been downloaded by an earlier `docker pull` or `docker run` command, the image is now downloaded. After download completes, initialization for the container begins, and the container appears in the list of running containers when you run the `docker ps` command; for example: shell> docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES - a24888f0d6f4 mysql/mysql-server "/entrypoint.sh my..." 14 seconds ago Up 13 seconds (health: starting) 3306/tcp, 33060/tcp mysql1 - + a24888f0d6f4 mysql/mysql-server "/entrypoint.sh my..." 14 seconds ago Up 13 seconds (health: starting) 3306/tcp, 33060/tcp mysql1 +  The container initialization might take some time. When the server is ready for use, the `STATUS` of the container in the output of the `docker ps` command changes from `(health: starting)` to `(healthy)`. The `-d` option used in the `docker run` command above makes the container run in the background. Use this command to monitor the output from the container: - docker logs mysql1 - - + shell> docker logs mysql1 +  Once initialization is finished, the command's output is going to contain the random password generated for the root user; check the password with, for example, this command: shell> docker logs mysql1 2>&1 | grep GENERATED GENERATED ROOT PASSWORD: Axegh3kAJyDLaRuBemecis&EShOs - +  ### Connecting to MySQL Server from within the Container Once the server is ready, you can run the `mysql` client within the MySQL Server container you just started and connect it to the MySQL Server. Use the `docker exec -it` command to start a `mysql` client inside the Docker container you have started, like this: - docker exec -it mysql1 mysql -uroot -p - - -When asked, enter the generated root password (see the instructions above on how to find it). Because the `MYSQL_ONETIME_PASSWORD` option is true by default, after you started the server container with the sample command above and connected a `mysql` client to the server, you must reset the server root password by issuing this statement: - - mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'newpassword'; - - -Substitute `newpassword` with the password of your choice. Once the password is reset, the server is ready for use. - -### Container Shell Access - -To have shell access to your MySQL Server container, use the `docker exec -it` command to start a bash shell inside the container: - - shell> docker exec -it mysql1 bash - bash-4.2# - -You can then run Linux commands inside the container at the bash prompt. - -### Stopping and Deleting a MySQL Container - -To stop the MySQL Server container we have created, use this command: - - docker stop mysql1 - - -`docker stop` sends a SIGTERM signal to the `mysqld` process, so that the server is shut down gracefully. - -Also notice that when the main process of a container (`mysqld` in the case of a MySQL Server container) is stopped, the Docker container stops automatically. - -To start the MySQL Server container again: - - docker start mysql1 - - -To stop and start again the MySQL Server container with a single command: - - docker restart mysql1 - - -To delete the MySQL container, stop it first, and then use the `docker rm` command: - - docker stop mysql1 - - docker rm mysql1 - - -If you want the [Docker volume for the server's data directory](https://dev.mysql.com/doc/refman/5.7/en/docker-mysql-more-topics.html#docker-persisting-data-configuration) to be deleted at the same time, add the `-v` option to the `docker rm` command. - -### More Topics on Deploying MySQL Server with Docker - -For more topics on deploying MySQL Server with Docker like server configuration, persisting data and configuration, and server error log, see [More Topics on Deploying MySQL Server with Docker](https://dev.mysql.com/doc/refman/5.7/en/docker-mysql-more-topics.html) in the MySQL Server manual. - -Docker Environment Variables ----------------------------- - -When you create a MySQL Server container, you can configure the MySQL instance by using the `--env` option (`-e` in short) and specifying one or more of the following environment variables. - -> **Notes** -> -> - None of the variables below has any effect if you mount a data directory that is not empty, as no server initialization is going to be attempted then (see [Persisting Data and Configuration Changes](https://dev.mysql.com/doc/refman/5.7/en/docker-mysql-more-topics.html#docker-persisting-data-configuration) for more details). Any pre-existing contents in the folder, including any old server settings, are not modified during the container startup. -> -> - The boolean variables including `MYSQL_RANDOM_ROOT_PASSWORD`, `MYSQL_ONETIME_PASSWORD`, `MYSQL_ALLOW_EMPTY_PASSWORD`, and `MYSQL_LOG_CONSOLE` are made true by setting them with any strings of non-zero lengths. Therefore, setting them to, for example, “0”, “false”, or “no” does not make them false, but actually makes them true. This is a known issue of the MySQL Server containers. -> + shell> docker exec -it mysql1 mysql -uroot -p   +When asked, enter the generated root password (see the instructions above on how to find it). Because the `MYSQL_ONETIME_PASSWORD` option is true by default, after you have connected a `mysql` client to the server, you must reset the server root password by issuing this statement: -- `MYSQL_RANDOM_ROOT_PASSWORD`: When this variable is true (which is its default state, unless `MYSQL_ROOT_PASSWORD` is set or `MYSQL_ALLOW_EMPTY_PASSWORD` is set to true), a random password for the server's root user is generated when the Docker container is started. The password is printed to `stdout` of the container and can be found by looking at the container’s log. - -- `MYSQL_ONETIME_PASSWORD`: When the variable is true (which is its default state, unless `MYSQL_ROOT_PASSWORD` is set or `MYSQL_ALLOW_EMPTY_PASSWORD` is set to true), the root user's password is set as expired and must be changed before MySQL can be used normally. This variable is only supported for MySQL 5.6 and later. - -- `MYSQL_DATABASE`: This variable allows you to specify the name of a database to be created on image startup. If a user name and a password are supplied with `MYSQL_USER` and `MYSQL_PASSWORD`, the user is created and granted superuser access to this database (corresponding to `GRANT ALL`). The specified database is created by a [CREATE DATABASE IF NOT EXIST](#create-database) statement, so that the variable has no effect if the database already exists. - -- `MYSQL_USER`, `MYSQL_PASSWORD`: These variables are used in conjunction to create a user and set that user's password, and the user is granted superuser permissions for the database specified by the `MYSQL_DATABASE` variable. Both `MYSQL_USER` and `MYSQL_PASSWORD` are required for a user to be created; if any of the two variables is not set, the other is ignored. If both variables are set but `MYSQL_DATABASE` is not, the user is created without any privileges. - - > **Note** - > - > There is no need to use this mechanism to create the root superuser, which is created by default with the password set by either one of the mechanisms discussed in the descriptions for `MYSQL_ROOT_PASSWORD` and `MYSQL_RANDOM_ROOT_PASSWORD`, unless `MYSQL_ALLOW_EMPTY_PASSWORD` is true. - -- `MYSQL_ROOT_HOST`: By default, MySQL creates the `'root'@'localhost'` account. This account can only be connected to from inside the container. To allow root connections from other hosts, set this environment variable. For example, the value `172.17.0.1`, which is the default Docker gateway IP, allows connections from the host machine that runs the container. The option accepts only one entry, but wildcards are allowed (for example, `MYSQL_ROOT_HOST=172.*.*.*` or `MYSQL_ROOT_HOST=%`). + mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'password'; +  +Substitute `password` with the password of your choice. Once the password is reset, the server is ready for use. -- `MYSQL_LOG_CONSOLE`: When the variable is true (which is its default state for MySQL 8.0 server containers), the MySQL Server's error log is redirected to `stderr`, so that the error log goes into the Docker container's log and is viewable using the `docker logs` command. +### Products Included in the Container - > **Note** - > - > The variable has no effect if a server configuration file from the host has been mounted (see [Persisting Data and Configuration Changes](https://dev.mysql.com/doc/refman/5.7/en/docker-mysql-more-topics.html#docker-persisting-data-configuration) on bind-mounting a configuration file). +A number of MySQL products are included in the Docker container you created with the MySQL Server Docker image: -- `MYSQL_ROOT_PASSWORD`: This variable specifies a password that is set for the MySQL root account. +- MySQL Server and other MySQL Programs including the [mysql](https://dev.mysql.com/doc/refman/8.0/en/mysql.html) client,[mysqladmin](https://dev.mysql.com/doc/refman/8.0/en/mysqladmin.html), [mysqldump](https://dev.mysql.com/doc/refman/8.0/en/mysqldump.html), and so on. See the [MySQL Reference Manual](https://dev.mysql.com/doc/refman/8.0/en/programs-overview.html) for documentation of the products. - > **Warning** - > - > Setting the MySQL root user password on the command line is insecure. As an alternative to specifying the password explicitly, you can set the variable with a container file path for a password file, and then mount a file from your host that contains the password at the container file path. This is still not very secure, as the location of the password file is still exposed. It is preferable to use the default settings of `MYSQL_RANDOM_ROOT_PASSWORD` and `MYSQL_ONETIME_PASSWORD` being both true. +- MySQL Shell. See the [MySQL Shell User Guide](https://dev.mysql.com/doc/refman/8.0/en/mysql-shell.html) for documentation of the product. -- `MYSQL_ALLOW_EMPTY_PASSWORD`. Set it to true to allow the container to be started with a blank password for the root user. +### More Topics on Deploying MySQL Server with Docker - > **Warning** - > - > Setting this variable to true is insecure, because it is going to leave your MySQL instance completely unprotected, allowing anyone to gain complete superuser access. It is preferable to use the default settings of `MYSQL_RANDOM_ROOT_PASSWORD` and `MYSQL_ONETIME_PASSWORD` being both true. +For more topics on deploying MySQL Server with Docker like starting and connecting to the server, server configuration, persisting data and configuration, server error log, server upgrades, and the Docker environment variables, see [Deploying MySQL Server with Docker](https://dev.mysql.com/doc/refman/8.0/en/linux-installation-docker.html) in the MySQL Server manual. From b6af19036d723d18c3383e72ff6a29602b309480 Mon Sep 17 00:00:00 2001 From: Robert Neumayer Date: Thu, 25 Oct 2018 09:44:27 +0200 Subject: [PATCH 154/386] Fix generation of latest tag --- VERSION | 1 + manifest.sh | 2 +- tag.sh | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 9cbf74efc..49181256f 100644 --- a/VERSION +++ b/VERSION @@ -20,3 +20,4 @@ FULL_SERVER_VERSIONS["8.0"]="${MYSQL_SERVER_VERSIONS["8.0"]}-${IMAGE_VERSION}" MULTIARCH_VERSIONS="8.0" SINGLEARCH_VERSIONS="5.5 5.6 5.7" +LATEST="8.0" diff --git a/manifest.sh b/manifest.sh index 73aacf2c6..10b2845fa 100755 --- a/manifest.sh +++ b/manifest.sh @@ -19,7 +19,7 @@ source ./VERSION REPO=mysql/mysql-server; [ -n "$1" ] && REPO=$1 for MAJOR_VERSION in ${MULTIARCH_VERSIONS}; do - MANIFEST_VERSIONS=$(./tag.sh "$ARCH" "$MAJOR_VERSION") + MANIFEST_VERSIONS=$(./tag.sh "" "$MAJOR_VERSION") for MANIFEST_VERSION in $MANIFEST_VERSIONS; do docker manifest create "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-aarch64" "$REPO:$MANIFEST_VERSION-amd64" docker manifest annotate "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-aarch64" --os linux --arch arm64 diff --git a/tag.sh b/tag.sh index cd19c7790..f061b84a8 100755 --- a/tag.sh +++ b/tag.sh @@ -22,7 +22,11 @@ MAJOR_VERSIONS=("${!MYSQL_SERVER_VERSIONS[@]}"); [ -n "$2" ] && MAJOR_VERSIONS=( for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do for MULTIARCH_VERSION in ${MULTIARCH_VERSIONS}; do if [[ "$MULTIARCH_VERSION" == "$MAJOR_VERSION" ]]; then - echo "$MAJOR_VERSION$SUFFIX ${MYSQL_SERVER_VERSIONS["$MAJOR_VERSION"]}$SUFFIX ${FULL_SERVER_VERSIONS["$MAJOR_VERSION"]}$SUFFIX" + if [[ "$MAJOR_VERSION" == "$LATEST" ]]; then + echo "$MAJOR_VERSION$SUFFIX ${MYSQL_SERVER_VERSIONS["$MAJOR_VERSION"]}$SUFFIX ${FULL_SERVER_VERSIONS["$MAJOR_VERSION"]}$SUFFIX latest$SUFFIX" + else + echo "$MAJOR_VERSION$SUFFIX ${MYSQL_SERVER_VERSIONS["$MAJOR_VERSION"]}$SUFFIX ${FULL_SERVER_VERSIONS["$MAJOR_VERSION"]}$SUFFIX" + fi fi done for SINGLEARCH_VERSION in $SINGLEARCH_VERSIONS; do From a304a35e69ed2331979c7a4b4b070ea8ce7079e3 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Wed, 28 Nov 2018 14:45:39 +0100 Subject: [PATCH 155/386] Bump server and image versions --- VERSION | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index 49181256f..b5fa3bb44 100644 --- a/VERSION +++ b/VERSION @@ -1,10 +1,10 @@ -IMAGE_VERSION=1.1.8 +IMAGE_VERSION=1.1.9 declare -A MYSQL_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["5.5"]=5.5.62 -MYSQL_SERVER_VERSIONS["5.6"]=5.6.42 -MYSQL_SERVER_VERSIONS["5.7"]=5.7.24 -MYSQL_SERVER_VERSIONS["8.0"]=8.0.13 +MYSQL_SERVER_VERSIONS["5.6"]=5.6.43 +MYSQL_SERVER_VERSIONS["5.7"]=5.7.25 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.14 declare -A MYSQL_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["5.5"]="" From 23839421a21cf3caf96efb7254ec713111d07fff Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 18 Dec 2018 11:30:48 +0100 Subject: [PATCH 156/386] Bump shell version to 8.0.14 --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index b5fa3bb44..2f80fb6af 100644 --- a/VERSION +++ b/VERSION @@ -9,8 +9,8 @@ MYSQL_SERVER_VERSIONS["8.0"]=8.0.14 declare -A MYSQL_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["5.5"]="" MYSQL_SHELL_VERSIONS["5.6"]="" -MYSQL_SHELL_VERSIONS["5.7"]=8.0.13 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.13 +MYSQL_SHELL_VERSIONS["5.7"]=8.0.14 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.14 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["5.5"]="${MYSQL_SERVER_VERSIONS["5.5"]}-${IMAGE_VERSION}" From 1e2e6da0a98aaff5d013dd6f3154526d58968cb5 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Mon, 21 Jan 2019 13:43:11 +0000 Subject: [PATCH 157/386] Release version 1.1.9 * Bump shell version to 8.0.14 * Bump server and image versions * Fix generation of latest tag * Update readme --- 5.5/docker-entrypoint.sh | 4 ++-- 5.6/Dockerfile | 2 +- 5.6/docker-entrypoint.sh | 4 ++-- 5.6/inspec/control.rb | 2 +- 5.7/Dockerfile | 4 ++-- 5.7/docker-entrypoint.sh | 4 ++-- 5.7/inspec/control.rb | 4 ++-- 8.0/Dockerfile | 4 ++-- 8.0/docker-entrypoint.sh | 4 ++-- 8.0/inspec/control.rb | 4 ++-- 10 files changed, 18 insertions(+), 18 deletions(-) diff --git a/5.5/docker-entrypoint.sh b/5.5/docker-entrypoint.sh index 1ab3eb329..192a2f8ae 100755 --- a/5.5/docker-entrypoint.sh +++ b/5.5/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.5.62-1.1.8" +echo "[Entrypoint] MySQL Docker Image 5.5.62-1.1.9" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.5.62-1.1.8" + echo "[Entrypoint] Starting MySQL 5.5.62-1.1.9" fi exec "$@" diff --git a/5.6/Dockerfile b/5.6/Dockerfile index ba496c97e..8963b510d 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -14,7 +14,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.6.42 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.6.43 ARG MYSQL_SHELL_PACKAGE= # Install server diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index 3beb4648e..3c12c877b 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.6.42-1.1.8" +echo "[Entrypoint] MySQL Docker Image 5.6.43-1.1.9" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.6.42-1.1.8" + echo "[Entrypoint] Starting MySQL 5.6.43-1.1.9" fi exec "$@" diff --git a/5.6/inspec/control.rb b/5.6/inspec/control.rb index 47eb9279c..a6aac8c78 100644 --- a/5.6/inspec/control.rb +++ b/5.6/inspec/control.rb @@ -12,6 +12,6 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '5.6.42.*' } + its ('version') { should match '5.6.43.*' } end end diff --git a/5.7/Dockerfile b/5.7/Dockerfile index 4670a5ead..83cb2fe98 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.24 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.13 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.25 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.14 # Install server RUN yum install -y https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index c2dce057e..83ad0d16e 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.24-1.1.8" +echo "[Entrypoint] MySQL Docker Image 5.7.25-1.1.9" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.7.24-1.1.8" + echo "[Entrypoint] Starting MySQL 5.7.25-1.1.9" fi exec "$@" diff --git a/5.7/inspec/control.rb b/5.7/inspec/control.rb index e8c3a8aad..6d262a2af 100644 --- a/5.7/inspec/control.rb +++ b/5.7/inspec/control.rb @@ -12,13 +12,13 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '5.7.24.*' } + its ('version') { should match '5.7.25.*' } end end control 'shell-package' do impact 0.5 describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.13.*' } + its ('version') { should match '8.0.14.*' } end end diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 3aa264948..30ca6776e 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.13 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.13 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.14 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.14 # Install server RUN yum install -y https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ diff --git a/8.0/docker-entrypoint.sh b/8.0/docker-entrypoint.sh index da4f2a3bc..1abc6bdd5 100755 --- a/8.0/docker-entrypoint.sh +++ b/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.13-1.1.8" +echo "[Entrypoint] MySQL Docker Image 8.0.14-1.1.9" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 8.0.13-1.1.8" + echo "[Entrypoint] Starting MySQL 8.0.14-1.1.9" fi exec "$@" diff --git a/8.0/inspec/control.rb b/8.0/inspec/control.rb index b9be32e16..97677cf9f 100644 --- a/8.0/inspec/control.rb +++ b/8.0/inspec/control.rb @@ -12,13 +12,13 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.13.*' } + its ('version') { should match '8.0.14.*' } end end control 'shell-package' do impact 0.5 describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.13.*' } + its ('version') { should match '8.0.14.*' } end end From 2b02362aedcae3f60cc9c723b74c92c5beb376aa Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Mon, 28 Jan 2019 07:11:48 +0100 Subject: [PATCH 158/386] Bump server version to 8.0.15 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 2f80fb6af..9325f976e 100644 --- a/VERSION +++ b/VERSION @@ -4,7 +4,7 @@ declare -A MYSQL_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["5.5"]=5.5.62 MYSQL_SERVER_VERSIONS["5.6"]=5.6.43 MYSQL_SERVER_VERSIONS["5.7"]=5.7.25 -MYSQL_SERVER_VERSIONS["8.0"]=8.0.14 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.15 declare -A MYSQL_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["5.5"]="" From cecdc7709d28433fe37a5e56dabf5495f9305587 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 29 Jan 2019 09:11:39 +0100 Subject: [PATCH 159/386] Bump shell version to 8.0.15 --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 9325f976e..710ff3606 100644 --- a/VERSION +++ b/VERSION @@ -9,8 +9,8 @@ MYSQL_SERVER_VERSIONS["8.0"]=8.0.15 declare -A MYSQL_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["5.5"]="" MYSQL_SHELL_VERSIONS["5.6"]="" -MYSQL_SHELL_VERSIONS["5.7"]=8.0.14 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.14 +MYSQL_SHELL_VERSIONS["5.7"]=8.0.15 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.15 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["5.5"]="${MYSQL_SERVER_VERSIONS["5.5"]}-${IMAGE_VERSION}" From a7461d5a4b06b4710d0566e2ad14625804b41375 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 29 Jan 2019 11:46:23 +0100 Subject: [PATCH 160/386] Bump image version to 1.1.10 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 710ff3606..52b1bec03 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.1.9 +IMAGE_VERSION=1.1.10 declare -A MYSQL_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["5.5"]=5.5.62 From f80d20ee05bc4a0223d56fc84b9271447c255f56 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Fri, 1 Feb 2019 14:13:41 +0000 Subject: [PATCH 161/386] Release version 1.1.10 * Bump image version to 1.1.10 * Bump shell version to 8.0.15 * Bump server version to 8.0.15 --- 5.5/docker-entrypoint.sh | 4 ++-- 5.6/docker-entrypoint.sh | 4 ++-- 5.7/Dockerfile | 2 +- 5.7/docker-entrypoint.sh | 4 ++-- 5.7/inspec/control.rb | 2 +- 8.0/Dockerfile | 4 ++-- 8.0/docker-entrypoint.sh | 4 ++-- 8.0/inspec/control.rb | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/5.5/docker-entrypoint.sh b/5.5/docker-entrypoint.sh index 192a2f8ae..a75e774f1 100755 --- a/5.5/docker-entrypoint.sh +++ b/5.5/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.5.62-1.1.9" +echo "[Entrypoint] MySQL Docker Image 5.5.62-1.1.10" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.5.62-1.1.9" + echo "[Entrypoint] Starting MySQL 5.5.62-1.1.10" fi exec "$@" diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index 3c12c877b..a2bd3031f 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.6.43-1.1.9" +echo "[Entrypoint] MySQL Docker Image 5.6.43-1.1.10" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.6.43-1.1.9" + echo "[Entrypoint] Starting MySQL 5.6.43-1.1.10" fi exec "$@" diff --git a/5.7/Dockerfile b/5.7/Dockerfile index 83cb2fe98..7907adaf0 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -15,7 +15,7 @@ FROM oraclelinux:7-slim ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.25 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.14 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.15 # Install server RUN yum install -y https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 83ad0d16e..11a1aade5 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.25-1.1.9" +echo "[Entrypoint] MySQL Docker Image 5.7.25-1.1.10" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.7.25-1.1.9" + echo "[Entrypoint] Starting MySQL 5.7.25-1.1.10" fi exec "$@" diff --git a/5.7/inspec/control.rb b/5.7/inspec/control.rb index 6d262a2af..9fa9c38ff 100644 --- a/5.7/inspec/control.rb +++ b/5.7/inspec/control.rb @@ -19,6 +19,6 @@ impact 0.5 describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.14.*' } + its ('version') { should match '8.0.15.*' } end end diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 30ca6776e..4d53d6cdc 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.14 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.14 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.15 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.15 # Install server RUN yum install -y https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ diff --git a/8.0/docker-entrypoint.sh b/8.0/docker-entrypoint.sh index 1abc6bdd5..8c0542c6b 100755 --- a/8.0/docker-entrypoint.sh +++ b/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.14-1.1.9" +echo "[Entrypoint] MySQL Docker Image 8.0.15-1.1.10" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -202,7 +202,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 8.0.14-1.1.9" + echo "[Entrypoint] Starting MySQL 8.0.15-1.1.10" fi exec "$@" diff --git a/8.0/inspec/control.rb b/8.0/inspec/control.rb index 97677cf9f..3789d79b1 100644 --- a/8.0/inspec/control.rb +++ b/8.0/inspec/control.rb @@ -12,13 +12,13 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.14.*' } + its ('version') { should match '8.0.15.*' } end end control 'shell-package' do impact 0.5 describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.14.*' } + its ('version') { should match '8.0.15.*' } end end From 98c43601b3b7b989498209632b35ecef1ce2e2ba Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Thu, 28 Feb 2019 09:36:08 +0100 Subject: [PATCH 162/386] Bump versions for 1.1.11 release --- VERSION | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/VERSION b/VERSION index 52b1bec03..686749150 100644 --- a/VERSION +++ b/VERSION @@ -1,23 +1,20 @@ -IMAGE_VERSION=1.1.10 +IMAGE_VERSION=1.1.11 declare -A MYSQL_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["5.5"]=5.5.62 -MYSQL_SERVER_VERSIONS["5.6"]=5.6.43 -MYSQL_SERVER_VERSIONS["5.7"]=5.7.25 -MYSQL_SERVER_VERSIONS["8.0"]=8.0.15 +MYSQL_SERVER_VERSIONS["5.6"]=5.6.44 +MYSQL_SERVER_VERSIONS["5.7"]=5.7.26 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.16 declare -A MYSQL_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["5.5"]="" MYSQL_SHELL_VERSIONS["5.6"]="" MYSQL_SHELL_VERSIONS["5.7"]=8.0.15 MYSQL_SHELL_VERSIONS["8.0"]=8.0.15 declare -A FULL_SERVER_VERSIONS -FULL_SERVER_VERSIONS["5.5"]="${MYSQL_SERVER_VERSIONS["5.5"]}-${IMAGE_VERSION}" FULL_SERVER_VERSIONS["5.6"]="${MYSQL_SERVER_VERSIONS["5.6"]}-${IMAGE_VERSION}" FULL_SERVER_VERSIONS["5.7"]="${MYSQL_SERVER_VERSIONS["5.7"]}-${IMAGE_VERSION}" FULL_SERVER_VERSIONS["8.0"]="${MYSQL_SERVER_VERSIONS["8.0"]}-${IMAGE_VERSION}" MULTIARCH_VERSIONS="8.0" -SINGLEARCH_VERSIONS="5.5 5.6 5.7" +SINGLEARCH_VERSIONS="5.6 5.7" LATEST="8.0" From df21f5c7eecfa893d06748aa659ddc23ce490a98 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Thu, 21 Feb 2019 09:52:07 +0100 Subject: [PATCH 163/386] Remove unneeded flush privilege command The flush privilege command is only needed if the acl tables are edited manually Thanks to Daniel Black for the contriubtion --- template/docker-entrypoint.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/template/docker-entrypoint.sh b/template/docker-entrypoint.sh index 806f213ba..7896c89ba 100644 --- a/template/docker-entrypoint.sh +++ b/template/docker-entrypoint.sh @@ -142,7 +142,6 @@ EOF echo "GRANT ALL ON \`"$MYSQL_DATABASE"\`.* TO '"$MYSQL_USER"'@'%' ;" | "${mysql[@]}" fi - echo 'FLUSH PRIVILEGES ;' | "${mysql[@]}" elif [ "$MYSQL_USER" -a ! "$MYSQL_PASSWORD" -o ! "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then echo '[Entrypoint] Not creating mysql user. MYSQL_USER and MYSQL_PASSWORD must be specified to create a mysql user.' fi From bdf762a9851f4759b3de4fd56070af29679c3d68 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Thu, 10 Jan 2019 09:36:55 +0100 Subject: [PATCH 164/386] wl12360: Use new --validate-config option for 8.0 Using --verbose --help to check if the server config is valid no longer has any effect for 8.0, but the new --validate-config option has been added to explicitly check the server config --- gen_dockerfiles.sh | 7 +++++++ template/docker-entrypoint.sh | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gen_dockerfiles.sh b/gen_dockerfiles.sh index 277293707..a01eabfe8 100755 --- a/gen_dockerfiles.sh +++ b/gen_dockerfiles.sh @@ -78,6 +78,12 @@ DEFAULT_LOG["5.6"]="" DEFAULT_LOG["5.7"]="" DEFAULT_LOG["8.0"]="console" +# MySQL 8.0 supports a call to validate the config, while older versions have it as a side +# effect of running --verbose --help +declare -A VALIDATE_CONFIG +VALIDATE_CONFIG["5.6"]="output=$(\"$@\" --verbose --help 2>&1 > /dev/null) || result=$?" +VALIDATE_CONFIG["5.7"]="output=$(\"$@\" --verbose --help 2>&1 > /dev/null) || result=$?" +VALIDATE_CONFIG["8.0"]="output=$(\"$@\" --validate-config) || result=$?" for VERSION in "${!MYSQL_SERVER_VERSIONS[@]}" do @@ -119,6 +125,7 @@ do sed -i 's#%%STARTUP_WAIT%%#'"${STARTUP_WAIT[${VERSION}]}"'#g' tmpfile sed -i 's#%%FULL_SERVER_VERSION%%#'"${FULL_SERVER_VERSIONS[${VERSION}]}"'#g' tmpfile sed -i 's#%%DEFAULT_LOG%%#'"${DEFAULT_LOG[${VERSION}]}"'#g' tmpfile + sed -i 's#%%VALIDATE_CONFIG%%#'"${VALIDATE_CONFIG[${VERSION}]}"'#g' tmpfile mv tmpfile ${VERSION}/docker-entrypoint.sh chmod +x ${VERSION}/docker-entrypoint.sh diff --git a/template/docker-entrypoint.sh b/template/docker-entrypoint.sh index 7896c89ba..91bf41ee4 100644 --- a/template/docker-entrypoint.sh +++ b/template/docker-entrypoint.sh @@ -35,7 +35,7 @@ if [ "$1" = 'mysqld' ]; then # Test that the server can start. We redirect stdout to /dev/null so # only the error messages are left. result=0 - output=$("$@" --verbose --help 2>&1 > /dev/null) || result=$? + %%VALIDATE_CONFIG%% if [ ! "$result" = "0" ]; then echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' echo >&2 "[Entrypoint] $output" From ca886f71593774bd678684872e20d690b3b3e9d2 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Wed, 13 Mar 2019 12:48:43 +0100 Subject: [PATCH 165/386] wl12360: Fix escaping of special characters in replacement string --- gen_dockerfiles.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gen_dockerfiles.sh b/gen_dockerfiles.sh index a01eabfe8..1393f4c7e 100755 --- a/gen_dockerfiles.sh +++ b/gen_dockerfiles.sh @@ -81,9 +81,9 @@ DEFAULT_LOG["8.0"]="console" # MySQL 8.0 supports a call to validate the config, while older versions have it as a side # effect of running --verbose --help declare -A VALIDATE_CONFIG -VALIDATE_CONFIG["5.6"]="output=$(\"$@\" --verbose --help 2>&1 > /dev/null) || result=$?" -VALIDATE_CONFIG["5.7"]="output=$(\"$@\" --verbose --help 2>&1 > /dev/null) || result=$?" -VALIDATE_CONFIG["8.0"]="output=$(\"$@\" --validate-config) || result=$?" +VALIDATE_CONFIG["5.6"]="output=\$(\"\$@\" --verbose --help 2>&1 > /dev/null) || result=\$?" +VALIDATE_CONFIG["5.7"]="output=\$(\"\$@\" --verbose --help 2>&1 > /dev/null) || result=\$?" +VALIDATE_CONFIG["8.0"]="output=\$(\"\$@\" --validate-config) || result=\$?" for VERSION in "${!MYSQL_SERVER_VERSIONS[@]}" do From 6c4af3be605dbc9d9599ce66fd5ba555500a662b Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Wed, 20 Mar 2019 17:12:24 +0100 Subject: [PATCH 166/386] Bump shell version to 8.0.16 --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 686749150..26d259847 100644 --- a/VERSION +++ b/VERSION @@ -7,8 +7,8 @@ MYSQL_SERVER_VERSIONS["8.0"]=8.0.16 declare -A MYSQL_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["5.6"]="" -MYSQL_SHELL_VERSIONS["5.7"]=8.0.15 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.15 +MYSQL_SHELL_VERSIONS["5.7"]=8.0.16 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.16 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["5.6"]="${MYSQL_SERVER_VERSIONS["5.6"]}-${IMAGE_VERSION}" From 6ff3f22237ae156da24af7c097c6eaae42255c0c Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Thu, 25 Apr 2019 16:09:47 +0000 Subject: [PATCH 167/386] Release version 1.1.11 * Bump shell version to 8.0.16 * wl12360: Fix escaping of special characters in replacement string * wl12360: Use new --validate-config option for 8.0 * Remove unneeded flush privilege command * Bump versions for 1.1.11 release --- 5.6/Dockerfile | 2 +- 5.6/docker-entrypoint.sh | 7 +++---- 5.6/inspec/control.rb | 2 +- 5.7/Dockerfile | 4 ++-- 5.7/docker-entrypoint.sh | 7 +++---- 5.7/inspec/control.rb | 4 ++-- 8.0/Dockerfile | 4 ++-- 8.0/docker-entrypoint.sh | 7 +++---- 8.0/inspec/control.rb | 4 ++-- 9 files changed, 19 insertions(+), 22 deletions(-) diff --git a/5.6/Dockerfile b/5.6/Dockerfile index 8963b510d..7209dc7e8 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -14,7 +14,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.6.43 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.6.44 ARG MYSQL_SHELL_PACKAGE= # Install server diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index a2bd3031f..21dcd19fe 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.6.43-1.1.10" +echo "[Entrypoint] MySQL Docker Image 5.6.44-1.1.11" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -35,7 +35,7 @@ if [ "$1" = 'mysqld' ]; then # Test that the server can start. We redirect stdout to /dev/null so # only the error messages are left. result=0 - output=$("$@" --verbose --help 2>&1 > /dev/null) || result=$? + output=$("$@" --verbose --help 2>%%VALIDATE_CONFIG%%1 > /dev/null) || result=$? if [ ! "$result" = "0" ]; then echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' echo >&2 "[Entrypoint] $output" @@ -142,7 +142,6 @@ EOF echo "GRANT ALL ON \`"$MYSQL_DATABASE"\`.* TO '"$MYSQL_USER"'@'%' ;" | "${mysql[@]}" fi - echo 'FLUSH PRIVILEGES ;' | "${mysql[@]}" elif [ "$MYSQL_USER" -a ! "$MYSQL_PASSWORD" -o ! "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then echo '[Entrypoint] Not creating mysql user. MYSQL_USER and MYSQL_PASSWORD must be specified to create a mysql user.' fi @@ -202,7 +201,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.6.43-1.1.10" + echo "[Entrypoint] Starting MySQL 5.6.44-1.1.11" fi exec "$@" diff --git a/5.6/inspec/control.rb b/5.6/inspec/control.rb index a6aac8c78..ff510f350 100644 --- a/5.6/inspec/control.rb +++ b/5.6/inspec/control.rb @@ -12,6 +12,6 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '5.6.43.*' } + its ('version') { should match '5.6.44.*' } end end diff --git a/5.7/Dockerfile b/5.7/Dockerfile index 7907adaf0..86ddedc6c 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.25 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.15 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.26 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.16 # Install server RUN yum install -y https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 11a1aade5..6c7c1e8d3 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.25-1.1.10" +echo "[Entrypoint] MySQL Docker Image 5.7.26-1.1.11" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -35,7 +35,7 @@ if [ "$1" = 'mysqld' ]; then # Test that the server can start. We redirect stdout to /dev/null so # only the error messages are left. result=0 - output=$("$@" --verbose --help 2>&1 > /dev/null) || result=$? + output=$("$@" --verbose --help 2>%%VALIDATE_CONFIG%%1 > /dev/null) || result=$? if [ ! "$result" = "0" ]; then echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' echo >&2 "[Entrypoint] $output" @@ -142,7 +142,6 @@ EOF echo "GRANT ALL ON \`"$MYSQL_DATABASE"\`.* TO '"$MYSQL_USER"'@'%' ;" | "${mysql[@]}" fi - echo 'FLUSH PRIVILEGES ;' | "${mysql[@]}" elif [ "$MYSQL_USER" -a ! "$MYSQL_PASSWORD" -o ! "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then echo '[Entrypoint] Not creating mysql user. MYSQL_USER and MYSQL_PASSWORD must be specified to create a mysql user.' fi @@ -202,7 +201,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.7.25-1.1.10" + echo "[Entrypoint] Starting MySQL 5.7.26-1.1.11" fi exec "$@" diff --git a/5.7/inspec/control.rb b/5.7/inspec/control.rb index 9fa9c38ff..7c3736b18 100644 --- a/5.7/inspec/control.rb +++ b/5.7/inspec/control.rb @@ -12,13 +12,13 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '5.7.25.*' } + its ('version') { should match '5.7.26.*' } end end control 'shell-package' do impact 0.5 describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.15.*' } + its ('version') { should match '8.0.16.*' } end end diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 4d53d6cdc..6ebe45a2a 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.15 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.15 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.16 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.16 # Install server RUN yum install -y https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ diff --git a/8.0/docker-entrypoint.sh b/8.0/docker-entrypoint.sh index 8c0542c6b..8acc89b06 100755 --- a/8.0/docker-entrypoint.sh +++ b/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.15-1.1.10" +echo "[Entrypoint] MySQL Docker Image 8.0.16-1.1.11" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -35,7 +35,7 @@ if [ "$1" = 'mysqld' ]; then # Test that the server can start. We redirect stdout to /dev/null so # only the error messages are left. result=0 - output=$("$@" --verbose --help 2>&1 > /dev/null) || result=$? + output=$("$@" --validate-config) || result=$? if [ ! "$result" = "0" ]; then echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' echo >&2 "[Entrypoint] $output" @@ -142,7 +142,6 @@ EOF echo "GRANT ALL ON \`"$MYSQL_DATABASE"\`.* TO '"$MYSQL_USER"'@'%' ;" | "${mysql[@]}" fi - echo 'FLUSH PRIVILEGES ;' | "${mysql[@]}" elif [ "$MYSQL_USER" -a ! "$MYSQL_PASSWORD" -o ! "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then echo '[Entrypoint] Not creating mysql user. MYSQL_USER and MYSQL_PASSWORD must be specified to create a mysql user.' fi @@ -202,7 +201,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 8.0.15-1.1.10" + echo "[Entrypoint] Starting MySQL 8.0.16-1.1.11" fi exec "$@" diff --git a/8.0/inspec/control.rb b/8.0/inspec/control.rb index 3789d79b1..53a85b411 100644 --- a/8.0/inspec/control.rb +++ b/8.0/inspec/control.rb @@ -12,13 +12,13 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.15.*' } + its ('version') { should match '8.0.16.*' } end end control 'shell-package' do impact 0.5 describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.15.*' } + its ('version') { should match '8.0.16.*' } end end From ae3907cd86b9a00b6181608b231e2e274eec1d22 Mon Sep 17 00:00:00 2001 From: Robert Neumayer Date: Fri, 31 May 2019 09:47:29 +0200 Subject: [PATCH 168/386] Bump versions for 1.1.12 release Change-Id: I2cc4a82961f3d161f7091575a4e86381602fd017 --- VERSION | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index 26d259847..0725896e4 100644 --- a/VERSION +++ b/VERSION @@ -1,9 +1,9 @@ -IMAGE_VERSION=1.1.11 +IMAGE_VERSION=1.1.12 declare -A MYSQL_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["5.6"]=5.6.44 -MYSQL_SERVER_VERSIONS["5.7"]=5.7.26 -MYSQL_SERVER_VERSIONS["8.0"]=8.0.16 +MYSQL_SERVER_VERSIONS["5.6"]=5.6.45 +MYSQL_SERVER_VERSIONS["5.7"]=5.7.27 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.17 declare -A MYSQL_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["5.6"]="" From 473728e46bc8a0c291d573ad057febc386b1f707 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Mon, 15 Jul 2019 08:25:10 +0200 Subject: [PATCH 169/386] Bump shell version to 8.0.17 Change-Id: I62e7b97240039a1429826e1ad5f873bef90d2f54 --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 0725896e4..a96fd9cff 100644 --- a/VERSION +++ b/VERSION @@ -7,8 +7,8 @@ MYSQL_SERVER_VERSIONS["8.0"]=8.0.17 declare -A MYSQL_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["5.6"]="" -MYSQL_SHELL_VERSIONS["5.7"]=8.0.16 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.16 +MYSQL_SHELL_VERSIONS["5.7"]=8.0.17 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.17 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["5.6"]="${MYSQL_SERVER_VERSIONS["5.6"]}-${IMAGE_VERSION}" From 3ba0fde80558857ba8dd877d3297701f48bc85ba Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Mon, 22 Jul 2019 15:42:30 +0000 Subject: [PATCH 170/386] Release version 1.1.12 * Bump shell version to 8.0.17 * Bump versions for 1.1.12 release * Release version 1.1.11 * Bump shell version to 8.0.16 * wl12360: Fix escaping of special characters in replacement string * wl12360: Use new --validate-config option for 8.0 * Remove unneeded flush privilege command * Bump versions for 1.1.11 release --- 5.6/Dockerfile | 2 +- 5.6/docker-entrypoint.sh | 4 ++-- 5.6/inspec/control.rb | 2 +- 5.7/Dockerfile | 4 ++-- 5.7/docker-entrypoint.sh | 4 ++-- 5.7/inspec/control.rb | 4 ++-- 8.0/Dockerfile | 4 ++-- 8.0/docker-entrypoint.sh | 4 ++-- 8.0/inspec/control.rb | 4 ++-- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/5.6/Dockerfile b/5.6/Dockerfile index 7209dc7e8..26190fad6 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -14,7 +14,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.6.44 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.6.45 ARG MYSQL_SHELL_PACKAGE= # Install server diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index 21dcd19fe..460c067e9 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.6.44-1.1.11" +echo "[Entrypoint] MySQL Docker Image 5.6.45-1.1.12" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -201,7 +201,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.6.44-1.1.11" + echo "[Entrypoint] Starting MySQL 5.6.45-1.1.12" fi exec "$@" diff --git a/5.6/inspec/control.rb b/5.6/inspec/control.rb index ff510f350..bfe27097b 100644 --- a/5.6/inspec/control.rb +++ b/5.6/inspec/control.rb @@ -12,6 +12,6 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '5.6.44.*' } + its ('version') { should match '5.6.45.*' } end end diff --git a/5.7/Dockerfile b/5.7/Dockerfile index 86ddedc6c..8a413a1b8 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.26 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.16 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.27 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.17 # Install server RUN yum install -y https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 6c7c1e8d3..e72a4d5a5 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.26-1.1.11" +echo "[Entrypoint] MySQL Docker Image 5.7.27-1.1.12" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -201,7 +201,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.7.26-1.1.11" + echo "[Entrypoint] Starting MySQL 5.7.27-1.1.12" fi exec "$@" diff --git a/5.7/inspec/control.rb b/5.7/inspec/control.rb index 7c3736b18..d2e53b726 100644 --- a/5.7/inspec/control.rb +++ b/5.7/inspec/control.rb @@ -12,13 +12,13 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '5.7.26.*' } + its ('version') { should match '5.7.27.*' } end end control 'shell-package' do impact 0.5 describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.16.*' } + its ('version') { should match '8.0.17.*' } end end diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 6ebe45a2a..f27578973 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.16 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.16 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.17 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.17 # Install server RUN yum install -y https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ diff --git a/8.0/docker-entrypoint.sh b/8.0/docker-entrypoint.sh index 8acc89b06..4a104fd59 100755 --- a/8.0/docker-entrypoint.sh +++ b/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.16-1.1.11" +echo "[Entrypoint] MySQL Docker Image 8.0.17-1.1.12" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -201,7 +201,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 8.0.16-1.1.11" + echo "[Entrypoint] Starting MySQL 8.0.17-1.1.12" fi exec "$@" diff --git a/8.0/inspec/control.rb b/8.0/inspec/control.rb index 53a85b411..93f8a6e2f 100644 --- a/8.0/inspec/control.rb +++ b/8.0/inspec/control.rb @@ -12,13 +12,13 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.16.*' } + its ('version') { should match '8.0.17.*' } end end control 'shell-package' do impact 0.5 describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.16.*' } + its ('version') { should match '8.0.17.*' } end end From 783eaca6e434fb31714ea27980f83452a8e6094a Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 3 Sep 2019 07:32:53 +0200 Subject: [PATCH 171/386] Bump server versions Change-Id: I2fccbc82c910dbf838fa465666dc2b4823fb26b1 --- VERSION | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index a96fd9cff..99f4ba34f 100644 --- a/VERSION +++ b/VERSION @@ -1,9 +1,9 @@ IMAGE_VERSION=1.1.12 declare -A MYSQL_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["5.6"]=5.6.45 -MYSQL_SERVER_VERSIONS["5.7"]=5.7.27 -MYSQL_SERVER_VERSIONS["8.0"]=8.0.17 +MYSQL_SERVER_VERSIONS["5.6"]=5.6.46 +MYSQL_SERVER_VERSIONS["5.7"]=5.7.28 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.18 declare -A MYSQL_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["5.6"]="" From c4b54c4dc1d57c487855c1cf306103cb72b8a035 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 3 Sep 2019 14:02:18 +0200 Subject: [PATCH 172/386] Bump image version Change-Id: Ib1aaf0fd9b2bdd4c139744322999d4735335a873 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 99f4ba34f..9fc083e94 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.1.12 +IMAGE_VERSION=1.1.13 declare -A MYSQL_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["5.6"]=5.6.46 From 3c3d0bd779fdfdfcad062c0c821fa8b1017114b6 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Mon, 7 Oct 2019 08:45:56 +0200 Subject: [PATCH 173/386] Bump shell version Change-Id: Ia8b68357aaa699d51cdbc8f6cfb7e8c2e837fcb0 --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 9fc083e94..36d5705b1 100644 --- a/VERSION +++ b/VERSION @@ -7,8 +7,8 @@ MYSQL_SERVER_VERSIONS["8.0"]=8.0.18 declare -A MYSQL_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["5.6"]="" -MYSQL_SHELL_VERSIONS["5.7"]=8.0.17 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.17 +MYSQL_SHELL_VERSIONS["5.7"]=8.0.18 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.18 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["5.6"]="${MYSQL_SERVER_VERSIONS["5.6"]}-${IMAGE_VERSION}" From 98318914f0a88b2323d0da48e4e73df63858f4c7 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Mon, 14 Oct 2019 14:17:51 +0000 Subject: [PATCH 174/386] Release version 1.1.13 * Bump shell version * Bump image version * Bump server versions --- 5.6/Dockerfile | 2 +- 5.6/docker-entrypoint.sh | 4 ++-- 5.6/inspec/control.rb | 2 +- 5.7/Dockerfile | 4 ++-- 5.7/docker-entrypoint.sh | 4 ++-- 5.7/inspec/control.rb | 4 ++-- 8.0/Dockerfile | 4 ++-- 8.0/docker-entrypoint.sh | 4 ++-- 8.0/inspec/control.rb | 4 ++-- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/5.6/Dockerfile b/5.6/Dockerfile index 26190fad6..80b4d0d9f 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -14,7 +14,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.6.45 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.6.46 ARG MYSQL_SHELL_PACKAGE= # Install server diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index 460c067e9..3e7d2e783 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.6.45-1.1.12" +echo "[Entrypoint] MySQL Docker Image 5.6.46-1.1.13" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -201,7 +201,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.6.45-1.1.12" + echo "[Entrypoint] Starting MySQL 5.6.46-1.1.13" fi exec "$@" diff --git a/5.6/inspec/control.rb b/5.6/inspec/control.rb index bfe27097b..5ff0814e0 100644 --- a/5.6/inspec/control.rb +++ b/5.6/inspec/control.rb @@ -12,6 +12,6 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '5.6.45.*' } + its ('version') { should match '5.6.46.*' } end end diff --git a/5.7/Dockerfile b/5.7/Dockerfile index 8a413a1b8..8fc818d30 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.27 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.17 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.28 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.18 # Install server RUN yum install -y https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index e72a4d5a5..7f1d7dd2a 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.27-1.1.12" +echo "[Entrypoint] MySQL Docker Image 5.7.28-1.1.13" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -201,7 +201,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.7.27-1.1.12" + echo "[Entrypoint] Starting MySQL 5.7.28-1.1.13" fi exec "$@" diff --git a/5.7/inspec/control.rb b/5.7/inspec/control.rb index d2e53b726..f4124ed01 100644 --- a/5.7/inspec/control.rb +++ b/5.7/inspec/control.rb @@ -12,13 +12,13 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '5.7.27.*' } + its ('version') { should match '5.7.28.*' } end end control 'shell-package' do impact 0.5 describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.17.*' } + its ('version') { should match '8.0.18.*' } end end diff --git a/8.0/Dockerfile b/8.0/Dockerfile index f27578973..36a05b65f 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.17 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.17 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.18 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.18 # Install server RUN yum install -y https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ diff --git a/8.0/docker-entrypoint.sh b/8.0/docker-entrypoint.sh index 4a104fd59..bc6285971 100755 --- a/8.0/docker-entrypoint.sh +++ b/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.17-1.1.12" +echo "[Entrypoint] MySQL Docker Image 8.0.18-1.1.13" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -201,7 +201,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 8.0.17-1.1.12" + echo "[Entrypoint] Starting MySQL 8.0.18-1.1.13" fi exec "$@" diff --git a/8.0/inspec/control.rb b/8.0/inspec/control.rb index 93f8a6e2f..7669d2c06 100644 --- a/8.0/inspec/control.rb +++ b/8.0/inspec/control.rb @@ -12,13 +12,13 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.17.*' } + its ('version') { should match '8.0.18.*' } end end control 'shell-package' do impact 0.5 describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.17.*' } + its ('version') { should match '8.0.18.*' } end end From 9854975d00bee7dd84f695825d312c249b624de0 Mon Sep 17 00:00:00 2001 From: Piotr Obrzut Date: Tue, 19 Nov 2019 09:32:51 +0100 Subject: [PATCH 175/386] Updated image base to OL8 Change-Id: I3b26cd8a8d0385d9000089af2a817f5bc5c9d6ff --- 5.6/Dockerfile | 15 ++++++++++----- 5.7/Dockerfile | 15 ++++++++++----- 8.0/Dockerfile | 15 ++++++++++----- gen_dockerfiles.sh | 7 +++++++ template/Dockerfile | 15 ++++++++++----- 5 files changed, 47 insertions(+), 20 deletions(-) diff --git a/5.6/Dockerfile b/5.6/Dockerfile index 80b4d0d9f..9ac9acfc0 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -12,20 +12,25 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -FROM oraclelinux:7-slim +FROM oraclelinux:8-slim ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.6.46 ARG MYSQL_SHELL_PACKAGE= # Install server -RUN yum install -y https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ +RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ + && dnf module disable -y mysql \ + && dnf install -y yum-utils https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ https://repo.mysql.com/mysql-community-release-el7.rpm \ - && yum-config-manager --enable mysql56-server-minimal \ - && yum install -y \ + && dnf config-manager --enable mysql56-server-minimal \ + && dnf install -y \ $MYSQL_SERVER_PACKAGE \ $MYSQL_SHELL_PACKAGE \ libpwquality \ - && yum clean all \ + # password generation + cracklib-dicts \ + perl-Getopt-Long \ + && dnf clean all \ && mkdir /docker-entrypoint-initdb.d VOLUME /var/lib/mysql diff --git a/5.7/Dockerfile b/5.7/Dockerfile index 8fc818d30..b2a10e11a 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -12,20 +12,25 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -FROM oraclelinux:7-slim +FROM oraclelinux:8-slim ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.28 ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.18 # Install server -RUN yum install -y https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ +RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ + && dnf module disable -y mysql \ + && dnf install -y yum-utils https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ https://repo.mysql.com/mysql-community-release-el7.rpm \ - && yum-config-manager --enable mysql57-server-minimal \ - && yum install -y \ + && dnf config-manager --enable mysql57-server-minimal \ + && dnf install -y \ $MYSQL_SERVER_PACKAGE \ $MYSQL_SHELL_PACKAGE \ libpwquality \ - && yum clean all \ + # password generation + cracklib-dicts \ + \ + && dnf clean all \ && mkdir /docker-entrypoint-initdb.d VOLUME /var/lib/mysql diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 36a05b65f..aa9125421 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -12,20 +12,25 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -FROM oraclelinux:7-slim +FROM oraclelinux:8-slim ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.18 ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.18 # Install server -RUN yum install -y https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ +RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ + && dnf module disable -y mysql \ + && dnf install -y yum-utils https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ https://repo.mysql.com/mysql-community-release-el7.rpm \ - && yum-config-manager --enable mysql80-server-minimal \ - && yum install -y \ + && dnf config-manager --enable mysql80-server-minimal \ + && dnf install -y \ $MYSQL_SERVER_PACKAGE \ $MYSQL_SHELL_PACKAGE \ libpwquality \ - && yum clean all \ + # password generation + cracklib-dicts \ + \ + && dnf clean all \ && mkdir /docker-entrypoint-initdb.d VOLUME /var/lib/mysql diff --git a/gen_dockerfiles.sh b/gen_dockerfiles.sh index 1393f4c7e..f54e90963 100755 --- a/gen_dockerfiles.sh +++ b/gen_dockerfiles.sh @@ -56,6 +56,12 @@ STARTUP_WAIT["5.6"]="\"yes\"" STARTUP_WAIT["5.7"]="\"\"" STARTUP_WAIT["8.0"]="\"\"" +declare -A EXTRA_DEPENDENCIES +EXTRA_DEPENDENCIES["5.5"]="" +EXTRA_DEPENDENCIES["5.6"]="perl-Getopt-Long" +EXTRA_DEPENDENCIES["5.7"]="" +EXTRA_DEPENDENCIES["8.0"]="" + # The option to set a user as expired, (forcing a password change before # any other action can be taken) was added in 5.6 declare -A EXPIRE_SUPPORT @@ -93,6 +99,7 @@ do sed -i 's#%%REPO%%#'"${REPO}"'#g' tmpfile REPO_VERSION=${VERSION//\./} sed -i 's#%%REPO_VERSION%%#'"${REPO_VERSION}"'#g' tmpfile + sed -i 's#%%EXTRA_DEPENDENCIES%%#'"${EXTRA_DEPENDENCIES[${VERSION}]}"'#g' tmpfile if [[ ! -z ${MYSQL_SHELL_VERSIONS[${VERSION}]} ]]; then sed -i 's#%%MYSQL_SHELL_PACKAGE%%#'"mysql-shell-${MYSQL_SHELL_VERSIONS[${VERSION}]}"'#g' tmpfile diff --git a/template/Dockerfile b/template/Dockerfile index 23942be9e..20a5e8020 100644 --- a/template/Dockerfile +++ b/template/Dockerfile @@ -12,20 +12,25 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -FROM oraclelinux:7-slim +FROM oraclelinux:8-slim ARG MYSQL_SERVER_PACKAGE=%%MYSQL_SERVER_PACKAGE%% ARG MYSQL_SHELL_PACKAGE=%%MYSQL_SHELL_PACKAGE%% # Install server -RUN yum install -y %%REPO%%/mysql-community-minimal-release-el7.rpm \ +RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ + && dnf module disable -y mysql \ + && dnf install -y yum-utils %%REPO%%/mysql-community-minimal-release-el7.rpm \ %%REPO%%/mysql-community-release-el7.rpm \ - && yum-config-manager --enable mysql%%REPO_VERSION%%-server-minimal \ - && yum install -y \ + && dnf config-manager --enable mysql%%REPO_VERSION%%-server-minimal \ + && dnf install -y \ $MYSQL_SERVER_PACKAGE \ $MYSQL_SHELL_PACKAGE \ libpwquality \ - && yum clean all \ + # password generation + cracklib-dicts \ + %%EXTRA_DEPENDENCIES%% \ + && dnf clean all \ && mkdir /docker-entrypoint-initdb.d VOLUME /var/lib/mysql From 7a7d6a5151a842b04cd2902877c8e53a9c4dc871 Mon Sep 17 00:00:00 2001 From: Piotr Obrzut Date: Mon, 25 Nov 2019 16:23:56 +0100 Subject: [PATCH 176/386] Revert "Updated image base to OL8". The change was pushed too late in the release cycle, it requires yum repo changes that couldn't be made on time. Change-Id: If5285346fe91bc08b82e6ce9b234a91c49630fd7 --- 5.6/Dockerfile | 15 +++++---------- 5.7/Dockerfile | 15 +++++---------- 8.0/Dockerfile | 15 +++++---------- gen_dockerfiles.sh | 7 ------- template/Dockerfile | 15 +++++---------- 5 files changed, 20 insertions(+), 47 deletions(-) diff --git a/5.6/Dockerfile b/5.6/Dockerfile index 9ac9acfc0..80b4d0d9f 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -12,25 +12,20 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -FROM oraclelinux:8-slim +FROM oraclelinux:7-slim ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.6.46 ARG MYSQL_SHELL_PACKAGE= # Install server -RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ - && dnf module disable -y mysql \ - && dnf install -y yum-utils https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ +RUN yum install -y https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ https://repo.mysql.com/mysql-community-release-el7.rpm \ - && dnf config-manager --enable mysql56-server-minimal \ - && dnf install -y \ + && yum-config-manager --enable mysql56-server-minimal \ + && yum install -y \ $MYSQL_SERVER_PACKAGE \ $MYSQL_SHELL_PACKAGE \ libpwquality \ - # password generation - cracklib-dicts \ - perl-Getopt-Long \ - && dnf clean all \ + && yum clean all \ && mkdir /docker-entrypoint-initdb.d VOLUME /var/lib/mysql diff --git a/5.7/Dockerfile b/5.7/Dockerfile index b2a10e11a..8fc818d30 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -12,25 +12,20 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -FROM oraclelinux:8-slim +FROM oraclelinux:7-slim ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.28 ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.18 # Install server -RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ - && dnf module disable -y mysql \ - && dnf install -y yum-utils https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ +RUN yum install -y https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ https://repo.mysql.com/mysql-community-release-el7.rpm \ - && dnf config-manager --enable mysql57-server-minimal \ - && dnf install -y \ + && yum-config-manager --enable mysql57-server-minimal \ + && yum install -y \ $MYSQL_SERVER_PACKAGE \ $MYSQL_SHELL_PACKAGE \ libpwquality \ - # password generation - cracklib-dicts \ - \ - && dnf clean all \ + && yum clean all \ && mkdir /docker-entrypoint-initdb.d VOLUME /var/lib/mysql diff --git a/8.0/Dockerfile b/8.0/Dockerfile index aa9125421..36a05b65f 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -12,25 +12,20 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -FROM oraclelinux:8-slim +FROM oraclelinux:7-slim ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.18 ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.18 # Install server -RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ - && dnf module disable -y mysql \ - && dnf install -y yum-utils https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ +RUN yum install -y https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ https://repo.mysql.com/mysql-community-release-el7.rpm \ - && dnf config-manager --enable mysql80-server-minimal \ - && dnf install -y \ + && yum-config-manager --enable mysql80-server-minimal \ + && yum install -y \ $MYSQL_SERVER_PACKAGE \ $MYSQL_SHELL_PACKAGE \ libpwquality \ - # password generation - cracklib-dicts \ - \ - && dnf clean all \ + && yum clean all \ && mkdir /docker-entrypoint-initdb.d VOLUME /var/lib/mysql diff --git a/gen_dockerfiles.sh b/gen_dockerfiles.sh index f54e90963..1393f4c7e 100755 --- a/gen_dockerfiles.sh +++ b/gen_dockerfiles.sh @@ -56,12 +56,6 @@ STARTUP_WAIT["5.6"]="\"yes\"" STARTUP_WAIT["5.7"]="\"\"" STARTUP_WAIT["8.0"]="\"\"" -declare -A EXTRA_DEPENDENCIES -EXTRA_DEPENDENCIES["5.5"]="" -EXTRA_DEPENDENCIES["5.6"]="perl-Getopt-Long" -EXTRA_DEPENDENCIES["5.7"]="" -EXTRA_DEPENDENCIES["8.0"]="" - # The option to set a user as expired, (forcing a password change before # any other action can be taken) was added in 5.6 declare -A EXPIRE_SUPPORT @@ -99,7 +93,6 @@ do sed -i 's#%%REPO%%#'"${REPO}"'#g' tmpfile REPO_VERSION=${VERSION//\./} sed -i 's#%%REPO_VERSION%%#'"${REPO_VERSION}"'#g' tmpfile - sed -i 's#%%EXTRA_DEPENDENCIES%%#'"${EXTRA_DEPENDENCIES[${VERSION}]}"'#g' tmpfile if [[ ! -z ${MYSQL_SHELL_VERSIONS[${VERSION}]} ]]; then sed -i 's#%%MYSQL_SHELL_PACKAGE%%#'"mysql-shell-${MYSQL_SHELL_VERSIONS[${VERSION}]}"'#g' tmpfile diff --git a/template/Dockerfile b/template/Dockerfile index 20a5e8020..23942be9e 100644 --- a/template/Dockerfile +++ b/template/Dockerfile @@ -12,25 +12,20 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -FROM oraclelinux:8-slim +FROM oraclelinux:7-slim ARG MYSQL_SERVER_PACKAGE=%%MYSQL_SERVER_PACKAGE%% ARG MYSQL_SHELL_PACKAGE=%%MYSQL_SHELL_PACKAGE%% # Install server -RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ - && dnf module disable -y mysql \ - && dnf install -y yum-utils %%REPO%%/mysql-community-minimal-release-el7.rpm \ +RUN yum install -y %%REPO%%/mysql-community-minimal-release-el7.rpm \ %%REPO%%/mysql-community-release-el7.rpm \ - && dnf config-manager --enable mysql%%REPO_VERSION%%-server-minimal \ - && dnf install -y \ + && yum-config-manager --enable mysql%%REPO_VERSION%%-server-minimal \ + && yum install -y \ $MYSQL_SERVER_PACKAGE \ $MYSQL_SHELL_PACKAGE \ libpwquality \ - # password generation - cracklib-dicts \ - %%EXTRA_DEPENDENCIES%% \ - && dnf clean all \ + && yum clean all \ && mkdir /docker-entrypoint-initdb.d VOLUME /var/lib/mysql From 08d05e2fc3014961708b496911cd6283c51dd0cd Mon Sep 17 00:00:00 2001 From: Piotr Obrzut Date: Wed, 4 Dec 2019 10:59:49 +0100 Subject: [PATCH 177/386] Bump server versions Change-Id: I141ba11bbc00ffc33f4ac539816b50e66271ee37 --- 5.6/Dockerfile | 2 +- 5.6/docker-entrypoint.sh | 4 ++-- 5.6/inspec/control.rb | 2 +- 5.7/Dockerfile | 2 +- 5.7/docker-entrypoint.sh | 4 ++-- 5.7/inspec/control.rb | 2 +- 8.0/Dockerfile | 2 +- 8.0/docker-entrypoint.sh | 4 ++-- 8.0/inspec/control.rb | 2 +- VERSION | 6 +++--- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/5.6/Dockerfile b/5.6/Dockerfile index 80b4d0d9f..7fd2fc325 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -14,7 +14,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.6.46 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.6.47 ARG MYSQL_SHELL_PACKAGE= # Install server diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index 3e7d2e783..75b107627 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.6.46-1.1.13" +echo "[Entrypoint] MySQL Docker Image 5.6.47-1.1.13" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -201,7 +201,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.6.46-1.1.13" + echo "[Entrypoint] Starting MySQL 5.6.47-1.1.13" fi exec "$@" diff --git a/5.6/inspec/control.rb b/5.6/inspec/control.rb index 5ff0814e0..778a1e997 100644 --- a/5.6/inspec/control.rb +++ b/5.6/inspec/control.rb @@ -12,6 +12,6 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '5.6.46.*' } + its ('version') { should match '5.6.47.*' } end end diff --git a/5.7/Dockerfile b/5.7/Dockerfile index 8fc818d30..0ca9d9df3 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -14,7 +14,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.28 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.29 ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.18 # Install server diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 7f1d7dd2a..33039b049 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.28-1.1.13" +echo "[Entrypoint] MySQL Docker Image 5.7.29-1.1.13" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -201,7 +201,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.7.28-1.1.13" + echo "[Entrypoint] Starting MySQL 5.7.29-1.1.13" fi exec "$@" diff --git a/5.7/inspec/control.rb b/5.7/inspec/control.rb index f4124ed01..9f2e00445 100644 --- a/5.7/inspec/control.rb +++ b/5.7/inspec/control.rb @@ -12,7 +12,7 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '5.7.28.*' } + its ('version') { should match '5.7.29.*' } end end control 'shell-package' do diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 36a05b65f..5d7a0b615 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -14,7 +14,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.18 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.19 ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.18 # Install server diff --git a/8.0/docker-entrypoint.sh b/8.0/docker-entrypoint.sh index bc6285971..a80e2c541 100755 --- a/8.0/docker-entrypoint.sh +++ b/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.18-1.1.13" +echo "[Entrypoint] MySQL Docker Image 8.0.19-1.1.13" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -201,7 +201,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 8.0.18-1.1.13" + echo "[Entrypoint] Starting MySQL 8.0.19-1.1.13" fi exec "$@" diff --git a/8.0/inspec/control.rb b/8.0/inspec/control.rb index 7669d2c06..bce3f809f 100644 --- a/8.0/inspec/control.rb +++ b/8.0/inspec/control.rb @@ -12,7 +12,7 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.18.*' } + its ('version') { should match '8.0.19.*' } end end control 'shell-package' do diff --git a/VERSION b/VERSION index 36d5705b1..9b9e95488 100644 --- a/VERSION +++ b/VERSION @@ -1,9 +1,9 @@ IMAGE_VERSION=1.1.13 declare -A MYSQL_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["5.6"]=5.6.46 -MYSQL_SERVER_VERSIONS["5.7"]=5.7.28 -MYSQL_SERVER_VERSIONS["8.0"]=8.0.18 +MYSQL_SERVER_VERSIONS["5.6"]=5.6.47 +MYSQL_SERVER_VERSIONS["5.7"]=5.7.29 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.19 declare -A MYSQL_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["5.6"]="" From 299aab4c8283bb0f9c7bce04f56fd75d3df165f4 Mon Sep 17 00:00:00 2001 From: Piotr Obrzut Date: Mon, 18 Nov 2019 13:43:07 +0100 Subject: [PATCH 178/386] Added support for WSL to the build and test scripts Change-Id: I794456120aceda375faa60f5325a6bbb13831d08 --- build.sh | 8 ++++++++ manifest.sh | 8 ++++++++ test.sh | 10 ++++++++++ 3 files changed, 26 insertions(+) diff --git a/build.sh b/build.sh index 39439c78b..bb5e1369e 100755 --- a/build.sh +++ b/build.sh @@ -16,6 +16,14 @@ set -e source ./VERSION +if grep -q Microsoft /proc/version; then + echo "Running on Windows Subsystem for Linux" + # WSL doesn't have its own docker host, we have to use the one + # from Windows itself. + # https://medium.com/@sebagomez/installing-the-docker-client-on-ubuntus-windows-subsystem-for-linux-612b392a44c4 + export DOCKER_HOST=localhost:2375 +fi + ARCH=amd64; [ -n "$1" ] && ARCH=$1 MAJOR_VERSIONS=("${!MYSQL_SERVER_VERSIONS[@]}"); [ -n "$2" ] && MAJOR_VERSIONS=("${@:2}") diff --git a/manifest.sh b/manifest.sh index 10b2845fa..e0392dfc9 100755 --- a/manifest.sh +++ b/manifest.sh @@ -16,6 +16,14 @@ set -e source ./VERSION +if grep -q Microsoft /proc/version; then + echo "Running on Windows Subsystem for Linux" + # WSL doesn't have its own docker host, we have to use the one + # from Windows itself. + # https://medium.com/@sebagomez/installing-the-docker-client-on-ubuntus-windows-subsystem-for-linux-612b392a44c4 + export DOCKER_HOST=localhost:2375 +fi + REPO=mysql/mysql-server; [ -n "$1" ] && REPO=$1 for MAJOR_VERSION in ${MULTIARCH_VERSIONS}; do diff --git a/test.sh b/test.sh index 0efdd5b3d..9ef5d6e4b 100755 --- a/test.sh +++ b/test.sh @@ -20,6 +20,16 @@ set -e source ./VERSION +if grep -q Microsoft /proc/version; then + echo "Running on Windows Subsystem for Linux" + # WSL doesn't have its own docker host, we have to use the one + # from Windows itself. + # https://medium.com/@sebagomez/installing-the-docker-client-on-ubuntus-windows-subsystem-for-linux-612b392a44c4 + export DOCKER_HOST=localhost:2375 + shopt -s expand_aliases + alias inspec="cmd.exe /c C:/opscode/inspec/bin/inspec" +fi + ARCH=amd64; [ -n "$1" ] && ARCH=$1 MAJOR_VERSIONS=("${!MYSQL_SERVER_VERSIONS[@]}"); [ -n "$2" ] && MAJOR_VERSIONS=("${@:2}") From 4fd1e59e4bef5a8dc5e59c4d8c0afb4c9df9bd53 Mon Sep 17 00:00:00 2001 From: Piotr Obrzut Date: Wed, 4 Dec 2019 12:29:58 +0100 Subject: [PATCH 179/386] Bump image version Change-Id: I2bf98c71a25cc6479596599b4e23c003e62df2f9 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 9b9e95488..e96405cf5 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.1.13 +IMAGE_VERSION=1.1.14 declare -A MYSQL_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["5.6"]=5.6.47 From be02a07c29e60edc0d2c50cffa44f209301a8152 Mon Sep 17 00:00:00 2001 From: Piotr Obrzut Date: Tue, 7 Jan 2020 09:41:21 +0100 Subject: [PATCH 180/386] Bump shell and image version Change-Id: Idc2c0a894173dc9c163042f40bf388d755ffbe8c --- VERSION | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index e96405cf5..67db9dffd 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.1.14 +IMAGE_VERSION=1.1.15 declare -A MYSQL_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["5.6"]=5.6.47 @@ -7,8 +7,8 @@ MYSQL_SERVER_VERSIONS["8.0"]=8.0.19 declare -A MYSQL_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["5.6"]="" -MYSQL_SHELL_VERSIONS["5.7"]=8.0.18 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.18 +MYSQL_SHELL_VERSIONS["5.7"]=8.0.19 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.19 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["5.6"]="${MYSQL_SERVER_VERSIONS["5.6"]}-${IMAGE_VERSION}" From abe70cbbd8b6b4275ee6d82dd6adb0c8cd7cde94 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Mon, 13 Jan 2020 07:59:58 +0000 Subject: [PATCH 181/386] Release version 1.1.15 * Bump shell and image version * Bump image version * Added support for WSL to the build and test scripts * Bump server versions * Revert "Updated image base to OL8". * Updated image base to OL8 --- 5.6/docker-entrypoint.sh | 4 ++-- 5.7/Dockerfile | 2 +- 5.7/docker-entrypoint.sh | 4 ++-- 5.7/inspec/control.rb | 2 +- 8.0/Dockerfile | 2 +- 8.0/docker-entrypoint.sh | 4 ++-- 8.0/inspec/control.rb | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index 75b107627..7d96e57fd 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.6.47-1.1.13" +echo "[Entrypoint] MySQL Docker Image 5.6.47-1.1.15" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -201,7 +201,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.6.47-1.1.13" + echo "[Entrypoint] Starting MySQL 5.6.47-1.1.15" fi exec "$@" diff --git a/5.7/Dockerfile b/5.7/Dockerfile index 0ca9d9df3..49c3b7828 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -15,7 +15,7 @@ FROM oraclelinux:7-slim ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.29 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.18 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.19 # Install server RUN yum install -y https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 33039b049..2569ac7c4 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.29-1.1.13" +echo "[Entrypoint] MySQL Docker Image 5.7.29-1.1.15" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -201,7 +201,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.7.29-1.1.13" + echo "[Entrypoint] Starting MySQL 5.7.29-1.1.15" fi exec "$@" diff --git a/5.7/inspec/control.rb b/5.7/inspec/control.rb index 9f2e00445..b4d1ac9ce 100644 --- a/5.7/inspec/control.rb +++ b/5.7/inspec/control.rb @@ -19,6 +19,6 @@ impact 0.5 describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.18.*' } + its ('version') { should match '8.0.19.*' } end end diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 5d7a0b615..9e4115a84 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -15,7 +15,7 @@ FROM oraclelinux:7-slim ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.19 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.18 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.19 # Install server RUN yum install -y https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ diff --git a/8.0/docker-entrypoint.sh b/8.0/docker-entrypoint.sh index a80e2c541..fb6333bbf 100755 --- a/8.0/docker-entrypoint.sh +++ b/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.19-1.1.13" +echo "[Entrypoint] MySQL Docker Image 8.0.19-1.1.15" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -201,7 +201,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 8.0.19-1.1.13" + echo "[Entrypoint] Starting MySQL 8.0.19-1.1.15" fi exec "$@" diff --git a/8.0/inspec/control.rb b/8.0/inspec/control.rb index bce3f809f..8cce47253 100644 --- a/8.0/inspec/control.rb +++ b/8.0/inspec/control.rb @@ -19,6 +19,6 @@ impact 0.5 describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.18.*' } + its ('version') { should match '8.0.19.*' } end end From ae32861dc466bc7f769277ae694a1d55e8bfd091 Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Mon, 9 Mar 2020 12:46:23 +0100 Subject: [PATCH 182/386] Bumped versions for release Change-Id: I80e316acf0a92da719f4e300ccac31f65c425e92 --- VERSION | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/VERSION b/VERSION index 67db9dffd..d6ff857c9 100644 --- a/VERSION +++ b/VERSION @@ -1,14 +1,14 @@ -IMAGE_VERSION=1.1.15 +IMAGE_VERSION=1.1.16 declare -A MYSQL_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["5.6"]=5.6.47 -MYSQL_SERVER_VERSIONS["5.7"]=5.7.29 -MYSQL_SERVER_VERSIONS["8.0"]=8.0.19 +MYSQL_SERVER_VERSIONS["5.6"]=5.6.48 +MYSQL_SERVER_VERSIONS["5.7"]=5.7.30 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.20 declare -A MYSQL_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["5.6"]="" -MYSQL_SHELL_VERSIONS["5.7"]=8.0.19 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.19 +MYSQL_SHELL_VERSIONS["5.7"]=8.0.20 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.20 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["5.6"]="${MYSQL_SERVER_VERSIONS["5.6"]}-${IMAGE_VERSION}" From 26296a305c53a5ec21698d9273d2048995ab2c13 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Mon, 27 Apr 2020 05:05:49 +0000 Subject: [PATCH 183/386] Release version 1.1.16 * Bumped versions for release --- 5.6/Dockerfile | 2 +- 5.6/docker-entrypoint.sh | 4 ++-- 5.6/inspec/control.rb | 2 +- 5.7/Dockerfile | 4 ++-- 5.7/docker-entrypoint.sh | 4 ++-- 5.7/inspec/control.rb | 4 ++-- 8.0/Dockerfile | 4 ++-- 8.0/docker-entrypoint.sh | 4 ++-- 8.0/inspec/control.rb | 4 ++-- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/5.6/Dockerfile b/5.6/Dockerfile index 7fd2fc325..90789b932 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -14,7 +14,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.6.47 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.6.48 ARG MYSQL_SHELL_PACKAGE= # Install server diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index 7d96e57fd..d0f5fd303 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.6.47-1.1.15" +echo "[Entrypoint] MySQL Docker Image 5.6.48-1.1.16" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -201,7 +201,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.6.47-1.1.15" + echo "[Entrypoint] Starting MySQL 5.6.48-1.1.16" fi exec "$@" diff --git a/5.6/inspec/control.rb b/5.6/inspec/control.rb index 778a1e997..effc47b3f 100644 --- a/5.6/inspec/control.rb +++ b/5.6/inspec/control.rb @@ -12,6 +12,6 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '5.6.47.*' } + its ('version') { should match '5.6.48.*' } end end diff --git a/5.7/Dockerfile b/5.7/Dockerfile index 49c3b7828..e558d7867 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.29 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.19 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.30 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.20 # Install server RUN yum install -y https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 2569ac7c4..36efb5f7a 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.29-1.1.15" +echo "[Entrypoint] MySQL Docker Image 5.7.30-1.1.16" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -201,7 +201,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.7.29-1.1.15" + echo "[Entrypoint] Starting MySQL 5.7.30-1.1.16" fi exec "$@" diff --git a/5.7/inspec/control.rb b/5.7/inspec/control.rb index b4d1ac9ce..3ebdeceff 100644 --- a/5.7/inspec/control.rb +++ b/5.7/inspec/control.rb @@ -12,13 +12,13 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '5.7.29.*' } + its ('version') { should match '5.7.30.*' } end end control 'shell-package' do impact 0.5 describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.19.*' } + its ('version') { should match '8.0.20.*' } end end diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 9e4115a84..3aeb8536e 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.19 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.19 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.20 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.20 # Install server RUN yum install -y https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ diff --git a/8.0/docker-entrypoint.sh b/8.0/docker-entrypoint.sh index fb6333bbf..3fbaf4ee1 100755 --- a/8.0/docker-entrypoint.sh +++ b/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.19-1.1.15" +echo "[Entrypoint] MySQL Docker Image 8.0.20-1.1.16" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -201,7 +201,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 8.0.19-1.1.15" + echo "[Entrypoint] Starting MySQL 8.0.20-1.1.16" fi exec "$@" diff --git a/8.0/inspec/control.rb b/8.0/inspec/control.rb index 8cce47253..c0bfb792a 100644 --- a/8.0/inspec/control.rb +++ b/8.0/inspec/control.rb @@ -12,13 +12,13 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.19.*' } + its ('version') { should match '8.0.20.*' } end end control 'shell-package' do impact 0.5 describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.19.*' } + its ('version') { should match '8.0.20.*' } end end From 2acac9dcb5edcce9925f6facdb2886d7a8636a0b Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Mon, 27 Apr 2020 16:04:50 +0000 Subject: [PATCH 184/386] Release version 1.1.16 From 7ac49da62cda29222a293dc7e8c2fc9f3844103c Mon Sep 17 00:00:00 2001 From: Piotr Obrzut Date: Mon, 18 May 2020 13:44:37 +0200 Subject: [PATCH 185/386] BUG#30750730 Enable server 8.0 'Restart' command Change-Id: Ia970ea2a942716f21c145a965c14753c995a0377 --- gen_dockerfiles.sh | 7 +++++++ template/docker-entrypoint.sh | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gen_dockerfiles.sh b/gen_dockerfiles.sh index 1393f4c7e..5b844fccf 100755 --- a/gen_dockerfiles.sh +++ b/gen_dockerfiles.sh @@ -50,6 +50,12 @@ INIT_STARTUP["5.6"]="\"\$@\" --skip-networking --socket=\"\$SOCKET\" \&" INIT_STARTUP["5.7"]="\"\$@\" --daemonize --skip-networking --socket=\"\$SOCKET\"" INIT_STARTUP["8.0"]="\"\$@\" --daemonize --skip-networking --socket=\"\$SOCKET\"" +declare -A STARTUP +STARTUP["5.5"]="exec \"\$@\"" +STARTUP["5.6"]="exec \"\$@\"" +STARTUP["5.7"]="exec \"\$@\"" +STARTUP["8.0"]="env MYSQLD_PARENT_PID=\$\$ \"\$@\"" + declare -A STARTUP_WAIT STARTUP_WAIT["5.5"]="\"yes\"" STARTUP_WAIT["5.6"]="\"yes\"" @@ -122,6 +128,7 @@ do sed -i 's#%%EXPIRE_SUPPORT%%#'"${EXPIRE_SUPPORT[${VERSION}]}"'#g' tmpfile sed -i 's#%%SED_TZINFO%%#'"${TZINFO_WORKAROUND[${VERSION}]}"'#g' tmpfile sed -i 's#%%INIT_STARTUP%%#'"${INIT_STARTUP[${VERSION}]}"'#g' tmpfile + sed -i 's#%%STARTUP%%#'"${STARTUP[${VERSION}]}"'#g' tmpfile sed -i 's#%%STARTUP_WAIT%%#'"${STARTUP_WAIT[${VERSION}]}"'#g' tmpfile sed -i 's#%%FULL_SERVER_VERSION%%#'"${FULL_SERVER_VERSIONS[${VERSION}]}"'#g' tmpfile sed -i 's#%%DEFAULT_LOG%%#'"${DEFAULT_LOG[${VERSION}]}"'#g' tmpfile diff --git a/template/docker-entrypoint.sh b/template/docker-entrypoint.sh index 91bf41ee4..b9553159a 100644 --- a/template/docker-entrypoint.sh +++ b/template/docker-entrypoint.sh @@ -204,5 +204,5 @@ EOF echo "[Entrypoint] Starting MySQL %%FULL_SERVER_VERSION%%" fi -exec "$@" +%%STARTUP%% From 358bc05550793cd55537793ab6ec1fb44fc47be8 Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Mon, 1 Jun 2020 14:13:54 +0200 Subject: [PATCH 186/386] Bumped versions for July20 release Change-Id: I8168d1bc36569849fa64e9034a4d8100c15dc35d --- VERSION | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/VERSION b/VERSION index d6ff857c9..451bbf134 100644 --- a/VERSION +++ b/VERSION @@ -1,14 +1,14 @@ -IMAGE_VERSION=1.1.16 +IMAGE_VERSION=1.1.17 declare -A MYSQL_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["5.6"]=5.6.48 -MYSQL_SERVER_VERSIONS["5.7"]=5.7.30 -MYSQL_SERVER_VERSIONS["8.0"]=8.0.20 +MYSQL_SERVER_VERSIONS["5.6"]=5.6.49 +MYSQL_SERVER_VERSIONS["5.7"]=5.7.31 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.21 declare -A MYSQL_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["5.6"]="" -MYSQL_SHELL_VERSIONS["5.7"]=8.0.20 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.20 +MYSQL_SHELL_VERSIONS["5.7"]=8.0.21 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.21 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["5.6"]="${MYSQL_SERVER_VERSIONS["5.6"]}-${IMAGE_VERSION}" From fe80e8b4f09b971254028a155be768ea2a5d048d Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Mon, 13 Jul 2020 05:21:57 +0000 Subject: [PATCH 187/386] Release version 1.1.17 * Bumped versions for July20 release * BUG#30750730 Enable server 8.0 'Restart' command * Release version 1.1.16 --- 5.6/Dockerfile | 2 +- 5.6/docker-entrypoint.sh | 4 ++-- 5.6/inspec/control.rb | 2 +- 5.7/Dockerfile | 4 ++-- 5.7/docker-entrypoint.sh | 4 ++-- 5.7/inspec/control.rb | 4 ++-- 8.0/Dockerfile | 4 ++-- 8.0/docker-entrypoint.sh | 6 +++--- 8.0/inspec/control.rb | 4 ++-- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/5.6/Dockerfile b/5.6/Dockerfile index 90789b932..1adcbb6bd 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -14,7 +14,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.6.48 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.6.49 ARG MYSQL_SHELL_PACKAGE= # Install server diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index d0f5fd303..d1b8f30a3 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.6.48-1.1.16" +echo "[Entrypoint] MySQL Docker Image 5.6.49-1.1.17" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -201,7 +201,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.6.48-1.1.16" + echo "[Entrypoint] Starting MySQL 5.6.49-1.1.17" fi exec "$@" diff --git a/5.6/inspec/control.rb b/5.6/inspec/control.rb index effc47b3f..ae3cdc2c3 100644 --- a/5.6/inspec/control.rb +++ b/5.6/inspec/control.rb @@ -12,6 +12,6 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '5.6.48.*' } + its ('version') { should match '5.6.49.*' } end end diff --git a/5.7/Dockerfile b/5.7/Dockerfile index e558d7867..47dc33a92 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.30 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.20 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.31 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.21 # Install server RUN yum install -y https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 36efb5f7a..45d13abd3 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.30-1.1.16" +echo "[Entrypoint] MySQL Docker Image 5.7.31-1.1.17" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -201,7 +201,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.7.30-1.1.16" + echo "[Entrypoint] Starting MySQL 5.7.31-1.1.17" fi exec "$@" diff --git a/5.7/inspec/control.rb b/5.7/inspec/control.rb index 3ebdeceff..01dc109c4 100644 --- a/5.7/inspec/control.rb +++ b/5.7/inspec/control.rb @@ -12,13 +12,13 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '5.7.30.*' } + its ('version') { should match '5.7.31.*' } end end control 'shell-package' do impact 0.5 describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.20.*' } + its ('version') { should match '8.0.21.*' } end end diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 3aeb8536e..4d3fc7f67 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.20 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.20 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.21 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.21 # Install server RUN yum install -y https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ diff --git a/8.0/docker-entrypoint.sh b/8.0/docker-entrypoint.sh index 3fbaf4ee1..3fa594b15 100755 --- a/8.0/docker-entrypoint.sh +++ b/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.20-1.1.16" +echo "[Entrypoint] MySQL Docker Image 8.0.21-1.1.17" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -201,8 +201,8 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 8.0.20-1.1.16" + echo "[Entrypoint] Starting MySQL 8.0.21-1.1.17" fi -exec "$@" +env MYSQLD_PARENT_PID=$$ "$@" diff --git a/8.0/inspec/control.rb b/8.0/inspec/control.rb index c0bfb792a..9f956638a 100644 --- a/8.0/inspec/control.rb +++ b/8.0/inspec/control.rb @@ -12,13 +12,13 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.20.*' } + its ('version') { should match '8.0.21.*' } end end control 'shell-package' do impact 0.5 describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.20.*' } + its ('version') { should match '8.0.21.*' } end end From 4aa7a78bfbc14a45c83e6e8c81e4d877bb443a07 Mon Sep 17 00:00:00 2001 From: Piotr Obrzut Date: Thu, 16 Jul 2020 11:27:38 +0200 Subject: [PATCH 188/386] BUG#31627536 Expose GR port for server 8.0 Change-Id: I4d863e9226b2ea618f90e4717d7f38124e2f1bff --- gen_dockerfiles.sh | 7 ++++++- template/control.rb | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gen_dockerfiles.sh b/gen_dockerfiles.sh index 5b844fccf..b4acce3ef 100755 --- a/gen_dockerfiles.sh +++ b/gen_dockerfiles.sh @@ -28,7 +28,7 @@ declare -A PORTS PORTS["5.5"]="3306" PORTS["5.6"]="3306" PORTS["5.7"]="3306 33060" -PORTS["8.0"]="3306 33060" +PORTS["8.0"]="3306 33060 33061" declare -A PASSWORDSET PASSWORDSET["5.5"]="SET PASSWORD FOR 'root'@'localhost'=PASSWORD('\${MYSQL_ROOT_PASSWORD}');" @@ -116,6 +116,11 @@ do if [ "${VERSION}" == "5.7" ] || [ "${VERSION}" == "8.0" ]; then sed 's#%%MYSQL_SERVER_VERSION%%#'"${MYSQL_SERVER_VERSIONS[${VERSION}]}"'#g' template/control.rb > tmpFile sed -i 's#%%MYSQL_SHELL_VERSION%%#'"${MYSQL_SHELL_VERSIONS[${VERSION}]}"'#g' tmpFile + if [ "${VERSION}" == "5.7" ]; then + sed -i 's#%%PORTS%%#'"3306/tcp, 33060/tcp"'#g' tmpFile + else + sed -i 's#%%PORTS%%#'"3306/tcp, 33060-33061/tcp"'#g' tmpFile + fi mv tmpFile "${VERSION}/inspec/control.rb" else sed 's#%%MYSQL_SERVER_VERSION%%#'"${MYSQL_SERVER_VERSIONS[${VERSION}]}"'#g' template/control_pre57.rb > tmpFile diff --git a/template/control.rb b/template/control.rb index 850058f9c..3c6db8d4b 100644 --- a/template/control.rb +++ b/template/control.rb @@ -4,7 +4,7 @@ it { should exist } it { should be_running } its('repo') { should eq 'mysql/mysql-server' } - its('ports') { should eq '3306/tcp, 33060/tcp' } + its('ports') { should eq '%%PORTS%%' } its('command') { should match '/entrypoint.sh mysqld' } end end From 9b2911a8ba6cc3d8e2444c6474435bb3636feea0 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Wed, 12 Aug 2020 09:40:19 +0200 Subject: [PATCH 189/386] Escape ampersand in gen_dockerfiles.sh replacement value An unescaped ampersand will be replaced with the back-reference value by sed, garbling the result. Thanks to Tsubasa Tanaka for the contribution! Change-Id: Id3b8781008a25ba55599d0ae589d766d83760e08 --- gen_dockerfiles.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gen_dockerfiles.sh b/gen_dockerfiles.sh index b4acce3ef..5927cfab6 100755 --- a/gen_dockerfiles.sh +++ b/gen_dockerfiles.sh @@ -87,8 +87,8 @@ DEFAULT_LOG["8.0"]="console" # MySQL 8.0 supports a call to validate the config, while older versions have it as a side # effect of running --verbose --help declare -A VALIDATE_CONFIG -VALIDATE_CONFIG["5.6"]="output=\$(\"\$@\" --verbose --help 2>&1 > /dev/null) || result=\$?" -VALIDATE_CONFIG["5.7"]="output=\$(\"\$@\" --verbose --help 2>&1 > /dev/null) || result=\$?" +VALIDATE_CONFIG["5.6"]="output=\$(\"\$@\" --verbose --help 2>\&1 > /dev/null) || result=\$?" +VALIDATE_CONFIG["5.7"]="output=\$(\"\$@\" --verbose --help 2>\&1 > /dev/null) || result=\$?" VALIDATE_CONFIG["8.0"]="output=\$(\"\$@\" --validate-config) || result=\$?" for VERSION in "${!MYSQL_SERVER_VERSIONS[@]}" From b82def518c23e09f064eedd96ab236381db7cf2a Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Mon, 24 Aug 2020 06:39:11 +0200 Subject: [PATCH 190/386] Bumped versions for October20 release Change-Id: I32ed9abe6f44fa8269418b7bd450d5cd98e087bd --- VERSION | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index 451bbf134..addd5ab39 100644 --- a/VERSION +++ b/VERSION @@ -1,9 +1,9 @@ -IMAGE_VERSION=1.1.17 +IMAGE_VERSION=1.1.18 declare -A MYSQL_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["5.6"]=5.6.49 -MYSQL_SERVER_VERSIONS["5.7"]=5.7.31 -MYSQL_SERVER_VERSIONS["8.0"]=8.0.21 +MYSQL_SERVER_VERSIONS["5.6"]=5.6.50 +MYSQL_SERVER_VERSIONS["5.7"]=5.7.32 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.22 declare -A MYSQL_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["5.6"]="" From d28b0793bf22e8269039d0315a29ecfcb748af89 Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Mon, 7 Sep 2020 10:21:43 +0200 Subject: [PATCH 191/386] Bumped shell versions for 8.0.22 release Change-Id: I6ae640778f0e72e6c459100cefffd7530245c432 --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index addd5ab39..53383207d 100644 --- a/VERSION +++ b/VERSION @@ -7,8 +7,8 @@ MYSQL_SERVER_VERSIONS["8.0"]=8.0.22 declare -A MYSQL_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["5.6"]="" -MYSQL_SHELL_VERSIONS["5.7"]=8.0.21 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.21 +MYSQL_SHELL_VERSIONS["5.7"]=8.0.22 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.22 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["5.6"]="${MYSQL_SERVER_VERSIONS["5.6"]}-${IMAGE_VERSION}" From c98cb34df81123be148c1c5bf613870a1d830348 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Thu, 13 Jun 2019 09:21:16 +0200 Subject: [PATCH 192/386] Remove references to 5.5 The major version is EOL Change-Id: I98afec078f0610eace7b9e832b3326ee70ab7f19 --- README.md | 2 -- gen_dockerfiles.sh | 10 +--------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/README.md b/README.md index c6a4ff7f5..827de0591 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,6 @@ Supported Tags and Respective Dockerfile Links These are tags for some of the optimized MySQL Server Docker images, created and maintained by the MySQL team at Oracle (for a full list, see [the Tags tab of this page](https://hub.docker.com/r/mysql/mysql-server/tags/)). [DS] The tags are updated directly on the posted Markdown versions by RE after eahc release, so it might remain outdated in this DocBook source file. -- MySQL Server 5.5 (tag: [`5.5`, `5.5.62`, `5.5.62-1.1.8`](https://github.com/mysql/mysql-docker/blob/mysql-server/5.5/Dockerfile)) ([mysql-server/5.5/Dockerfile](https://github.com/mysql/mysql-docker/blob/mysql-server/5.5/Dockerfile)) - - MySQL Server 5.6 (tag: [`5.6`, `5.6.42`, `5.6.42-1.1.8`](https://github.com/mysql/mysql-docker/blob/mysql-server/5.6/Dockerfile)) ([mysql-server/5.6/Dockerfile](https://github.com/mysql/mysql-docker/blob/mysql-server/5.6/Dockerfile)) - MySQL Server 5.7 (tag: [`5.7`, `5.7.24`, `5.7.24-1.1.8`](https://github.com/mysql/mysql-docker/blob/mysql-server/5.7/Dockerfile)) ([mysql-server/5.7/Dockerfile](https://github.com/mysql/mysql-docker/blob/mysql-server/5.7/Dockerfile)) diff --git a/gen_dockerfiles.sh b/gen_dockerfiles.sh index 5927cfab6..2c450e75e 100755 --- a/gen_dockerfiles.sh +++ b/gen_dockerfiles.sh @@ -25,19 +25,16 @@ REPO=https://repo.mysql.com; [ -n "$1" ] && REPO=$1 # 33060 is the default port for the mysqlx plugin, new to 5.7 declare -A PORTS -PORTS["5.5"]="3306" PORTS["5.6"]="3306" PORTS["5.7"]="3306 33060" PORTS["8.0"]="3306 33060 33061" declare -A PASSWORDSET -PASSWORDSET["5.5"]="SET PASSWORD FOR 'root'@'localhost'=PASSWORD('\${MYSQL_ROOT_PASSWORD}');" -PASSWORDSET["5.6"]=${PASSWORDSET["5.5"]} +PASSWORDSET["5.6"]="SET PASSWORD FOR 'root'@'localhost'=PASSWORD('\${MYSQL_ROOT_PASSWORD}');" PASSWORDSET["5.7"]="ALTER USER 'root'@'localhost' IDENTIFIED BY '\${MYSQL_ROOT_PASSWORD}';" PASSWORDSET["8.0"]=${PASSWORDSET["5.7"]} declare -A DATABASE_INIT -DATABASE_INIT["5.5"]="mysql_install_db --user=mysql --datadir=\"\$DATADIR\" --rpm" DATABASE_INIT["5.6"]="mysql_install_db --user=mysql --datadir=\"\$DATADIR\" --rpm --keep-my-cnf" DATABASE_INIT["5.7"]="\"\$@\" --initialize-insecure" DATABASE_INIT["8.0"]="\"\$@\" --initialize-insecure" @@ -45,7 +42,6 @@ DATABASE_INIT["8.0"]="\"\$@\" --initialize-insecure" # 5.7+ has the --daemonize flag, which makes the process fork and then exit when # the server is ready, removing the need for a fragile wait loop declare -A INIT_STARTUP -INIT_STARTUP["5.5"]="\"\$@\" --skip-networking --socket=\"\$SOCKET\" \&" INIT_STARTUP["5.6"]="\"\$@\" --skip-networking --socket=\"\$SOCKET\" \&" INIT_STARTUP["5.7"]="\"\$@\" --daemonize --skip-networking --socket=\"\$SOCKET\"" INIT_STARTUP["8.0"]="\"\$@\" --daemonize --skip-networking --socket=\"\$SOCKET\"" @@ -57,7 +53,6 @@ STARTUP["5.7"]="exec \"\$@\"" STARTUP["8.0"]="env MYSQLD_PARENT_PID=\$\$ \"\$@\"" declare -A STARTUP_WAIT -STARTUP_WAIT["5.5"]="\"yes\"" STARTUP_WAIT["5.6"]="\"yes\"" STARTUP_WAIT["5.7"]="\"\"" STARTUP_WAIT["8.0"]="\"\"" @@ -65,21 +60,18 @@ STARTUP_WAIT["8.0"]="\"\"" # The option to set a user as expired, (forcing a password change before # any other action can be taken) was added in 5.6 declare -A EXPIRE_SUPPORT -EXPIRE_SUPPORT["5.5"]="\"\"" EXPIRE_SUPPORT["5.6"]="\"yes\"" EXPIRE_SUPPORT["5.7"]="\"yes\"" EXPIRE_SUPPORT["8.0"]="\"yes\"" # sed is for https://bugs.mysql.com/bug.php?id=20545 declare -A TZINFO_WORKAROUND -TZINFO_WORKAROUND["5.5"]="sed 's/Local time zone must be set--see zic manual page/FCTY/' | " TZINFO_WORKAROUND["5.6"]="sed 's/Local time zone must be set--see zic manual page/FCTY/' | " TZINFO_WORKAROUND["5.7"]="" TZINFO_WORKAROUND["8.0"]="" # Logging to console (stderr) makes server log available with the «docker logs command» declare -A DEFAULT_LOG -DEFAULT_LOG["5.5"]="" DEFAULT_LOG["5.6"]="" DEFAULT_LOG["5.7"]="" DEFAULT_LOG["8.0"]="console" From e2a7a94650aa42cb81d5baba4b3c4da6d9bdb45e Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Mon, 19 Oct 2020 05:36:47 +0000 Subject: [PATCH 193/386] Release version 1.1.18 * Remove references to 5.5 * Bumped shell versions for 8.0.22 release * Bumped versions for October20 release * Escape ampersand in gen_dockerfiles.sh replacement value * BUG#31627536 Expose GR port for server 8.0 --- 5.6/Dockerfile | 2 +- 5.6/docker-entrypoint.sh | 6 +++--- 5.6/inspec/control.rb | 2 +- 5.7/Dockerfile | 4 ++-- 5.7/docker-entrypoint.sh | 6 +++--- 5.7/inspec/control.rb | 4 ++-- 8.0/Dockerfile | 6 +++--- 8.0/docker-entrypoint.sh | 4 ++-- 8.0/inspec/control.rb | 6 +++--- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/5.6/Dockerfile b/5.6/Dockerfile index 1adcbb6bd..8f08f8a4e 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -14,7 +14,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.6.49 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.6.50 ARG MYSQL_SHELL_PACKAGE= # Install server diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index d1b8f30a3..92a289e35 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.6.49-1.1.17" +echo "[Entrypoint] MySQL Docker Image 5.6.50-1.1.18" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -35,7 +35,7 @@ if [ "$1" = 'mysqld' ]; then # Test that the server can start. We redirect stdout to /dev/null so # only the error messages are left. result=0 - output=$("$@" --verbose --help 2>%%VALIDATE_CONFIG%%1 > /dev/null) || result=$? + output=$("$@" --verbose --help 2>&1 > /dev/null) || result=$? if [ ! "$result" = "0" ]; then echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' echo >&2 "[Entrypoint] $output" @@ -201,7 +201,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.6.49-1.1.17" + echo "[Entrypoint] Starting MySQL 5.6.50-1.1.18" fi exec "$@" diff --git a/5.6/inspec/control.rb b/5.6/inspec/control.rb index ae3cdc2c3..d71793bfe 100644 --- a/5.6/inspec/control.rb +++ b/5.6/inspec/control.rb @@ -12,6 +12,6 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '5.6.49.*' } + its ('version') { should match '5.6.50.*' } end end diff --git a/5.7/Dockerfile b/5.7/Dockerfile index 47dc33a92..b845e5925 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.31 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.21 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.32 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.22 # Install server RUN yum install -y https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 45d13abd3..520279e71 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.31-1.1.17" +echo "[Entrypoint] MySQL Docker Image 5.7.32-1.1.18" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -35,7 +35,7 @@ if [ "$1" = 'mysqld' ]; then # Test that the server can start. We redirect stdout to /dev/null so # only the error messages are left. result=0 - output=$("$@" --verbose --help 2>%%VALIDATE_CONFIG%%1 > /dev/null) || result=$? + output=$("$@" --verbose --help 2>&1 > /dev/null) || result=$? if [ ! "$result" = "0" ]; then echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' echo >&2 "[Entrypoint] $output" @@ -201,7 +201,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.7.31-1.1.17" + echo "[Entrypoint] Starting MySQL 5.7.32-1.1.18" fi exec "$@" diff --git a/5.7/inspec/control.rb b/5.7/inspec/control.rb index 01dc109c4..25cbd36f8 100644 --- a/5.7/inspec/control.rb +++ b/5.7/inspec/control.rb @@ -12,13 +12,13 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '5.7.31.*' } + its ('version') { should match '5.7.32.*' } end end control 'shell-package' do impact 0.5 describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.21.*' } + its ('version') { should match '8.0.22.*' } end end diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 4d3fc7f67..f165d35da 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.21 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.21 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.22 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.22 # Install server RUN yum install -y https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ @@ -34,6 +34,6 @@ COPY docker-entrypoint.sh /entrypoint.sh COPY healthcheck.sh /healthcheck.sh ENTRYPOINT ["/entrypoint.sh"] HEALTHCHECK CMD /healthcheck.sh -EXPOSE 3306 33060 +EXPOSE 3306 33060 33061 CMD ["mysqld"] diff --git a/8.0/docker-entrypoint.sh b/8.0/docker-entrypoint.sh index 3fa594b15..b26de99b5 100755 --- a/8.0/docker-entrypoint.sh +++ b/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.21-1.1.17" +echo "[Entrypoint] MySQL Docker Image 8.0.22-1.1.18" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -201,7 +201,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 8.0.21-1.1.17" + echo "[Entrypoint] Starting MySQL 8.0.22-1.1.18" fi env MYSQLD_PARENT_PID=$$ "$@" diff --git a/8.0/inspec/control.rb b/8.0/inspec/control.rb index 9f956638a..377c09d04 100644 --- a/8.0/inspec/control.rb +++ b/8.0/inspec/control.rb @@ -4,7 +4,7 @@ it { should exist } it { should be_running } its('repo') { should eq 'mysql/mysql-server' } - its('ports') { should eq '3306/tcp, 33060/tcp' } + its('ports') { should eq '3306/tcp, 33060-33061/tcp' } its('command') { should match '/entrypoint.sh mysqld' } end end @@ -12,13 +12,13 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.21.*' } + its ('version') { should match '8.0.22.*' } end end control 'shell-package' do impact 0.5 describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.21.*' } + its ('version') { should match '8.0.22.*' } end end From b6530413420098770b00b6303512216b5061bb9a Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Tue, 1 Dec 2020 06:00:17 +0100 Subject: [PATCH 194/386] Bumped versions for January'21 release Change-Id: Ib29d3808dcb603c212856e87adbfeeceedcb2bb4 --- VERSION | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/VERSION b/VERSION index 53383207d..707b0f957 100644 --- a/VERSION +++ b/VERSION @@ -1,14 +1,14 @@ -IMAGE_VERSION=1.1.18 +IMAGE_VERSION=1.1.19 declare -A MYSQL_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["5.6"]=5.6.50 -MYSQL_SERVER_VERSIONS["5.7"]=5.7.32 -MYSQL_SERVER_VERSIONS["8.0"]=8.0.22 +MYSQL_SERVER_VERSIONS["5.7"]=5.7.33 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.23 declare -A MYSQL_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["5.6"]="" -MYSQL_SHELL_VERSIONS["5.7"]=8.0.22 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.22 +MYSQL_SHELL_VERSIONS["5.7"]=8.0.23 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.23 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["5.6"]="${MYSQL_SERVER_VERSIONS["5.6"]}-${IMAGE_VERSION}" From 0c46948885b996f74171c5b88cf7d598aef7b05f Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Wed, 2 Dec 2020 15:26:08 +0100 Subject: [PATCH 195/386] Revert shell version to 8.0.22 Change-Id: I533eb198bc6a2814311aca2033d8699cc998575f --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 707b0f957..8617febdd 100644 --- a/VERSION +++ b/VERSION @@ -7,8 +7,8 @@ MYSQL_SERVER_VERSIONS["8.0"]=8.0.23 declare -A MYSQL_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["5.6"]="" -MYSQL_SHELL_VERSIONS["5.7"]=8.0.23 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.23 +MYSQL_SHELL_VERSIONS["5.7"]=8.0.22 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.22 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["5.6"]="${MYSQL_SERVER_VERSIONS["5.6"]}-${IMAGE_VERSION}" From 53b06b1303923057e0e6ca82c9e41bc411fb26df Mon Sep 17 00:00:00 2001 From: Robert Neumayer Date: Mon, 14 Dec 2020 09:53:27 +0100 Subject: [PATCH 196/386] Use --no-color for inspec exec Change-Id: I12fe177e918c89fb1256c13483324c6bea6d75bc --- test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test.sh b/test.sh index 9ef5d6e4b..1f7536c7a 100755 --- a/test.sh +++ b/test.sh @@ -42,8 +42,8 @@ for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do fi done docker run -d --name mysql-server mysql/mysql-server:"$MAJOR_VERSION$ARCH_SUFFIX" - inspec exec "$MAJOR_VERSION/inspec/control.rb" --controls container - inspec exec "$MAJOR_VERSION/inspec/control.rb" -t docker://mysql-server --controls server-package + inspec exec --no-color "$MAJOR_VERSION/inspec/control.rb" --controls container + inspec exec --no-color "$MAJOR_VERSION/inspec/control.rb" -t docker://mysql-server --controls server-package if [ "${MAJOR_VERSION}" == "5.7" ] || [ "${MAJOR_VERSION}" == "8.0" ]; then inspec exec "$MAJOR_VERSION/inspec/control.rb" -t docker://mysql-server --controls shell-package fi From 2a25646ab7ea5d3e681502f8ba27bf45ec1180d5 Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Tue, 5 Jan 2021 05:39:39 +0100 Subject: [PATCH 197/386] Updated the server version for 5.6.51 release Change-Id: I5fcd10c880992e8c212ef3bc357951c59b9e06b8 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 8617febdd..e6e3e593d 100644 --- a/VERSION +++ b/VERSION @@ -1,7 +1,7 @@ IMAGE_VERSION=1.1.19 declare -A MYSQL_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["5.6"]=5.6.50 +MYSQL_SERVER_VERSIONS["5.6"]=5.6.51 MYSQL_SERVER_VERSIONS["5.7"]=5.7.33 MYSQL_SERVER_VERSIONS["8.0"]=8.0.23 From b4405db9783ca814c8ac6e068c0826b803f49c2d Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Tue, 19 Jan 2021 14:15:32 +0000 Subject: [PATCH 198/386] Release version 1.1.19 * Updated the server version for 5.6.51 release * Use --no-color for inspec exec * Revert shell version to 8.0.22 * Bumped versions for January'21 release --- 5.6/Dockerfile | 2 +- 5.6/docker-entrypoint.sh | 4 ++-- 5.6/inspec/control.rb | 2 +- 5.7/Dockerfile | 2 +- 5.7/docker-entrypoint.sh | 4 ++-- 5.7/inspec/control.rb | 2 +- 8.0/Dockerfile | 2 +- 8.0/docker-entrypoint.sh | 4 ++-- 8.0/inspec/control.rb | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/5.6/Dockerfile b/5.6/Dockerfile index 8f08f8a4e..017f53eb5 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -14,7 +14,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.6.50 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.6.51 ARG MYSQL_SHELL_PACKAGE= # Install server diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index 92a289e35..d6a13a65e 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.6.50-1.1.18" +echo "[Entrypoint] MySQL Docker Image 5.6.51-1.1.19" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -201,7 +201,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.6.50-1.1.18" + echo "[Entrypoint] Starting MySQL 5.6.51-1.1.19" fi exec "$@" diff --git a/5.6/inspec/control.rb b/5.6/inspec/control.rb index d71793bfe..840e6cccb 100644 --- a/5.6/inspec/control.rb +++ b/5.6/inspec/control.rb @@ -12,6 +12,6 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '5.6.50.*' } + its ('version') { should match '5.6.51.*' } end end diff --git a/5.7/Dockerfile b/5.7/Dockerfile index b845e5925..3bf725df1 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -14,7 +14,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.32 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.33 ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.22 # Install server diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 520279e71..25828b808 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.32-1.1.18" +echo "[Entrypoint] MySQL Docker Image 5.7.33-1.1.19" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -201,7 +201,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 5.7.32-1.1.18" + echo "[Entrypoint] Starting MySQL 5.7.33-1.1.19" fi exec "$@" diff --git a/5.7/inspec/control.rb b/5.7/inspec/control.rb index 25cbd36f8..948d0daee 100644 --- a/5.7/inspec/control.rb +++ b/5.7/inspec/control.rb @@ -12,7 +12,7 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '5.7.32.*' } + its ('version') { should match '5.7.33.*' } end end control 'shell-package' do diff --git a/8.0/Dockerfile b/8.0/Dockerfile index f165d35da..7f1784061 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -14,7 +14,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.22 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.23 ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.22 # Install server diff --git a/8.0/docker-entrypoint.sh b/8.0/docker-entrypoint.sh index b26de99b5..24b5fbdf2 100755 --- a/8.0/docker-entrypoint.sh +++ b/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.22-1.1.18" +echo "[Entrypoint] MySQL Docker Image 8.0.23-1.1.19" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -201,7 +201,7 @@ password=healthcheckpass EOF touch /mysql-init-complete chown -R mysql:mysql "$DATADIR" - echo "[Entrypoint] Starting MySQL 8.0.22-1.1.18" + echo "[Entrypoint] Starting MySQL 8.0.23-1.1.19" fi env MYSQLD_PARENT_PID=$$ "$@" diff --git a/8.0/inspec/control.rb b/8.0/inspec/control.rb index 377c09d04..9901a17de 100644 --- a/8.0/inspec/control.rb +++ b/8.0/inspec/control.rb @@ -12,7 +12,7 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.22.*' } + its ('version') { should match '8.0.23.*' } end end control 'shell-package' do From 7e6244d0513f32889e001b654029b4b15a76942d Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 19 Jan 2021 17:22:26 +0100 Subject: [PATCH 199/386] Update shell version to 8.0.23 Change-Id: Ieb4dd67cc0ff5bab929d8beb8c5edf94d996098c --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index e6e3e593d..4efac2313 100644 --- a/VERSION +++ b/VERSION @@ -7,8 +7,8 @@ MYSQL_SERVER_VERSIONS["8.0"]=8.0.23 declare -A MYSQL_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["5.6"]="" -MYSQL_SHELL_VERSIONS["5.7"]=8.0.22 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.22 +MYSQL_SHELL_VERSIONS["5.7"]=8.0.23 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.23 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["5.6"]="${MYSQL_SERVER_VERSIONS["5.6"]}-${IMAGE_VERSION}" From 759e0cbdf12b37a3cedfde8e500a356c888a5e26 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Wed, 20 Jan 2021 08:21:34 +0100 Subject: [PATCH 200/386] Bump image version for out-of-cycle release to get correct shell version Change-Id: Id32c4c55d7ab8466b3de6c6bc7942f4c47303040 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 4efac2313..503bd88d7 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.1.19 +IMAGE_VERSION=1.1.19-2 declare -A MYSQL_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["5.6"]=5.6.51 From afdafbb654e4996c043eee4569fe24112ae33c8d Mon Sep 17 00:00:00 2001 From: Alfredo Kojima Date: Wed, 27 Jan 2021 18:11:52 -0800 Subject: [PATCH 201/386] Merged community server, router and mysql-cluster docker image branches. Change-Id: If6948f58b4b4239cdae744f4d1e20bd12393cc15 --- .gitignore | 1 + mysql-cluster/7.5/Dockerfile | 44 ++++ mysql-cluster/7.5/cnf/my.cnf | 22 ++ mysql-cluster/7.5/cnf/mysql-cluster.cnf | 39 ++++ mysql-cluster/7.5/docker-entrypoint.sh | 221 ++++++++++++++++++ {5.5 => mysql-cluster/7.5}/healthcheck.sh | 0 mysql-cluster/7.5/inspec/control.rb | 21 ++ mysql-cluster/7.6/Dockerfile | 44 ++++ mysql-cluster/7.6/cnf/my.cnf | 22 ++ mysql-cluster/7.6/cnf/mysql-cluster.cnf | 39 ++++ mysql-cluster/7.6/docker-entrypoint.sh | 221 ++++++++++++++++++ {5.6 => mysql-cluster/7.6}/healthcheck.sh | 0 mysql-cluster/7.6/inspec/control.rb | 21 ++ mysql-cluster/8.0/Dockerfile | 44 ++++ mysql-cluster/8.0/cnf/my.cnf | 22 ++ mysql-cluster/8.0/cnf/mysql-cluster.cnf | 39 ++++ mysql-cluster/8.0/docker-entrypoint.sh | 221 ++++++++++++++++++ {5.7 => mysql-cluster/8.0}/healthcheck.sh | 0 mysql-cluster/8.0/inspec/control.rb | 21 ++ mysql-cluster/README.md | 183 +++++++++++++++ mysql-cluster/VERSION | 21 ++ mysql-cluster/build.sh | 23 ++ mysql-cluster/changelog | 59 +++++ mysql-cluster/gen_dockerfiles.sh | 56 +++++ mysql-cluster/tag.sh | 27 +++ mysql-cluster/template/Dockerfile | 44 ++++ mysql-cluster/template/cnf/my.cnf | 22 ++ mysql-cluster/template/cnf/mysql-cluster.cnf | 39 ++++ mysql-cluster/template/control.rb | 21 ++ mysql-cluster/template/docker-entrypoint.sh | 221 ++++++++++++++++++ .../template}/healthcheck.sh | 0 mysql-cluster/test.sh | 31 +++ mysql-router/8.0/Dockerfile | 35 +++ mysql-router/8.0/README.md | 53 +++++ mysql-router/8.0/inspec/control.rb | 21 ++ mysql-router/8.0/run.sh | 75 ++++++ mysql-router/README.md | 58 +++++ mysql-router/VERSION | 10 + mysql-router/build.sh | 20 ++ mysql-router/gen_dockerfiles.sh | 23 ++ mysql-router/tag.sh | 15 ++ mysql-router/template/Dockerfile | 35 +++ mysql-router/template/control.rb | 21 ++ mysql-router/test.sh | 30 +++ {5.5 => mysql-server/5.5}/Dockerfile | 0 .../5.5}/docker-entrypoint.sh | 0 {template => mysql-server/5.5}/healthcheck.sh | 0 {5.5 => mysql-server/5.5}/inspec/control.rb | 0 {5.6 => mysql-server/5.6}/Dockerfile | 0 .../5.6}/docker-entrypoint.sh | 0 mysql-server/5.6/healthcheck.sh | 24 ++ {5.6 => mysql-server/5.6}/inspec/control.rb | 0 {5.7 => mysql-server/5.7}/Dockerfile | 0 .../5.7}/docker-entrypoint.sh | 0 mysql-server/5.7/healthcheck.sh | 24 ++ {5.7 => mysql-server/5.7}/inspec/control.rb | 0 {8.0 => mysql-server/8.0}/Dockerfile | 0 .../8.0}/docker-entrypoint.sh | 0 mysql-server/8.0/healthcheck.sh | 24 ++ {8.0 => mysql-server/8.0}/inspec/control.rb | 0 README.md => mysql-server/README.md | 0 VERSION => mysql-server/VERSION | 0 build.sh => mysql-server/build.sh | 0 changelog => mysql-server/changelog | 0 .../gen_dockerfiles.sh | 0 manifest.sh => mysql-server/manifest.sh | 0 tag.sh => mysql-server/tag.sh | 0 .../template}/Dockerfile | 0 .../template}/control.rb | 0 .../template}/control_pre57.rb | 0 .../template}/docker-entrypoint.sh | 0 mysql-server/template/healthcheck.sh | 24 ++ test.sh => mysql-server/test.sh | 0 73 files changed, 2281 insertions(+) create mode 100644 .gitignore create mode 100644 mysql-cluster/7.5/Dockerfile create mode 100644 mysql-cluster/7.5/cnf/my.cnf create mode 100644 mysql-cluster/7.5/cnf/mysql-cluster.cnf create mode 100755 mysql-cluster/7.5/docker-entrypoint.sh rename {5.5 => mysql-cluster/7.5}/healthcheck.sh (100%) create mode 100644 mysql-cluster/7.5/inspec/control.rb create mode 100644 mysql-cluster/7.6/Dockerfile create mode 100644 mysql-cluster/7.6/cnf/my.cnf create mode 100644 mysql-cluster/7.6/cnf/mysql-cluster.cnf create mode 100755 mysql-cluster/7.6/docker-entrypoint.sh rename {5.6 => mysql-cluster/7.6}/healthcheck.sh (100%) create mode 100644 mysql-cluster/7.6/inspec/control.rb create mode 100644 mysql-cluster/8.0/Dockerfile create mode 100644 mysql-cluster/8.0/cnf/my.cnf create mode 100644 mysql-cluster/8.0/cnf/mysql-cluster.cnf create mode 100755 mysql-cluster/8.0/docker-entrypoint.sh rename {5.7 => mysql-cluster/8.0}/healthcheck.sh (100%) create mode 100644 mysql-cluster/8.0/inspec/control.rb create mode 100644 mysql-cluster/README.md create mode 100644 mysql-cluster/VERSION create mode 100755 mysql-cluster/build.sh create mode 100644 mysql-cluster/changelog create mode 100755 mysql-cluster/gen_dockerfiles.sh create mode 100755 mysql-cluster/tag.sh create mode 100644 mysql-cluster/template/Dockerfile create mode 100644 mysql-cluster/template/cnf/my.cnf create mode 100644 mysql-cluster/template/cnf/mysql-cluster.cnf create mode 100644 mysql-cluster/template/control.rb create mode 100644 mysql-cluster/template/docker-entrypoint.sh rename {8.0 => mysql-cluster/template}/healthcheck.sh (100%) mode change 100755 => 100644 create mode 100755 mysql-cluster/test.sh create mode 100644 mysql-router/8.0/Dockerfile create mode 100644 mysql-router/8.0/README.md create mode 100644 mysql-router/8.0/inspec/control.rb create mode 100755 mysql-router/8.0/run.sh create mode 100644 mysql-router/README.md create mode 100644 mysql-router/VERSION create mode 100755 mysql-router/build.sh create mode 100755 mysql-router/gen_dockerfiles.sh create mode 100755 mysql-router/tag.sh create mode 100644 mysql-router/template/Dockerfile create mode 100644 mysql-router/template/control.rb create mode 100755 mysql-router/test.sh rename {5.5 => mysql-server/5.5}/Dockerfile (100%) rename {5.5 => mysql-server/5.5}/docker-entrypoint.sh (100%) rename {template => mysql-server/5.5}/healthcheck.sh (100%) mode change 100644 => 100755 rename {5.5 => mysql-server/5.5}/inspec/control.rb (100%) rename {5.6 => mysql-server/5.6}/Dockerfile (100%) rename {5.6 => mysql-server/5.6}/docker-entrypoint.sh (100%) create mode 100755 mysql-server/5.6/healthcheck.sh rename {5.6 => mysql-server/5.6}/inspec/control.rb (100%) rename {5.7 => mysql-server/5.7}/Dockerfile (100%) rename {5.7 => mysql-server/5.7}/docker-entrypoint.sh (100%) create mode 100755 mysql-server/5.7/healthcheck.sh rename {5.7 => mysql-server/5.7}/inspec/control.rb (100%) rename {8.0 => mysql-server/8.0}/Dockerfile (100%) rename {8.0 => mysql-server/8.0}/docker-entrypoint.sh (100%) create mode 100755 mysql-server/8.0/healthcheck.sh rename {8.0 => mysql-server/8.0}/inspec/control.rb (100%) rename README.md => mysql-server/README.md (100%) rename VERSION => mysql-server/VERSION (100%) rename build.sh => mysql-server/build.sh (100%) rename changelog => mysql-server/changelog (100%) rename gen_dockerfiles.sh => mysql-server/gen_dockerfiles.sh (100%) rename manifest.sh => mysql-server/manifest.sh (100%) rename tag.sh => mysql-server/tag.sh (100%) rename {template => mysql-server/template}/Dockerfile (100%) rename {template => mysql-server/template}/control.rb (100%) rename {template => mysql-server/template}/control_pre57.rb (100%) rename {template => mysql-server/template}/docker-entrypoint.sh (100%) create mode 100644 mysql-server/template/healthcheck.sh rename test.sh => mysql-server/test.sh (100%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..e43b0f988 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/mysql-cluster/7.5/Dockerfile b/mysql-cluster/7.5/Dockerfile new file mode 100644 index 000000000..52f37da39 --- /dev/null +++ b/mysql-cluster/7.5/Dockerfile @@ -0,0 +1,44 @@ +# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +FROM oraclelinux:7-slim + +ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.5.21 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.23 + +# Install server +RUN yum install -y \ + https://repo.mysql.com/mysql-cluster-community-minimal-release-el7.rpm \ + https://repo.mysql.com/mysql-community-release-el7.rpm \ + && yum-config-manager --enable mysql-cluster75-minimal \ + && yum install -y \ + $MYSQL_CLUSTER_PACKAGE \ + $MYSQL_SHELL_PACKAGE \ + libpwquality \ + && yum clean all \ + && mkdir /docker-entrypoint-initdb.d + +VOLUME /var/lib/mysql + +COPY docker-entrypoint.sh /entrypoint.sh +COPY healthcheck.sh /healthcheck.sh +COPY cnf/my.cnf /etc/ +COPY cnf/mysql-cluster.cnf /etc/ + +ENTRYPOINT ["/entrypoint.sh"] +EXPOSE 3306 33060 2202 1186 +HEALTHCHECK CMD /healthcheck.sh +CMD ["mysqld"] + diff --git a/mysql-cluster/7.5/cnf/my.cnf b/mysql-cluster/7.5/cnf/my.cnf new file mode 100644 index 000000000..ec98b2dc1 --- /dev/null +++ b/mysql-cluster/7.5/cnf/my.cnf @@ -0,0 +1,22 @@ +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +[mysqld] +ndbcluster +ndb-connectstring=192.168.0.2 +user=mysql + +[mysql_cluster] +ndb-connectstring=192.168.0.2 diff --git a/mysql-cluster/7.5/cnf/mysql-cluster.cnf b/mysql-cluster/7.5/cnf/mysql-cluster.cnf new file mode 100644 index 000000000..16f79f1c0 --- /dev/null +++ b/mysql-cluster/7.5/cnf/mysql-cluster.cnf @@ -0,0 +1,39 @@ +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +[ndbd default] +NoOfReplicas=2 +DataMemory=80M +IndexMemory=18M + + +[ndb_mgmd] +NodeId=1 +hostname=192.168.0.2 +datadir=/var/lib/mysql + +[ndbd] +NodeId=2 +hostname=192.168.0.3 +datadir=/var/lib/mysql + +[ndbd] +NodeId=3 +hostname=192.168.0.4 +datadir=/var/lib/mysql + +[mysqld] +NodeId=4 +hostname=192.168.0.10 diff --git a/mysql-cluster/7.5/docker-entrypoint.sh b/mysql-cluster/7.5/docker-entrypoint.sh new file mode 100755 index 000000000..48a70494b --- /dev/null +++ b/mysql-cluster/7.5/docker-entrypoint.sh @@ -0,0 +1,221 @@ +#!/bin/bash +# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +set -e + +echo "[Entrypoint] MySQL Docker Image 7.5.21-1.1.19-cluster" +# Fetch value from server config +# We use mysqld --verbose --help instead of my_print_defaults because the +# latter only show values present in config files, and not server defaults +_get_config() { + local conf="$1"; shift + "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' +} + +# If command starts with an option, prepend mysqld +# This allows users to add command-line options without +# needing to specify the "mysqld" command +if [ "${1:0:1}" = '-' ]; then + set -- mysqld "$@" +fi + +if [ "$1" = 'mysqld' ]; then + # Test that the server can start. We redirect stdout to /dev/null so + # only the error messages are left. + result=0 + output=$("$@" --verbose --help 2>&1 > /dev/null) || result=$? + if [ ! "$result" = "0" ]; then + echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' + echo >&2 "[Entrypoint] $output" + exit 1 + fi + + # Get config + DATADIR="$(_get_config 'datadir' "$@")" + SOCKET="$(_get_config 'socket' "$@")" + + if [ -n "$MYSQL_LOG_CONSOLE" ] || [ -n "console" ]; then + # Don't touch bind-mounted config files + if ! cat /proc/1/mounts | grep "etc/my.cnf"; then + sed -i 's/^log-error=/#&/' /etc/my.cnf + fi + fi + + if [ ! -d "$DATADIR/mysql" ]; then + # If the password variable is a filename we use the contents of the file. We + # read this first to make sure that a proper error is generated for empty files. + if [ -f "$MYSQL_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + if [ -z "$MYSQL_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' + exit 1 + fi + fi + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] No password option specified for new database.' + echo >&2 '[Entrypoint] A random onetime password will be generated.' + MYSQL_RANDOM_ROOT_PASSWORD=true + MYSQL_ONETIME_PASSWORD=true + fi + mkdir -p "$DATADIR" + chown -R mysql:mysql "$DATADIR" + + echo '[Entrypoint] Initializing database' + "$@" --initialize-insecure + echo '[Entrypoint] Database initialized' + + "$@" --daemonize --skip-networking --socket="$SOCKET" + + # To avoid using password on commandline, put it in a temporary file. + # The file is only populated when and if the root password is set. + PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + install /dev/null -m0600 -omysql -gmysql "$PASSFILE" + # Define the client command used throughout the script + # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") + + mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql + + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(pwmake 128)" + echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + fi + if [ -z "$MYSQL_ROOT_HOST" ]; then + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';" + else + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ + GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + fi + "${mysql[@]}" <<-EOSQL + DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; + ${ROOTCREATE} + FLUSH PRIVILEGES ; + EOSQL + if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then + # Put the password into the temporary config file + cat >"$PASSFILE" <&2 '[Entrypoint] Empty MYSQL_PASSWORD file specified.' + exit 1 + fi + fi + if [ "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then + echo "CREATE USER '"$MYSQL_USER"'@'%' IDENTIFIED BY '"$MYSQL_PASSWORD"' ;" | "${mysql[@]}" + + if [ "$MYSQL_DATABASE" ]; then + echo "GRANT ALL ON \`"$MYSQL_DATABASE"\`.* TO '"$MYSQL_USER"'@'%' ;" | "${mysql[@]}" + fi + + elif [ "$MYSQL_USER" -a ! "$MYSQL_PASSWORD" -o ! "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then + echo '[Entrypoint] Not creating mysql user. MYSQL_USER and MYSQL_PASSWORD must be specified to create a mysql user.' + fi + echo + for f in /docker-entrypoint-initdb.d/*; do + case "$f" in + *.sh) echo "[Entrypoint] running $f"; . "$f" ;; + *.sql) echo "[Entrypoint] running $f"; "${mysql[@]}" < "$f" && echo ;; + *) echo "[Entrypoint] ignoring $f" ;; + esac + echo + done + + # When using a local socket, mysqladmin shutdown will only complete when the server is actually down + mysqladmin --defaults-extra-file="$PASSFILE" shutdown -uroot --socket="$SOCKET" + rm -f "$PASSFILE" + unset PASSFILE + echo "[Entrypoint] Server shut down" + + # This needs to be done outside the normal init, since mysqladmin shutdown will not work after + if [ ! -z "$MYSQL_ONETIME_PASSWORD" ]; then + echo "[Entrypoint] Setting root user as expired. Password will need to be changed before database can be used." + SQL=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + install /dev/null -m0600 -omysql -gmysql "$SQL" + if [ ! -z "$MYSQL_ROOT_HOST" ]; then + cat << EOF > "$SQL" +ALTER USER 'rootQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'roothost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'roothost' PASSWORD EXPIRE; +EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL + fi + + echo + echo '[Entrypoint] MySQL init process done. Ready for start up.' + echo + fi + + # Used by healthcheck to make sure it doesn't mistakenly report container + # healthy during startup + # Put the password into the temporary config file + touch /healthcheck.cnf + cat >"/healthcheck.cnf" </dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' +} + +# If command starts with an option, prepend mysqld +# This allows users to add command-line options without +# needing to specify the "mysqld" command +if [ "${1:0:1}" = '-' ]; then + set -- mysqld "$@" +fi + +if [ "$1" = 'mysqld' ]; then + # Test that the server can start. We redirect stdout to /dev/null so + # only the error messages are left. + result=0 + output=$("$@" --verbose --help 2>&1 > /dev/null) || result=$? + if [ ! "$result" = "0" ]; then + echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' + echo >&2 "[Entrypoint] $output" + exit 1 + fi + + # Get config + DATADIR="$(_get_config 'datadir' "$@")" + SOCKET="$(_get_config 'socket' "$@")" + + if [ -n "$MYSQL_LOG_CONSOLE" ] || [ -n "console" ]; then + # Don't touch bind-mounted config files + if ! cat /proc/1/mounts | grep "etc/my.cnf"; then + sed -i 's/^log-error=/#&/' /etc/my.cnf + fi + fi + + if [ ! -d "$DATADIR/mysql" ]; then + # If the password variable is a filename we use the contents of the file. We + # read this first to make sure that a proper error is generated for empty files. + if [ -f "$MYSQL_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + if [ -z "$MYSQL_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' + exit 1 + fi + fi + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] No password option specified for new database.' + echo >&2 '[Entrypoint] A random onetime password will be generated.' + MYSQL_RANDOM_ROOT_PASSWORD=true + MYSQL_ONETIME_PASSWORD=true + fi + mkdir -p "$DATADIR" + chown -R mysql:mysql "$DATADIR" + + echo '[Entrypoint] Initializing database' + "$@" --initialize-insecure + echo '[Entrypoint] Database initialized' + + "$@" --daemonize --skip-networking --socket="$SOCKET" + + # To avoid using password on commandline, put it in a temporary file. + # The file is only populated when and if the root password is set. + PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + install /dev/null -m0600 -omysql -gmysql "$PASSFILE" + # Define the client command used throughout the script + # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") + + mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql + + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(pwmake 128)" + echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + fi + if [ -z "$MYSQL_ROOT_HOST" ]; then + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';" + else + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ + GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + fi + "${mysql[@]}" <<-EOSQL + DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; + ${ROOTCREATE} + FLUSH PRIVILEGES ; + EOSQL + if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then + # Put the password into the temporary config file + cat >"$PASSFILE" <&2 '[Entrypoint] Empty MYSQL_PASSWORD file specified.' + exit 1 + fi + fi + if [ "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then + echo "CREATE USER '"$MYSQL_USER"'@'%' IDENTIFIED BY '"$MYSQL_PASSWORD"' ;" | "${mysql[@]}" + + if [ "$MYSQL_DATABASE" ]; then + echo "GRANT ALL ON \`"$MYSQL_DATABASE"\`.* TO '"$MYSQL_USER"'@'%' ;" | "${mysql[@]}" + fi + + elif [ "$MYSQL_USER" -a ! "$MYSQL_PASSWORD" -o ! "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then + echo '[Entrypoint] Not creating mysql user. MYSQL_USER and MYSQL_PASSWORD must be specified to create a mysql user.' + fi + echo + for f in /docker-entrypoint-initdb.d/*; do + case "$f" in + *.sh) echo "[Entrypoint] running $f"; . "$f" ;; + *.sql) echo "[Entrypoint] running $f"; "${mysql[@]}" < "$f" && echo ;; + *) echo "[Entrypoint] ignoring $f" ;; + esac + echo + done + + # When using a local socket, mysqladmin shutdown will only complete when the server is actually down + mysqladmin --defaults-extra-file="$PASSFILE" shutdown -uroot --socket="$SOCKET" + rm -f "$PASSFILE" + unset PASSFILE + echo "[Entrypoint] Server shut down" + + # This needs to be done outside the normal init, since mysqladmin shutdown will not work after + if [ ! -z "$MYSQL_ONETIME_PASSWORD" ]; then + echo "[Entrypoint] Setting root user as expired. Password will need to be changed before database can be used." + SQL=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + install /dev/null -m0600 -omysql -gmysql "$SQL" + if [ ! -z "$MYSQL_ROOT_HOST" ]; then + cat << EOF > "$SQL" +ALTER USER 'rootQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'roothost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'roothost' PASSWORD EXPIRE; +EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL + fi + + echo + echo '[Entrypoint] MySQL init process done. Ready for start up.' + echo + fi + + # Used by healthcheck to make sure it doesn't mistakenly report container + # healthy during startup + # Put the password into the temporary config file + touch /healthcheck.cnf + cat >"/healthcheck.cnf" </dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' +} + +# If command starts with an option, prepend mysqld +# This allows users to add command-line options without +# needing to specify the "mysqld" command +if [ "${1:0:1}" = '-' ]; then + set -- mysqld "$@" +fi + +if [ "$1" = 'mysqld' ]; then + # Test that the server can start. We redirect stdout to /dev/null so + # only the error messages are left. + result=0 + output=$("$@" --verbose --help 2>&1 > /dev/null) || result=$? + if [ ! "$result" = "0" ]; then + echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' + echo >&2 "[Entrypoint] $output" + exit 1 + fi + + # Get config + DATADIR="$(_get_config 'datadir' "$@")" + SOCKET="$(_get_config 'socket' "$@")" + + if [ -n "$MYSQL_LOG_CONSOLE" ] || [ -n "console" ]; then + # Don't touch bind-mounted config files + if ! cat /proc/1/mounts | grep "etc/my.cnf"; then + sed -i 's/^log-error=/#&/' /etc/my.cnf + fi + fi + + if [ ! -d "$DATADIR/mysql" ]; then + # If the password variable is a filename we use the contents of the file. We + # read this first to make sure that a proper error is generated for empty files. + if [ -f "$MYSQL_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + if [ -z "$MYSQL_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' + exit 1 + fi + fi + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] No password option specified for new database.' + echo >&2 '[Entrypoint] A random onetime password will be generated.' + MYSQL_RANDOM_ROOT_PASSWORD=true + MYSQL_ONETIME_PASSWORD=true + fi + mkdir -p "$DATADIR" + chown -R mysql:mysql "$DATADIR" + + echo '[Entrypoint] Initializing database' + "$@" --initialize-insecure + echo '[Entrypoint] Database initialized' + + "$@" --daemonize --skip-networking --socket="$SOCKET" + + # To avoid using password on commandline, put it in a temporary file. + # The file is only populated when and if the root password is set. + PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + install /dev/null -m0600 -omysql -gmysql "$PASSFILE" + # Define the client command used throughout the script + # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") + + mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql + + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(pwmake 128)" + echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + fi + if [ -z "$MYSQL_ROOT_HOST" ]; then + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';" + else + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ + GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + fi + "${mysql[@]}" <<-EOSQL + DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; + ${ROOTCREATE} + FLUSH PRIVILEGES ; + EOSQL + if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then + # Put the password into the temporary config file + cat >"$PASSFILE" <&2 '[Entrypoint] Empty MYSQL_PASSWORD file specified.' + exit 1 + fi + fi + if [ "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then + echo "CREATE USER '"$MYSQL_USER"'@'%' IDENTIFIED BY '"$MYSQL_PASSWORD"' ;" | "${mysql[@]}" + + if [ "$MYSQL_DATABASE" ]; then + echo "GRANT ALL ON \`"$MYSQL_DATABASE"\`.* TO '"$MYSQL_USER"'@'%' ;" | "${mysql[@]}" + fi + + elif [ "$MYSQL_USER" -a ! "$MYSQL_PASSWORD" -o ! "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then + echo '[Entrypoint] Not creating mysql user. MYSQL_USER and MYSQL_PASSWORD must be specified to create a mysql user.' + fi + echo + for f in /docker-entrypoint-initdb.d/*; do + case "$f" in + *.sh) echo "[Entrypoint] running $f"; . "$f" ;; + *.sql) echo "[Entrypoint] running $f"; "${mysql[@]}" < "$f" && echo ;; + *) echo "[Entrypoint] ignoring $f" ;; + esac + echo + done + + # When using a local socket, mysqladmin shutdown will only complete when the server is actually down + mysqladmin --defaults-extra-file="$PASSFILE" shutdown -uroot --socket="$SOCKET" + rm -f "$PASSFILE" + unset PASSFILE + echo "[Entrypoint] Server shut down" + + # This needs to be done outside the normal init, since mysqladmin shutdown will not work after + if [ ! -z "$MYSQL_ONETIME_PASSWORD" ]; then + echo "[Entrypoint] Setting root user as expired. Password will need to be changed before database can be used." + SQL=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + install /dev/null -m0600 -omysql -gmysql "$SQL" + if [ ! -z "$MYSQL_ROOT_HOST" ]; then + cat << EOF > "$SQL" +ALTER USER 'rootQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'roothost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'roothost' PASSWORD EXPIRE; +EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL + fi + + echo + echo '[Entrypoint] MySQL init process done. Ready for start up.' + echo + fi + + # Used by healthcheck to make sure it doesn't mistakenly report container + # healthy during startup + # Put the password into the temporary config file + touch /healthcheck.cnf + cat >"/healthcheck.cnf" <. + +Supported Tags and Respective Dockerfile Links +---------------------------------------------- + +These are tags for some of the optimized MySQL Server Docker images, created and maintained by the MySQL team at Oracle (for a full list, see [the Tags tab of this page](https://hub.docker.com/r/mysql/mysql-server/tags/)). + +- MySQL Server 5.5 (tag: [`5.5`, `5.5.58`, `5.5.58-1.1.2`](https://github.com/mysql/mysql-docker/blob/mysql-server/5.5/Dockerfile)) ([mysql-server/5.5/Dockerfile](https://github.com/mysql/mysql-docker/blob/mysql-server/5.5/Dockerfile)) + +- MySQL Server 5.6 (tag: [`5.6`, `5.6.38`, `5.6.38-1.1.2`](https://github.com/mysql/mysql-docker/blob/mysql-server/5.6/Dockerfile)) ([mysql-server/5.6/Dockerfile](https://github.com/mysql/mysql-docker/blob/mysql-server/5.6/Dockerfile)) + +- MySQL Server 5.7, the latest GA (tag: [`5.7`, `5.7.20`, `5.7.20-1.1.2`](https://github.com/mysql/mysql-docker/blob/mysql-server/5.7/Dockerfile)) ([mysql-server/5.7/Dockerfile](https://github.com/mysql/mysql-docker/blob/mysql-server/5.7/Dockerfile)) + +- MySQL Server 8.0, Release Candidate (tag: [`8.0`, `8.0.3-rc`, `8.0.3-rc-1.1.2`](https://github.com/mysql/mysql-docker/blob/mysql-server/8.0/Dockerfile)) ([mysql-server/8.0/Dockerfile](https://github.com/mysql/mysql-docker/blob/mysql-server/8.0/Dockerfile)) + +Images are updated when new MySQL Server maintenance releases and development milestones are published. Please note that non-GA releases are for preview purposes only and should not be used in production setups. + +We also from time to time publish special MySQL Server images that contain experimental features. Please take a look at the [MySQL Docker image list](https://hub.docker.com/r/mysql/) to see what are available. + +Quick Reference +--------------- + +- *Detailed documentation:* See [Deploying MySQL on Linux with Docker](https://dev.mysql.com/doc/refman/5.7/en/linux-installation-docker.html) in the [MySQL Reference Manual](https://dev.mysql.com/doc/refman/5.7/en/). + +- *Where to file issues:* Please submit a bug report at under the category “MySQL Package Repos and Docker Images”. + +- *Maintained by:* The MySQL team at Oracle + +- *Source of this image:* The [Image repository for the `mysql/mysql-server` container](https://github.com/mysql/mysql-docker) + +- *Supported Docker versions:* The latest stable release is supported. Support for older versions (down to 1.0) is provided on a best-effort basis, but we strongly recommend using the most recent stable Docker version, which this documentation assumes. + +How to Use the MySQL Images +--------------------------- + +### Downloading a MySQL Server Docker Image + +Downloading the server image in a separate step is not strictly necessary; however, performing this before you create your Docker container ensures your local image is up to date. + +To download the MySQL Community Edition image, run this command: + + docker pull mysql/mysql-server:tag + + + +Refer to the list of supported tags above. If `:tag + ` is omitted, the `latest` tag is used, and the image for the latest GA version of MySQL Server is downloaded. + +### Starting a MySQL Server Instance + +Start a new Docker container for the MySQL Community Server with this command: + + docker run --name=mysql1 -d mysql/mysql-server:tag + + + +The `--name` option, for supplying a custom name for your server container (`mysql1` in the example), is optional; if no container name is supplied, a random one is generated. If the Docker image of the specified name and tag has not been downloaded by an earlier `docker pull` or `docker run` command, the image is now downloaded. After download completes, initialization for the container begins, and the container appears in the list of running containers when you run the `docker ps` command; for example: + + shell> docker ps + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + a24888f0d6f4 mysql/mysql-server "/entrypoint.sh my..." 14 seconds ago Up 13 seconds (health: starting) 3306/tcp, 33060/tcp mysql1 + +The container initialization might take some time. When the server is ready for use, the `STATUS` of the container in the output of the `docker ps` command changes from `(health: starting)` to `(healthy)`. + +The `-d` option used in the `docker + run` command above makes the container run in the background. Use this command to monitor the output from the container: + + docker logs mysql1 + + +Once initialization is finished, the command's output is going to contain the random password generated for the root user; check the password with, for example, this command: + + shell> docker logs mysql1 2>&1 | grep GENERATED + GENERATED ROOT PASSWORD: Axegh3kAJyDLaRuBemecis&EShOs + +### Connecting to MySQL Server from within the Container + +Once the server is ready, you can run the `mysql` client within the MySQL Server container you just started and connect it to the MySQL Server. Use the `docker exec -it` command to start a `mysql` client inside the Docker container you have started, like this: + + docker exec -it mysql1 mysql -uroot -p + + +When asked, enter the generated root password (see the instructions above on how to find it). Because the `MYSQL_ONETIME_PASSWORD` option is true by default, after you started the server container with the sample command above and connected a `mysql` client to the server, you must reset the server root password by issuing this statement: + + mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'newpassword'; + + +Substitute `newpassword` with the password of your choice. Once the password is reset, the server is ready for use. + +### Container Shell Access + +To have shell access to your MySQL Server container, use the `docker exec -it` command to start a bash shell inside the container: + + shell> docker exec -it mysql1 bash + bash-4.2# + +You can then run Linux commands inside the container at the bash prompt. + +### Stopping and Deleting a MySQL Container + +To stop the MySQL Server container we have created, use this command: + + docker stop mysql1 + + +`docker stop` sends a SIGTERM signal to the `mysqld` process, so that the server is shut down gracefully. + +Also notice that when the main process of a container (`mysqld` in the case of a MySQL Server container) is stopped, the Docker container stops automatically. + +To start the MySQL Server container again: + + docker start mysql1 + + +To stop and start again the MySQL Server container with a single command: + + docker restart mysql1 + + +To delete the MySQL container, stop it first, and then use the `docker rm` command: + + docker stop mysql1 + + docker rm mysql1 + + +If you want the [Docker volume for the server's data directory](https://dev.mysql.com/doc/refman/5.7/en/docker-mysql-more-topics.html#docker-persisting-data-configuration) to be deleted at the same time, add the `-v` option to the `docker rm` command. + +### More Topics on Deploying MySQL Server with Docker + +For more topics on deploying MySQL Server with Docker like server configuration, persisting data and configuration, and server error log, see [More Topics on Deploying MySQL Server with Docker](https://dev.mysql.com/doc/refman/5.7/en/docker-mysql-more-topics.html) in the MySQL Server manual. + +Docker Environment Variables +---------------------------- + +When you create a MySQL Server container, you can configure the MySQL instance by using the `--env` option (`-e` in short) and specifying one or more of the following environment variables. + +> **Notes** +> +> - None of the variables below has any effect if you mount a data directory that is not empty, as no server initialization is going to be attempted then (see [Persisting Data and Configuration Changes](https://dev.mysql.com/doc/refman/5.7/en/docker-mysql-more-topics.html#docker-persisting-data-configuration) for more details). Any pre-existing contents in the folder, including any old server settings, are not modified during the container startup. +> +> - The boolean variables including `MYSQL_RANDOM_ROOT_PASSWORD`, `MYSQL_ONETIME_PASSWORD`, `MYSQL_ALLOW_EMPTY_PASSWORD`, and `MYSQL_LOG_CONSOLE` are made true by setting them with any strings of non-zero lengths. Therefore, setting them to, for example, “0”, “false”, or “no” does not make them false, but actually makes them true. This is a known issue of the MySQL Server containers. +> +  + +- `MYSQL_RANDOM_ROOT_PASSWORD`: When this variable is true (which is its default state, unless `MYSQL_ROOT_PASSWORD` is set or `MYSQL_ALLOW_EMPTY_PASSWORD` is set to true), a random password for the server's root user is generated when the Docker container is started. The password is printed to `stdout` of the container and can be found by looking at the container’s log. + +- `MYSQL_ONETIME_PASSWORD`: When the variable is true (which is its default state, unless `MYSQL_ROOT_PASSWORD` is set or `MYSQL_ALLOW_EMPTY_PASSWORD` is set to true), the root user's password is set as expired and must be changed before MySQL can be used normally. This variable is only supported for MySQL 5.6 and later. + +- `MYSQL_DATABASE`: This variable allows you to specify the name of a database to be created on image startup. If a user name and a password are supplied with `MYSQL_USER` and `MYSQL_PASSWORD`, the user is created and granted superuser access to this database (corresponding to `GRANT ALL`). The specified database is created by a [CREATE DATABASE IF NOT EXIST](#create-database) statement, so that the variable has no effect if the database already exists. + +- `MYSQL_USER`, `MYSQL_PASSWORD`: These variables are used in conjunction to create a user and set that user's password, and the user is granted superuser permissions for the database specified by the `MYSQL_DATABASE` variable. Both `MYSQL_USER` and `MYSQL_PASSWORD` are required for a user to be created; if any of the two variables is not set, the other is ignored. If both variables are set but `MYSQL_DATABASE` is not, the user is created without any privileges. + + > **Note** + > + > There is no need to use this mechanism to create the root superuser, which is created by default with the password set by either one of the mechanisms discussed in the descriptions for `MYSQL_ROOT_PASSWORD` and `MYSQL_RANDOM_ROOT_PASSWORD`, unless `MYSQL_ALLOW_EMPTY_PASSWORD` is true. + +- `MYSQL_ROOT_HOST`: By default, MySQL creates the `'root'@'localhost'` account. This account can only be connected to from inside the container. To allow root connections from other hosts, set this environment variable. For example, the value `172.17.0.1`, which is the default Docker gateway IP, allows connections from the host machine that runs the container. The option accepts only one entry, but wildcards are allowed (for example, `MYSQL_ROOT_HOST=172.*.*.*` or `MYSQL_ROOT_HOST=%`). + +- `MYSQL_LOG_CONSOLE`: When the variable is true (which is its default state for MySQL 8.0 server containers), the MySQL Server's error log is redirected to `stderr`, so that the error log goes into the Docker container's log and is viewable using the `docker logs` command. + + > **Note** + > + > The variable has no effect if a server configuration file from the host has been mounted (see [Persisting Data and Configuration Changes](https://dev.mysql.com/doc/refman/5.7/en/docker-mysql-more-topics.html#docker-persisting-data-configuration) on bind-mounting a configuration file). + +- `MYSQL_ROOT_PASSWORD`: This variable specifies a password that is set for the MySQL root account. + + > **Warning** + > + > Setting the MySQL root user password on the command line is insecure. As an alternative to specifying the password explicitly, you can set the variable with a container file path for a password file, and then mount a file from your host that contains the password at the container file path. This is still not very secure, as the location of the password file is still exposed. It is preferable to use the default settings of `MYSQL_RANDOM_ROOT_PASSWORD` and `MYSQL_ONETIME_PASSWORD` being both true. + +- `MYSQL_ALLOW_EMPTY_PASSWORD`. Set it to true to allow the container to be started with a blank password for the root user. + + > **Warning** + > + > Setting this variable to true is insecure, because it is going to leave your MySQL instance completely unprotected, allowing anyone to gain complete superuser access. It is preferable to use the default settings of `MYSQL_RANDOM_ROOT_PASSWORD` and `MYSQL_ONETIME_PASSWORD` being both true. diff --git a/mysql-cluster/VERSION b/mysql-cluster/VERSION new file mode 100644 index 000000000..d7be86d83 --- /dev/null +++ b/mysql-cluster/VERSION @@ -0,0 +1,21 @@ +IMAGE_VERSION=1.1.19-cluster +declare -A MYSQL_CLUSTER_VERSIONS +MYSQL_CLUSTER_VERSIONS["7.5"]=7.5.21 +MYSQL_CLUSTER_VERSIONS["7.6"]=7.6.17 +MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.23 +declare -A MYSQL_SHELL_VERSIONS +MYSQL_SHELL_VERSIONS["7.5"]=8.0.23 +MYSQL_SHELL_VERSIONS["7.6"]=8.0.23 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.23 + +declare -A SERVER_VERSION_FULL +SERVER_VERSION_FULL["7.5"]="${MYSQL_CLUSTER_VERSIONS["7.5"]}-${IMAGE_VERSION}" +SERVER_VERSION_FULL["7.6"]="${MYSQL_CLUSTER_VERSIONS["7.6"]}-${IMAGE_VERSION}" +SERVER_VERSION_FULL["8.0"]="${MYSQL_CLUSTER_VERSIONS["8.0"]}-${IMAGE_VERSION}" + +declare -A PASSWORDSET +PASSWORDSET["7.5"]="ALTER USER 'root'@'localhost' IDENTIFIED BY '\${MYSQL_ROOT_PASSWORD}';" +PASSWORDSET["7.6"]=${PASSWORDSET["7.5"]} +PASSWORDSET["8.0"]=${PASSWORDSET["7.6"]} + +LATEST="8.0" diff --git a/mysql-cluster/build.sh b/mysql-cluster/build.sh new file mode 100755 index 000000000..039c8a62b --- /dev/null +++ b/mysql-cluster/build.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e +source VERSION + +MAJOR_VERSIONS=("${!MYSQL_CLUSTER_VERSIONS[@]}"); [ -n "$1" ] && MAJOR_VERSIONS=("${@:1}") + +for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do + docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$http_proxy --build-arg no_proxy=$no_proxy -t mysql/mysql-cluster:$MAJOR_VERSION $MAJOR_VERSION +done diff --git a/mysql-cluster/changelog b/mysql-cluster/changelog new file mode 100644 index 000000000..19c5a34f2 --- /dev/null +++ b/mysql-cluster/changelog @@ -0,0 +1,59 @@ +Changes in 1.1.3 + * Added support for new infoschema system user in 8.0.4 + * Bumped server versions to 5.5.59, 5.6.39, 5.7.21, 8.0.4 + * Bumper cluster versions to 7.5.9, 7.6.4 + +Changes in 1.1.2 (2017-10-16) + * Bumped server versions to 5.5.58, 5.6.38, 5.7.20 + * Bumped Shell 8.0 version to 8.0.3 + +Changes in 1.1.1 (2017-09-22) + * Disable binlog for all entrypoint client commands (#87305) + This was previously only done only for the script to set the root password, + but should be done for all client commands, or group replication will fail + * Add flag for logging to console (#87458) + Setting -e MYSQL_LOG_CONSOLE=true will make the server log to console, so the + server log is available through Docker's log interface. If /etc/my.cnf is + mounted from the host system, this has no effect. On 8.0, this is the default + behavior. + * Ensure both MYSQL_USER and MYSQL_PASSWORD are set (#86982) + Before, setting only one would cause the option to be silently ignored. + * Read password file first and throw error if it is empty (#87025) + Setting MYSQL_ROOT_PASSWORD to an empty string would be rejected, but + setting it to a file with no content would be accepted. Both are now rejected. + * MYSQL_RANDOM_ROOT_PASSWORD and MYSQL_ONETIME_PASSWORD are now set by default. (#87515) + A password option no longer needs to be set explicitly. If none are set, a + random, expired password is set. + * Make root@$MYSQL_ROOT_HOST identical to root@localhost (#86945) + If the MYSQL_ROOT_HOST variable is set we add an additional root user for + the given host. This user was missing the PROXY privilege. We add the + missing privilege so the users are identical. + * MySQL Server 8.0 updated to 8.0.3-rc + * MySQL Shell for 5.7 updated to 1.0.10 + +Changes in 1.1.0 (2017-07-24) + * Fixed broken MYSQL_ONETIME_PASSWORD support (#86523) + The functionality wasn't correctly updated when the entrypoint script was + changed to only create the root@localhost user by default + * Changed control files to be generated from a common template + The control files for each version will be generated by swapping out the few + commands that differ between server versions + * Made PACKAGE_URL an ARG entry, to allow build-time changing + The URL variables can be changed by supplying new ones with --build-arg at + build time + * Added basic healthcheck script + Once database init is complete a flag file will be touched. If this file + exists and mysqladmin ping succeeds, the container is reported as healthy, + meaning it is ready for use + * Database init will now use configured socket setting instead of hardcoded + Using a hardcoded socket could cause init scripts to fail in confusing ways + if the user customized the socket setting + * Added MySQL Shell to supported images + For 5.7 and 8.0, MySQL Shell is installed together with the server. + https://dev.mysql.com/doc/refman/5.7/en/mysql-shell.html + +Known issues: + * For existing databases created with older images/not with Docker, the + healthcheck script will generate an "Access denied for healthchecker@localhost" + message in the server log every time it runs. If connection throttling is + enabled this could eventually cause the healthcheck to fail diff --git a/mysql-cluster/gen_dockerfiles.sh b/mysql-cluster/gen_dockerfiles.sh new file mode 100755 index 000000000..0376210df --- /dev/null +++ b/mysql-cluster/gen_dockerfiles.sh @@ -0,0 +1,56 @@ +#!/bin/bash +# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# This script will simply use sed to replace placeholder variables in the +# files in template/ with version-specific variants. + +set -e + +source VERSION + +REPO=https://repo.mysql.com; [ -n "$1" ] && REPO=$1 +MAJOR_VERSIONS=("${!MYSQL_CLUSTER_VERSIONS[@]}"); [ -n "$2" ] && MAJOR_VERSIONS=("${@:2}") + +for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do + # Dockerfile + sed 's#%%MYSQL_CLUSTER_PACKAGE%%#'"mysql-cluster-community-server-minimal-${MYSQL_CLUSTER_VERSIONS[${MAJOR_VERSION}]}"'#g' template/Dockerfile > tmpFile + sed -i 's#%%MYSQL_SHELL_PACKAGE%%#'"mysql-shell-${MYSQL_SHELL_VERSIONS[${MAJOR_VERSION}]}"'#g' tmpFile + sed -i 's#%%REPO%%#'"${REPO}"'#g' tmpFile + REPO_VERSION=${MAJOR_VERSION//\./} + sed -i 's#%%REPO_VERSION%%#'"${REPO_VERSION}"'#g' tmpFile + mv tmpFile ${MAJOR_VERSION}/Dockerfile + + # control.rb + sed 's#%%MYSQL_CLUSTER_PACKAGE_VERSION%%#'"${MYSQL_CLUSTER_VERSIONS[${MAJOR_VERSION}]}"'#g' template/control.rb > tmpFile + sed -i 's#%%MYSQL_SHELL_PACKAGE_VERSION%%#'"${MYSQL_SHELL_VERSIONS[${MAJOR_VERSION}]}"'#g' tmpFile + if [ ! -d "${MAJOR_VERSION}/inspec" ]; then + mkdir "${MAJOR_VERSION}/inspec" + fi + mv tmpFile "${MAJOR_VERSION}/inspec/control.rb" + + # Entrypoint + sed 's#%%PASSWORDSET%%#'"${PASSWORDSET[${MAJOR_VERSION}]}"'#g' template/docker-entrypoint.sh > tmpFile + sed -i 's#%%SERVER_VERSION_FULL%%#'"${SERVER_VERSION_FULL[${MAJOR_VERSION}]}"'#g' tmpFile + mv tmpFile ${MAJOR_VERSION}/docker-entrypoint.sh + chmod +x ${MAJOR_VERSION}/docker-entrypoint.sh + + # Healthcheck + cp template/healthcheck.sh ${MAJOR_VERSION}/ + chmod +x ${MAJOR_VERSION}/healthcheck.sh + + # Config + cp -r template/cnf ${MAJOR_VERSION}/ +done diff --git a/mysql-cluster/tag.sh b/mysql-cluster/tag.sh new file mode 100755 index 000000000..77d9965c4 --- /dev/null +++ b/mysql-cluster/tag.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e +source VERSION + +MAJOR_VERSIONS=("${!MYSQL_CLUSTER_VERSIONS[@]}"); [ -n "$1" ] && MAJOR_VERSIONS=("${@:1}") + +for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do + if [ "$MAJOR_VERSION" = "$LATEST" ]; then + echo "$MAJOR_VERSION ${MYSQL_CLUSTER_VERSIONS["$MAJOR_VERSION"]} latest" + else + echo "$MAJOR_VERSION ${MYSQL_CLUSTER_VERSIONS["$MAJOR_VERSION"]}" + fi +done diff --git a/mysql-cluster/template/Dockerfile b/mysql-cluster/template/Dockerfile new file mode 100644 index 000000000..aa4b38f75 --- /dev/null +++ b/mysql-cluster/template/Dockerfile @@ -0,0 +1,44 @@ +# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +FROM oraclelinux:7-slim + +ARG MYSQL_CLUSTER_PACKAGE=%%MYSQL_CLUSTER_PACKAGE%% +ARG MYSQL_SHELL_PACKAGE=%%MYSQL_SHELL_PACKAGE%% + +# Install server +RUN yum install -y \ + %%REPO%%/mysql-cluster-community-minimal-release-el7.rpm \ + %%REPO%%/mysql-community-release-el7.rpm \ + && yum-config-manager --enable mysql-cluster%%REPO_VERSION%%-minimal \ + && yum install -y \ + $MYSQL_CLUSTER_PACKAGE \ + $MYSQL_SHELL_PACKAGE \ + libpwquality \ + && yum clean all \ + && mkdir /docker-entrypoint-initdb.d + +VOLUME /var/lib/mysql + +COPY docker-entrypoint.sh /entrypoint.sh +COPY healthcheck.sh /healthcheck.sh +COPY cnf/my.cnf /etc/ +COPY cnf/mysql-cluster.cnf /etc/ + +ENTRYPOINT ["/entrypoint.sh"] +EXPOSE 3306 33060 2202 1186 +HEALTHCHECK CMD /healthcheck.sh +CMD ["mysqld"] + diff --git a/mysql-cluster/template/cnf/my.cnf b/mysql-cluster/template/cnf/my.cnf new file mode 100644 index 000000000..ec98b2dc1 --- /dev/null +++ b/mysql-cluster/template/cnf/my.cnf @@ -0,0 +1,22 @@ +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +[mysqld] +ndbcluster +ndb-connectstring=192.168.0.2 +user=mysql + +[mysql_cluster] +ndb-connectstring=192.168.0.2 diff --git a/mysql-cluster/template/cnf/mysql-cluster.cnf b/mysql-cluster/template/cnf/mysql-cluster.cnf new file mode 100644 index 000000000..16f79f1c0 --- /dev/null +++ b/mysql-cluster/template/cnf/mysql-cluster.cnf @@ -0,0 +1,39 @@ +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +[ndbd default] +NoOfReplicas=2 +DataMemory=80M +IndexMemory=18M + + +[ndb_mgmd] +NodeId=1 +hostname=192.168.0.2 +datadir=/var/lib/mysql + +[ndbd] +NodeId=2 +hostname=192.168.0.3 +datadir=/var/lib/mysql + +[ndbd] +NodeId=3 +hostname=192.168.0.4 +datadir=/var/lib/mysql + +[mysqld] +NodeId=4 +hostname=192.168.0.10 diff --git a/mysql-cluster/template/control.rb b/mysql-cluster/template/control.rb new file mode 100644 index 000000000..f8ded4a9c --- /dev/null +++ b/mysql-cluster/template/control.rb @@ -0,0 +1,21 @@ +control 'container' do + impact 0.5 + describe docker_container('mysql-cluster') do + it { should exist } + it { should be_running } + its('repo') { should eq 'mysql/mysql-cluster' } + its('ports') { should eq '1186/tcp, 2202/tcp, 3306/tcp, 33060/tcp' } + its('command') { should match '/entrypoint.sh.*' } + end +end +control 'packages' do + impact 0.5 + describe package('mysql-cluster-community-server-minimal') do + it { should be_installed } + its ('version') { should match '%%MYSQL_CLUSTER_PACKAGE_VERSION%%.*' } + end + describe package('mysql-shell') do + it { should be_installed } + its ('version') { should match '%%MYSQL_SHELL_PACKAGE_VERSION%%.*' } + end +end diff --git a/mysql-cluster/template/docker-entrypoint.sh b/mysql-cluster/template/docker-entrypoint.sh new file mode 100644 index 000000000..3f5487aab --- /dev/null +++ b/mysql-cluster/template/docker-entrypoint.sh @@ -0,0 +1,221 @@ +#!/bin/bash +# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +set -e + +echo "[Entrypoint] MySQL Docker Image %%SERVER_VERSION_FULL%%" +# Fetch value from server config +# We use mysqld --verbose --help instead of my_print_defaults because the +# latter only show values present in config files, and not server defaults +_get_config() { + local conf="$1"; shift + "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' +} + +# If command starts with an option, prepend mysqld +# This allows users to add command-line options without +# needing to specify the "mysqld" command +if [ "${1:0:1}" = '-' ]; then + set -- mysqld "$@" +fi + +if [ "$1" = 'mysqld' ]; then + # Test that the server can start. We redirect stdout to /dev/null so + # only the error messages are left. + result=0 + output=$("$@" --verbose --help 2>&1 > /dev/null) || result=$? + if [ ! "$result" = "0" ]; then + echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' + echo >&2 "[Entrypoint] $output" + exit 1 + fi + + # Get config + DATADIR="$(_get_config 'datadir' "$@")" + SOCKET="$(_get_config 'socket' "$@")" + + if [ -n "$MYSQL_LOG_CONSOLE" ] || [ -n "console" ]; then + # Don't touch bind-mounted config files + if ! cat /proc/1/mounts | grep "etc/my.cnf"; then + sed -i 's/^log-error=/#&/' /etc/my.cnf + fi + fi + + if [ ! -d "$DATADIR/mysql" ]; then + # If the password variable is a filename we use the contents of the file. We + # read this first to make sure that a proper error is generated for empty files. + if [ -f "$MYSQL_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + if [ -z "$MYSQL_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' + exit 1 + fi + fi + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] No password option specified for new database.' + echo >&2 '[Entrypoint] A random onetime password will be generated.' + MYSQL_RANDOM_ROOT_PASSWORD=true + MYSQL_ONETIME_PASSWORD=true + fi + mkdir -p "$DATADIR" + chown -R mysql:mysql "$DATADIR" + + echo '[Entrypoint] Initializing database' + "$@" --initialize-insecure + echo '[Entrypoint] Database initialized' + + "$@" --daemonize --skip-networking --socket="$SOCKET" + + # To avoid using password on commandline, put it in a temporary file. + # The file is only populated when and if the root password is set. + PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + install /dev/null -m0600 -omysql -gmysql "$PASSFILE" + # Define the client command used throughout the script + # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") + + mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql + + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(pwmake 128)" + echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + fi + if [ -z "$MYSQL_ROOT_HOST" ]; then + ROOTCREATE="%%PASSWORDSET%%" + else + ROOTCREATE="%%PASSWORDSET%% \ + CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ + GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + fi + "${mysql[@]}" <<-EOSQL + DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; + ${ROOTCREATE} + FLUSH PRIVILEGES ; + EOSQL + if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then + # Put the password into the temporary config file + cat >"$PASSFILE" <&2 '[Entrypoint] Empty MYSQL_PASSWORD file specified.' + exit 1 + fi + fi + if [ "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then + echo "CREATE USER '"$MYSQL_USER"'@'%' IDENTIFIED BY '"$MYSQL_PASSWORD"' ;" | "${mysql[@]}" + + if [ "$MYSQL_DATABASE" ]; then + echo "GRANT ALL ON \`"$MYSQL_DATABASE"\`.* TO '"$MYSQL_USER"'@'%' ;" | "${mysql[@]}" + fi + + elif [ "$MYSQL_USER" -a ! "$MYSQL_PASSWORD" -o ! "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then + echo '[Entrypoint] Not creating mysql user. MYSQL_USER and MYSQL_PASSWORD must be specified to create a mysql user.' + fi + echo + for f in /docker-entrypoint-initdb.d/*; do + case "$f" in + *.sh) echo "[Entrypoint] running $f"; . "$f" ;; + *.sql) echo "[Entrypoint] running $f"; "${mysql[@]}" < "$f" && echo ;; + *) echo "[Entrypoint] ignoring $f" ;; + esac + echo + done + + # When using a local socket, mysqladmin shutdown will only complete when the server is actually down + mysqladmin --defaults-extra-file="$PASSFILE" shutdown -uroot --socket="$SOCKET" + rm -f "$PASSFILE" + unset PASSFILE + echo "[Entrypoint] Server shut down" + + # This needs to be done outside the normal init, since mysqladmin shutdown will not work after + if [ ! -z "$MYSQL_ONETIME_PASSWORD" ]; then + echo "[Entrypoint] Setting root user as expired. Password will need to be changed before database can be used." + SQL=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + install /dev/null -m0600 -omysql -gmysql "$SQL" + if [ ! -z "$MYSQL_ROOT_HOST" ]; then + cat << EOF > "$SQL" +ALTER USER 'rootQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'roothost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'roothost' PASSWORD EXPIRE; +EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL + fi + + echo + echo '[Entrypoint] MySQL init process done. Ready for start up.' + echo + fi + + # Used by healthcheck to make sure it doesn't mistakenly report container + # healthy during startup + # Put the password into the temporary config file + touch /healthcheck.cnf + cat >"/healthcheck.cnf" <&1 | grep Access || exit 1 +EXPOSE 6446 6447 64460 64470 +ENTRYPOINT ["/run.sh"] +CMD ["mysqlrouter"] diff --git a/mysql-router/8.0/README.md b/mysql-router/8.0/README.md new file mode 100644 index 000000000..5afd24c6c --- /dev/null +++ b/mysql-router/8.0/README.md @@ -0,0 +1,53 @@ +![logo](https://www.mysql.com/common/logos/logo-mysql-170x115.png) + +# What is MySQL Router? + +MySQL Router is part of InnoDB cluster, and is lightweight middleware that +provides transparent routing between your application and back-end MySQL +Servers. It can be used for a wide variety of use cases, such as providing high +availability and scalability by effectively routing database traffic to +appropriate back-end MySQL Servers. The pluggable architecture also enables +developers to extend MySQL Router for custom use cases. + +# Supported Tags and Respective Dockerfile Links + +* MySQL Router 8.0 (tag: [latest](https://github.com/mysql/mysql-docker/tree/mysql-router/8.0),[8.0](https://github.com/mysql/mysql-docker/tree/mysql-router/8.0),[8.0.4-rc](https://github.com/mysql/mysql-docker/tree/mysql-router/8.0) (mysql-router/8.0/Dockerfile) + +Images are updated when new MySQL Server maintenance releases and development milestones are published. Please note that non-GA releases are for preview purposes only and should not be used in production setups. + +# How to Use the MySQL Router Images + +The image currently uses the following variables: + +| Variable | Description | +| ------------------------ | ------------------------------------------- | +| MYSQL_HOST | MySQL host to connect to | +| MYSQL_PORT | Port to use | +| MYSQL_USER | User to connect with | +| MYSQL_PASSWORD | Password to connect with | +| MYSQL_INNODB_NUM_MEMBERS | The number of cluster instances to wait for | + +Running in a container requires a working InnoDB cluster. The run script waits +for the given mysql host to be up, the InnoDB cluster to have +MYSQL_INNODB_NUM_MEMBERS members and then uses the given server for its +bootstrap mode +[Bootstrapping](https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-deploying-bootstrapping.html). + +The image can be run via: + +``` +docker run -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -e MYSQL_INNODB_NUM_MEMBERS=3 -ti mysql-router +``` + +It can be verified by typing: + +``` +docker ps +``` + +The following output should be displayed: + +``` +4954b1c80be1 mysql-router:8.0 "/run.sh mysqlrouter" About a minute ago Up About a minute (healthy) 6447/tcp, 64460/tcp, 0.0.0.0:6446->6446/tcp, 64470/tcp innodbcluster_mysql-router_1 +``` + diff --git a/mysql-router/8.0/inspec/control.rb b/mysql-router/8.0/inspec/control.rb new file mode 100644 index 000000000..15dd649e8 --- /dev/null +++ b/mysql-router/8.0/inspec/control.rb @@ -0,0 +1,21 @@ +control 'container' do + impact 0.5 + describe docker_container('mysql-router') do + it { should exist } + it { should be_running } + its('repo') { should eq 'mysql/mysql-router' } + its('ports') { should eq '6446-6447/tcp, 64460/tcp, 64470/tcp' } + its('command') { should match '/run.sh.*' } + end +end +control 'packages' do + impact 0.5 + describe package('mysql-community-server-minimal') do + it { should be_installed } + its ('version') { should match '8.0.23.*' } + end + describe package('mysql-router-community') do + it { should be_installed } + its ('version') { should match '8.0.23.*' } + end +end diff --git a/mysql-router/8.0/run.sh b/mysql-router/8.0/run.sh new file mode 100755 index 000000000..a52394e38 --- /dev/null +++ b/mysql-router/8.0/run.sh @@ -0,0 +1,75 @@ +#!/bin/bash +# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +if [ "$1" = 'mysqlrouter' ]; then + if [[ -z $MYSQL_HOST || -z $MYSQL_PORT || -z $MYSQL_USER || -z $MYSQL_PASSWORD ]]; then + echo "We require all of" + echo " MYSQL_HOST" + echo " MYSQL_PORT" + echo " MYSQL_USER" + echo " MYSQL_PASSWORD" + echo "to be set. Exiting." + exit 1 + fi + + PASSFILE=$(mktemp) + echo "$MYSQL_PASSWORD" > "$PASSFILE" + DEFAULTS_EXTRA_FILE=$(mktemp) + cat >"$DEFAULTS_EXTRA_FILE" < "/dev/tcp/$MYSQL_HOST/$MYSQL_PORT") >/dev/null 2>&1; do + echo "Waiting for mysql server $MYSQL_HOST ($attempt_num/$max_tries)" + sleep $(( attempt_num++ )) + if (( attempt_num == max_tries )); then + exit 1 + fi + done + echo "Succesfully contacted mysql server at $MYSQL_HOST. Checking for cluster state." + if ! [[ "$(mysql --defaults-extra-file="$DEFAULTS_EXTRA_FILE" -u "$MYSQL_USER" -h "$MYSQL_HOST" -P "$MYSQL_PORT" -e "show status;" 2> /dev/null)" ]]; then + echo "Can not connect to database. Exiting." + exit 1 + fi + if [[ -n $MYSQL_INNODB_CLUSTER_MEMBERS ]]; then + attempt_num=0 + echo $attempt_num + echo $max_tries + until [ "$(mysql --defaults-extra-file="$DEFAULTS_EXTRA_FILE" -u "$MYSQL_USER" -h "$MYSQL_HOST" -P "$MYSQL_PORT" -N performance_schema -e "select count(MEMBER_STATE) = $MYSQL_INNODB_CLUSTER_MEMBERS from replication_group_members where MEMBER_STATE = 'ONLINE';" 2> /dev/null)" -eq 1 ]; do + echo "Waiting for $MYSQL_INNODB_CLUSTER_MEMBERS cluster instances to become available via $MYSQL_HOST ($attempt_num/$max_tries)" + sleep $(( attempt_num++ )) + if (( attempt_num == max_tries )); then + exit 1 + fi + done + echo "Successfully contacted cluster with $MYSQL_INNODB_CLUSTER_MEMBERS members. Bootstrapping." + fi + echo "Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap." + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --user=mysqlrouter --directory /tmp/mysqlrouter --force < "$PASSFILE" + sed -i -e 's/logging_folder=.*$/logging_folder=/' /tmp/mysqlrouter/mysqlrouter.conf + echo "Starting mysql-router." + exec "$@" --config /tmp/mysqlrouter/mysqlrouter.conf +fi + +rm -f "$PASSFILE" +rm -f "$DEFAULTS_EXTRA_FILE" +unset DEFAULTS_EXTRA_FILE + +exec "$@" diff --git a/mysql-router/README.md b/mysql-router/README.md new file mode 100644 index 000000000..ceb6e4b0e --- /dev/null +++ b/mysql-router/README.md @@ -0,0 +1,58 @@ +![logo](https://www.mysql.com/common/logos/logo-mysql-170x115.png) + +# What is MySQL Router? + +MySQL Router is part of InnoDB cluster, and is lightweight middleware that +provides transparent routing between your application and back-end MySQL +Servers. It can be used for a wide variety of use cases, such as providing high +availability and scalability by effectively routing database traffic to +appropriate back-end MySQL Servers. The pluggable architecture also enables +developers to extend MySQL Router for custom use cases. + +# Supported Tags and Respective Dockerfile Links + +* MySQL Router 8.0 (tag: [`latest`, `8.0`](https://github.com/mysql/mysql-docker/blob/mysql-router/8.0/Dockerfile)) ([mysql-router/8.0/Dockerfile](https://github.com/mysql/mysql-docker/blob/mysql-router/8.0/Dockerfile)) + +Images are updated when new MySQL Server maintenance releases and development milestones are published. Please note that non-GA releases are for preview purposes only and should not be used in production setups. + +# How to Use the MySQL Router Images + +The image currently uses the following mandatory variables: + +| Variable | Description | +| ------------------------ | ------------------------------------------- | +| MYSQL_HOST | MySQL host to connect to | +| MYSQL_PORT | Port to use | +| MYSQL_USER | User to connect with | +| MYSQL_PASSWORD | Password to connect with | + +Running in a container requires a working InnoDB cluster. + +The image uses the following optional variables: + +| Variable | Description | +| ------------------------ | ------------------------------------------- | +| MYSQL_INNODB_CLUSTER_MEMBERS | The number of cluster instances to wait for | + +If supplied the run script waits for the given mysql host to be up, the InnoDB cluster to have +MYSQL_INNODB_CLUSTER_MEMBERS members and then uses the given server for its +bootstrap mode +[Bootstrapping](https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-deploying-bootstrapping.html). + +The image can be run via: + +``` +docker run -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -e MYSQL_INNODB_CLUSTER_MEMBERS=3 -ti mysql/mysql-router +``` + +It can be verified by typing: + +``` +docker ps +``` + +The following output should be displayed: + +``` +4954b1c80be1 mysql-router:8.0 "/run.sh mysqlrouter" About a minute ago Up About a minute (healthy) 6447/tcp, 64460/tcp, 0.0.0.0:6446->6446/tcp, 64470/tcp innodbcluster_mysql-router_1 +``` diff --git a/mysql-router/VERSION b/mysql-router/VERSION new file mode 100644 index 000000000..3e7d185cd --- /dev/null +++ b/mysql-router/VERSION @@ -0,0 +1,10 @@ +IMAGE_VERSION=0.13-router +declare -A MYSQL_ROUTER_VERSIONS +MYSQL_ROUTER_VERSIONS["8.0"]=8.0.23 +declare -A MYSQL_SERVER_VERSIONS +MYSQL_SERVER_VERSIONS["8.0"]=8.0.23 + +declare -A FULL_ROUTER_VERSIONS +FULL_ROUTER_VERSIONS["8.0"]="${MYSQL_ROUTER_VERSIONS["8.0"]}-${IMAGE_VERSION}" + +LATEST="8.0" diff --git a/mysql-router/build.sh b/mysql-router/build.sh new file mode 100755 index 000000000..9f920b472 --- /dev/null +++ b/mysql-router/build.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e +source ./VERSION +for MAJOR_VERSION in "${!MYSQL_ROUTER_VERSIONS[@]}"; do + docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$http_proxy --build-arg no_proxy=$no_proxy -t mysql/mysql-router:$MAJOR_VERSION $MAJOR_VERSION +done diff --git a/mysql-router/gen_dockerfiles.sh b/mysql-router/gen_dockerfiles.sh new file mode 100755 index 000000000..6b437ea9a --- /dev/null +++ b/mysql-router/gen_dockerfiles.sh @@ -0,0 +1,23 @@ +#!/bin/bash +set -e + +source ./VERSION + +REPO=https://repo.mysql.com; [ -n "$1" ] && REPO=$1 + +for MAJOR_VERSION in "${!MYSQL_ROUTER_VERSIONS[@]}"; do + sed 's#%%MYSQL_SERVER_PACKAGE%%#'"mysql-community-server-minimal-${MYSQL_SERVER_VERSIONS[${MAJOR_VERSION}]}"'#g' template/Dockerfile > tmpFile + sed -i 's#%%MYSQL_ROUTER_PACKAGE%%#'"mysql-router-community-${MYSQL_ROUTER_VERSIONS[${MAJOR_VERSION}]}"'#g' tmpFile + sed -i 's#%%REPO%%#'"${REPO}"'#g' tmpFile + REPO_VERSION=${MAJOR_VERSION//\./} + sed -i 's#%%REPO_VERSION%%#'"${REPO_VERSION}"'#g' tmpFile + mv tmpFile $MAJOR_VERSION/Dockerfile + + # update test template + sed -e 's#%%MYSQL_SERVER_PACKAGE_VERSION%%#'"${MYSQL_SERVER_VERSIONS[${MAJOR_VERSION}]}"'#g' template/control.rb > tmpFile + sed -i -e 's#%%MYSQL_ROUTER_PACKAGE_VERSION%%#'"${MYSQL_ROUTER_VERSIONS[${MAJOR_VERSION}]}"'#g' tmpFile + if [ ! -d "${MAJOR_VERSION}/inspec" ]; then + mkdir "${MAJOR_VERSION}/inspec" + fi + mv tmpFile "${MAJOR_VERSION}/inspec/control.rb" +done diff --git a/mysql-router/tag.sh b/mysql-router/tag.sh new file mode 100755 index 000000000..56ab52ca4 --- /dev/null +++ b/mysql-router/tag.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# Copyright (c) 2021, Oracle and/or its affiliates. +# +set -e +source VERSION + +MAJOR_VERSIONS=("${!MYSQL_ROUTER_VERSIONS[@]}"); [ -n "$1" ] && MAJOR_VERSIONS=("${@:1}") + +for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do + if [[ "$MAJOR_VERSION" == "$LATEST" ]]; then + echo "$MAJOR_VERSION ${MYSQL_ROUTER_VERSIONS["$MAJOR_VERSION"]} ${FULL_ROUTER_VERSIONS["$MAJOR_VERSION"]} latest" + else + echo "$MAJOR_VERSION ${MYSQL_ROUTER_VERSIONS["$MAJOR_VERSION"]} ${FULL_ROUTER_VERSIONS["$MAJOR_VERSION"]}" + fi +done diff --git a/mysql-router/template/Dockerfile b/mysql-router/template/Dockerfile new file mode 100644 index 000000000..e721fee16 --- /dev/null +++ b/mysql-router/template/Dockerfile @@ -0,0 +1,35 @@ +# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +FROM oraclelinux:7-slim + +ARG MYSQL_SERVER_PACKAGE=%%MYSQL_SERVER_PACKAGE%% +ARG MYSQL_ROUTER_PACKAGE=%%MYSQL_ROUTER_PACKAGE%% + +RUN yum install -y %%REPO%%/mysql-community-minimal-release-el7.rpm \ + %%REPO%%/mysql-community-release-el7.rpm \ + && yum-config-manager --enable mysql%%REPO_VERSION%%-server-minimal \ + && yum-config-manager --enable mysql-tools-community \ + && yum install -y \ + $MYSQL_SERVER_PACKAGE \ + $MYSQL_ROUTER_PACKAGE \ + libpwquality \ + && yum clean all + +COPY run.sh /run.sh +HEALTHCHECK \ + CMD mysqladmin --port 6446 --protocol TCP ping 2>&1 | grep Access || exit 1 +EXPOSE 6446 6447 64460 64470 +ENTRYPOINT ["/run.sh"] +CMD ["mysqlrouter"] diff --git a/mysql-router/template/control.rb b/mysql-router/template/control.rb new file mode 100644 index 000000000..04532ab0d --- /dev/null +++ b/mysql-router/template/control.rb @@ -0,0 +1,21 @@ +control 'container' do + impact 0.5 + describe docker_container('mysql-router') do + it { should exist } + it { should be_running } + its('repo') { should eq 'mysql/mysql-router' } + its('ports') { should eq '6446-6447/tcp, 64460/tcp, 64470/tcp' } + its('command') { should match '/run.sh.*' } + end +end +control 'packages' do + impact 0.5 + describe package('mysql-community-server-minimal') do + it { should be_installed } + its ('version') { should match '%%MYSQL_SERVER_PACKAGE_VERSION%%.*' } + end + describe package('mysql-router-community') do + it { should be_installed } + its ('version') { should match '%%MYSQL_ROUTER_PACKAGE_VERSION%%.*' } + end +end diff --git a/mysql-router/test.sh b/mysql-router/test.sh new file mode 100755 index 000000000..33f4903b4 --- /dev/null +++ b/mysql-router/test.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# This script will simply use sed to replace placeholder variables in the +# files in template/ with version-specific variants. + +set -e +source ./VERSION + +for MAJOR_VERSION in "${!MYSQL_ROUTER_VERSIONS[@]}" +do + docker run -d -e MYSQL_HOST=x -e MYSQL_PORT=9 -e MYSQL_USER=x -e MYSQL_PASSWORD=x -e MYSQL_INNODB_NUM_MEMBERS=1 --name mysql-router mysql/mysql-router:$MAJOR_VERSION sleep 5000 + inspec exec $MAJOR_VERSION/inspec/control.rb --controls container + inspec exec $MAJOR_VERSION/inspec/control.rb -t docker://mysql-router --controls packages + docker stop mysql-router + docker rm mysql-router +done diff --git a/5.5/Dockerfile b/mysql-server/5.5/Dockerfile similarity index 100% rename from 5.5/Dockerfile rename to mysql-server/5.5/Dockerfile diff --git a/5.5/docker-entrypoint.sh b/mysql-server/5.5/docker-entrypoint.sh similarity index 100% rename from 5.5/docker-entrypoint.sh rename to mysql-server/5.5/docker-entrypoint.sh diff --git a/template/healthcheck.sh b/mysql-server/5.5/healthcheck.sh old mode 100644 new mode 100755 similarity index 100% rename from template/healthcheck.sh rename to mysql-server/5.5/healthcheck.sh diff --git a/5.5/inspec/control.rb b/mysql-server/5.5/inspec/control.rb similarity index 100% rename from 5.5/inspec/control.rb rename to mysql-server/5.5/inspec/control.rb diff --git a/5.6/Dockerfile b/mysql-server/5.6/Dockerfile similarity index 100% rename from 5.6/Dockerfile rename to mysql-server/5.6/Dockerfile diff --git a/5.6/docker-entrypoint.sh b/mysql-server/5.6/docker-entrypoint.sh similarity index 100% rename from 5.6/docker-entrypoint.sh rename to mysql-server/5.6/docker-entrypoint.sh diff --git a/mysql-server/5.6/healthcheck.sh b/mysql-server/5.6/healthcheck.sh new file mode 100755 index 000000000..a3af37846 --- /dev/null +++ b/mysql-server/5.6/healthcheck.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# The mysql-init-complete file is touched by the entrypoint file before the +# main server process is started +if [ -f /mysql-init-complete ]; # The entrypoint script touches this file +then # Ping server to see if it is ready + mysqladmin --defaults-extra-file=/healthcheck.cnf ping +else # Initialization still in progress + exit 1 +fi diff --git a/5.6/inspec/control.rb b/mysql-server/5.6/inspec/control.rb similarity index 100% rename from 5.6/inspec/control.rb rename to mysql-server/5.6/inspec/control.rb diff --git a/5.7/Dockerfile b/mysql-server/5.7/Dockerfile similarity index 100% rename from 5.7/Dockerfile rename to mysql-server/5.7/Dockerfile diff --git a/5.7/docker-entrypoint.sh b/mysql-server/5.7/docker-entrypoint.sh similarity index 100% rename from 5.7/docker-entrypoint.sh rename to mysql-server/5.7/docker-entrypoint.sh diff --git a/mysql-server/5.7/healthcheck.sh b/mysql-server/5.7/healthcheck.sh new file mode 100755 index 000000000..a3af37846 --- /dev/null +++ b/mysql-server/5.7/healthcheck.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# The mysql-init-complete file is touched by the entrypoint file before the +# main server process is started +if [ -f /mysql-init-complete ]; # The entrypoint script touches this file +then # Ping server to see if it is ready + mysqladmin --defaults-extra-file=/healthcheck.cnf ping +else # Initialization still in progress + exit 1 +fi diff --git a/5.7/inspec/control.rb b/mysql-server/5.7/inspec/control.rb similarity index 100% rename from 5.7/inspec/control.rb rename to mysql-server/5.7/inspec/control.rb diff --git a/8.0/Dockerfile b/mysql-server/8.0/Dockerfile similarity index 100% rename from 8.0/Dockerfile rename to mysql-server/8.0/Dockerfile diff --git a/8.0/docker-entrypoint.sh b/mysql-server/8.0/docker-entrypoint.sh similarity index 100% rename from 8.0/docker-entrypoint.sh rename to mysql-server/8.0/docker-entrypoint.sh diff --git a/mysql-server/8.0/healthcheck.sh b/mysql-server/8.0/healthcheck.sh new file mode 100755 index 000000000..a3af37846 --- /dev/null +++ b/mysql-server/8.0/healthcheck.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# The mysql-init-complete file is touched by the entrypoint file before the +# main server process is started +if [ -f /mysql-init-complete ]; # The entrypoint script touches this file +then # Ping server to see if it is ready + mysqladmin --defaults-extra-file=/healthcheck.cnf ping +else # Initialization still in progress + exit 1 +fi diff --git a/8.0/inspec/control.rb b/mysql-server/8.0/inspec/control.rb similarity index 100% rename from 8.0/inspec/control.rb rename to mysql-server/8.0/inspec/control.rb diff --git a/README.md b/mysql-server/README.md similarity index 100% rename from README.md rename to mysql-server/README.md diff --git a/VERSION b/mysql-server/VERSION similarity index 100% rename from VERSION rename to mysql-server/VERSION diff --git a/build.sh b/mysql-server/build.sh similarity index 100% rename from build.sh rename to mysql-server/build.sh diff --git a/changelog b/mysql-server/changelog similarity index 100% rename from changelog rename to mysql-server/changelog diff --git a/gen_dockerfiles.sh b/mysql-server/gen_dockerfiles.sh similarity index 100% rename from gen_dockerfiles.sh rename to mysql-server/gen_dockerfiles.sh diff --git a/manifest.sh b/mysql-server/manifest.sh similarity index 100% rename from manifest.sh rename to mysql-server/manifest.sh diff --git a/tag.sh b/mysql-server/tag.sh similarity index 100% rename from tag.sh rename to mysql-server/tag.sh diff --git a/template/Dockerfile b/mysql-server/template/Dockerfile similarity index 100% rename from template/Dockerfile rename to mysql-server/template/Dockerfile diff --git a/template/control.rb b/mysql-server/template/control.rb similarity index 100% rename from template/control.rb rename to mysql-server/template/control.rb diff --git a/template/control_pre57.rb b/mysql-server/template/control_pre57.rb similarity index 100% rename from template/control_pre57.rb rename to mysql-server/template/control_pre57.rb diff --git a/template/docker-entrypoint.sh b/mysql-server/template/docker-entrypoint.sh similarity index 100% rename from template/docker-entrypoint.sh rename to mysql-server/template/docker-entrypoint.sh diff --git a/mysql-server/template/healthcheck.sh b/mysql-server/template/healthcheck.sh new file mode 100644 index 000000000..a3af37846 --- /dev/null +++ b/mysql-server/template/healthcheck.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# The mysql-init-complete file is touched by the entrypoint file before the +# main server process is started +if [ -f /mysql-init-complete ]; # The entrypoint script touches this file +then # Ping server to see if it is ready + mysqladmin --defaults-extra-file=/healthcheck.cnf ping +else # Initialization still in progress + exit 1 +fi diff --git a/test.sh b/mysql-server/test.sh similarity index 100% rename from test.sh rename to mysql-server/test.sh From 059108a774bb84e3ca6a5e9a370b5b9e366140d5 Mon Sep 17 00:00:00 2001 From: Alfredo Kojima Date: Wed, 10 Feb 2021 09:05:53 -0800 Subject: [PATCH 202/386] WL14492 MySQL Server and Cluster Docker Images Server * Removed EOLed 5.5 and 5.6 * Upgraded base image to el8-slim, switched from yum to microdnf * Generate password internally in entryfile, removed pwmake * Support for running in a container as non-root/mysql user * Write MySQL files in /var/lib/mysql instead of / * Always log to stderr * Added MYSQL_INITIALIZE_ONLY option Cluster * Applied same changes as server for 7.5, 7.6 and 8.0 Change-Id: Ie531eb5e3b2d2c3ecb4dc3557f4195c48f37aae7 --- mysql-cluster/7.5/Dockerfile | 25 ++- mysql-cluster/7.5/docker-entrypoint.sh | 158 +++++++------ mysql-cluster/7.5/healthcheck.sh | 6 +- .../7.5/prepare-image.sh | 19 +- mysql-cluster/7.6/Dockerfile | 25 ++- mysql-cluster/7.6/docker-entrypoint.sh | 158 +++++++------ mysql-cluster/7.6/healthcheck.sh | 6 +- .../7.6/prepare-image.sh | 19 +- mysql-cluster/8.0/Dockerfile | 33 +-- mysql-cluster/8.0/docker-entrypoint.sh | 160 ++++++++------ mysql-cluster/8.0/healthcheck.sh | 6 +- mysql-cluster/8.0/inspec/control.rb | 2 +- mysql-cluster/8.0/prepare-image.sh | 25 +++ mysql-cluster/VERSION | 19 +- mysql-cluster/gen_dockerfiles.sh | 118 +++++++--- mysql-cluster/template/Dockerfile | 31 +-- .../template/Dockerfile-pre8 | 34 +-- mysql-cluster/template/control.rb | 4 +- mysql-cluster/template/docker-entrypoint.sh | 160 ++++++++------ mysql-cluster/template/healthcheck.sh | 6 +- mysql-cluster/template/prepare-image.sh | 25 +++ mysql-router/template/run.sh | 93 ++++++++ mysql-server/5.5/docker-entrypoint.sh | 209 ------------------ mysql-server/5.5/inspec/control.rb | 17 -- mysql-server/5.6/docker-entrypoint.sh | 208 ----------------- mysql-server/5.6/inspec/control.rb | 17 -- mysql-server/5.7/Dockerfile | 31 +-- mysql-server/5.7/docker-entrypoint.sh | 91 +++++--- mysql-server/5.7/healthcheck.sh | 6 +- mysql-server/5.7/inspec/control.rb | 9 +- mysql-server/5.7/prepare-image.sh | 25 +++ mysql-server/8.0/Dockerfile | 37 ++-- mysql-server/8.0/docker-entrypoint.sh | 91 +++++--- mysql-server/8.0/healthcheck.sh | 6 +- mysql-server/8.0/inspec/control.rb | 9 +- mysql-server/8.0/prepare-image.sh | 25 +++ mysql-server/README.md | 8 +- mysql-server/VERSION | 11 +- mysql-server/changelog | 9 + mysql-server/gen_dockerfiles.sh | 77 +++---- mysql-server/template/Dockerfile | 29 ++- .../Dockerfile => template/Dockerfile-pre8} | 33 +-- mysql-server/template/control.rb | 5 +- mysql-server/template/control_pre57.rb | 17 -- mysql-server/template/docker-entrypoint.sh | 85 ++++--- mysql-server/template/healthcheck.sh | 6 +- mysql-server/template/prepare-image.sh | 25 +++ 47 files changed, 1114 insertions(+), 1104 deletions(-) rename mysql-server/5.5/healthcheck.sh => mysql-cluster/7.5/prepare-image.sh (62%) rename mysql-server/5.6/healthcheck.sh => mysql-cluster/7.6/prepare-image.sh (62%) create mode 100755 mysql-cluster/8.0/prepare-image.sh rename mysql-server/5.6/Dockerfile => mysql-cluster/template/Dockerfile-pre8 (55%) create mode 100644 mysql-cluster/template/prepare-image.sh create mode 100755 mysql-router/template/run.sh delete mode 100755 mysql-server/5.5/docker-entrypoint.sh delete mode 100644 mysql-server/5.5/inspec/control.rb delete mode 100755 mysql-server/5.6/docker-entrypoint.sh delete mode 100644 mysql-server/5.6/inspec/control.rb create mode 100755 mysql-server/5.7/prepare-image.sh create mode 100755 mysql-server/8.0/prepare-image.sh rename mysql-server/{5.5/Dockerfile => template/Dockerfile-pre8} (55%) delete mode 100644 mysql-server/template/control_pre57.rb create mode 100644 mysql-server/template/prepare-image.sh diff --git a/mysql-cluster/7.5/Dockerfile b/mysql-cluster/7.5/Dockerfile index 52f37da39..22cf2af4e 100644 --- a/mysql-cluster/7.5/Dockerfile +++ b/mysql-cluster/7.5/Dockerfile @@ -1,4 +1,4 @@ -# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, 2021, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,19 +18,20 @@ FROM oraclelinux:7-slim ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.5.21 ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.23 -# Install server -RUN yum install -y \ - https://repo.mysql.com/mysql-cluster-community-minimal-release-el7.rpm \ - https://repo.mysql.com/mysql-community-release-el7.rpm \ - && yum-config-manager --enable mysql-cluster75-minimal \ - && yum install -y \ - $MYSQL_CLUSTER_PACKAGE \ - $MYSQL_SHELL_PACKAGE \ - libpwquality \ +# Setup repositories for minimal packages (all versions) +RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el7.rpm \ + && rpm -U https://repo.mysql.com/mysql80-community-release-el7-1.noarch.rpm + +# Install server and shell 8.0 +RUN yum install -y $MYSQL_SHELL_PACKAGE \ + && yum install -y $MYSQL_CLUSTER_PACKAGE --enablerepo=mysql-cluster76-minimal\ && yum clean all \ && mkdir /docker-entrypoint-initdb.d -VOLUME /var/lib/mysql +COPY prepare-image.sh / +RUN /prepare-image.sh && rm -f /prepare-image.sh + +ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock COPY docker-entrypoint.sh /entrypoint.sh COPY healthcheck.sh /healthcheck.sh @@ -38,7 +39,7 @@ COPY cnf/my.cnf /etc/ COPY cnf/mysql-cluster.cnf /etc/ ENTRYPOINT ["/entrypoint.sh"] -EXPOSE 3306 33060 2202 1186 HEALTHCHECK CMD /healthcheck.sh +EXPOSE 3306 33060 2202 1186 CMD ["mysqld"] diff --git a/mysql-cluster/7.5/docker-entrypoint.sh b/mysql-cluster/7.5/docker-entrypoint.sh index 48a70494b..d6290fef6 100755 --- a/mysql-cluster/7.5/docker-entrypoint.sh +++ b/mysql-cluster/7.5/docker-entrypoint.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, 2021, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -13,10 +13,9 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - set -e -echo "[Entrypoint] MySQL Docker Image 7.5.21-1.1.19-cluster" +echo "[Entrypoint] MySQL Docker Image 7.5.21-1.2.0" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -25,6 +24,15 @@ _get_config() { "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' } +# Generate a random password +_mkpw() { + letter=$(cat /dev/urandom| tr -dc a-zA-Z | dd bs=1 count=16 2> /dev/null ) + number=$(cat /dev/urandom| tr -dc 0-9 | dd bs=1 count=8 2> /dev/null) + special=$(cat /dev/urandom| tr -dc '=+@#%^&*_.,;:?/' | dd bs=1 count=8 2> /dev/null) + + echo $letter$number$special | fold -w 1 | shuf | tr -d '\n' +} + # If command starts with an option, prepend mysqld # This allows users to add command-line options without # needing to specify the "mysqld" command @@ -32,6 +40,16 @@ if [ "${1:0:1}" = '-' ]; then set -- mysqld "$@" fi +# Check if entrypoint (and the container) is running as root +if [ $(id -u) = "0" ]; then + is_root=1 + install_devnull="install /dev/null -m0600 -omysql -gmysql" + MYSQLD_USER=mysql +else + install_devnull="install /dev/null -m0600" + MYSQLD_USER=$(id -u) +fi + if [ "$1" = 'mysqld' ]; then # Test that the server can start. We redirect stdout to /dev/null so # only the error messages are left. @@ -47,13 +65,6 @@ if [ "$1" = 'mysqld' ]; then DATADIR="$(_get_config 'datadir' "$@")" SOCKET="$(_get_config 'socket' "$@")" - if [ -n "$MYSQL_LOG_CONSOLE" ] || [ -n "console" ]; then - # Don't touch bind-mounted config files - if ! cat /proc/1/mounts | grep "etc/my.cnf"; then - sed -i 's/^log-error=/#&/' /etc/my.cnf - fi - fi - if [ ! -d "$DATADIR/mysql" ]; then # If the password variable is a filename we use the contents of the file. We # read this first to make sure that a proper error is generated for empty files. @@ -70,27 +81,44 @@ if [ "$1" = 'mysqld' ]; then MYSQL_RANDOM_ROOT_PASSWORD=true MYSQL_ONETIME_PASSWORD=true fi - mkdir -p "$DATADIR" - chown -R mysql:mysql "$DATADIR" + if [ ! -d "$DATADIR" ]; then + mkdir -p "$DATADIR" + chown mysql:mysql "$DATADIR" + fi echo '[Entrypoint] Initializing database' - "$@" --initialize-insecure + "$@" --user=$MYSQLD_USER --initialize-insecure echo '[Entrypoint] Database initialized' - "$@" --daemonize --skip-networking --socket="$SOCKET" + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" # To avoid using password on commandline, put it in a temporary file. # The file is only populated when and if the root password is set. PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) - install /dev/null -m0600 -omysql -gmysql "$PASSFILE" + $install_devnull "$PASSFILE" # Define the client command used throughout the script # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") - mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql - + if [ ! -z "" ]; + then + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break + fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 + fi + fi + + mysql_tzinfo_to_sql /usr/share/zoneinfo | %%SED_TZINFO%%"${mysql[@]}" mysql + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - MYSQL_ROOT_PASSWORD="$(pwmake 128)" + MYSQL_ROOT_PASSWORD="$(_mkpw)" echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" fi if [ -z "$MYSQL_ROOT_HOST" ]; then @@ -121,13 +149,6 @@ EOF mysql+=( "$MYSQL_DATABASE" ) fi - if [ -f "$MYSQL_PASSWORD" ]; then - MYSQL_PASSWORD="$(cat $MYSQL_PASSWORD)" - if [ -z "$MYSQL_PASSWORD" ]; then - echo >&2 '[Entrypoint] Empty MYSQL_PASSWORD file specified.' - exit 1 - fi - fi if [ "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then echo "CREATE USER '"$MYSQL_USER"'@'%' IDENTIFIED BY '"$MYSQL_PASSWORD"' ;" | "${mysql[@]}" @@ -156,21 +177,25 @@ EOF # This needs to be done outside the normal init, since mysqladmin shutdown will not work after if [ ! -z "$MYSQL_ONETIME_PASSWORD" ]; then - echo "[Entrypoint] Setting root user as expired. Password will need to be changed before database can be used." - SQL=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) - install /dev/null -m0600 -omysql -gmysql "$SQL" - if [ ! -z "$MYSQL_ROOT_HOST" ]; then - cat << EOF > "$SQL" -ALTER USER 'rootQL_ROOT_HOST}' PASSWORD EXPIRE; -ALTER USER 'roothost' PASSWORD EXPIRE; -EOF + if [ -z %%EXPIRE_SUPPORT%% ]; then + echo "[Entrypoint] User expiration is only supported in MySQL 5.6+" else - cat << EOF > "$SQL" -ALTER USER 'roothost' PASSWORD EXPIRE; + echo "[Entrypoint] Setting root user as expired. Password will need to be changed before database can be used." + SQL=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + $install_devnull "$SQL" + if [ ! -z "$MYSQL_ROOT_HOST" ]; then + cat << EOF > "$SQL" +ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL fi - set -- "$@" --init-file="$SQL" - unset SQL fi echo @@ -181,41 +206,50 @@ EOF # Used by healthcheck to make sure it doesn't mistakenly report container # healthy during startup # Put the password into the temporary config file - touch /healthcheck.cnf - cat >"/healthcheck.cnf" <"/var/lib/mysql-files/healthcheck.cnf" </dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' } +# Generate a random password +_mkpw() { + letter=$(cat /dev/urandom| tr -dc a-zA-Z | dd bs=1 count=16 2> /dev/null ) + number=$(cat /dev/urandom| tr -dc 0-9 | dd bs=1 count=8 2> /dev/null) + special=$(cat /dev/urandom| tr -dc '=+@#%^&*_.,;:?/' | dd bs=1 count=8 2> /dev/null) + + echo $letter$number$special | fold -w 1 | shuf | tr -d '\n' +} + # If command starts with an option, prepend mysqld # This allows users to add command-line options without # needing to specify the "mysqld" command @@ -32,6 +40,16 @@ if [ "${1:0:1}" = '-' ]; then set -- mysqld "$@" fi +# Check if entrypoint (and the container) is running as root +if [ $(id -u) = "0" ]; then + is_root=1 + install_devnull="install /dev/null -m0600 -omysql -gmysql" + MYSQLD_USER=mysql +else + install_devnull="install /dev/null -m0600" + MYSQLD_USER=$(id -u) +fi + if [ "$1" = 'mysqld' ]; then # Test that the server can start. We redirect stdout to /dev/null so # only the error messages are left. @@ -47,13 +65,6 @@ if [ "$1" = 'mysqld' ]; then DATADIR="$(_get_config 'datadir' "$@")" SOCKET="$(_get_config 'socket' "$@")" - if [ -n "$MYSQL_LOG_CONSOLE" ] || [ -n "console" ]; then - # Don't touch bind-mounted config files - if ! cat /proc/1/mounts | grep "etc/my.cnf"; then - sed -i 's/^log-error=/#&/' /etc/my.cnf - fi - fi - if [ ! -d "$DATADIR/mysql" ]; then # If the password variable is a filename we use the contents of the file. We # read this first to make sure that a proper error is generated for empty files. @@ -70,27 +81,44 @@ if [ "$1" = 'mysqld' ]; then MYSQL_RANDOM_ROOT_PASSWORD=true MYSQL_ONETIME_PASSWORD=true fi - mkdir -p "$DATADIR" - chown -R mysql:mysql "$DATADIR" + if [ ! -d "$DATADIR" ]; then + mkdir -p "$DATADIR" + chown mysql:mysql "$DATADIR" + fi echo '[Entrypoint] Initializing database' - "$@" --initialize-insecure + "$@" --user=$MYSQLD_USER --initialize-insecure echo '[Entrypoint] Database initialized' - "$@" --daemonize --skip-networking --socket="$SOCKET" + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" # To avoid using password on commandline, put it in a temporary file. # The file is only populated when and if the root password is set. PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) - install /dev/null -m0600 -omysql -gmysql "$PASSFILE" + $install_devnull "$PASSFILE" # Define the client command used throughout the script # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") - mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql - + if [ ! -z "" ]; + then + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break + fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 + fi + fi + + mysql_tzinfo_to_sql /usr/share/zoneinfo | %%SED_TZINFO%%"${mysql[@]}" mysql + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - MYSQL_ROOT_PASSWORD="$(pwmake 128)" + MYSQL_ROOT_PASSWORD="$(_mkpw)" echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" fi if [ -z "$MYSQL_ROOT_HOST" ]; then @@ -121,13 +149,6 @@ EOF mysql+=( "$MYSQL_DATABASE" ) fi - if [ -f "$MYSQL_PASSWORD" ]; then - MYSQL_PASSWORD="$(cat $MYSQL_PASSWORD)" - if [ -z "$MYSQL_PASSWORD" ]; then - echo >&2 '[Entrypoint] Empty MYSQL_PASSWORD file specified.' - exit 1 - fi - fi if [ "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then echo "CREATE USER '"$MYSQL_USER"'@'%' IDENTIFIED BY '"$MYSQL_PASSWORD"' ;" | "${mysql[@]}" @@ -156,21 +177,25 @@ EOF # This needs to be done outside the normal init, since mysqladmin shutdown will not work after if [ ! -z "$MYSQL_ONETIME_PASSWORD" ]; then - echo "[Entrypoint] Setting root user as expired. Password will need to be changed before database can be used." - SQL=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) - install /dev/null -m0600 -omysql -gmysql "$SQL" - if [ ! -z "$MYSQL_ROOT_HOST" ]; then - cat << EOF > "$SQL" -ALTER USER 'rootQL_ROOT_HOST}' PASSWORD EXPIRE; -ALTER USER 'roothost' PASSWORD EXPIRE; -EOF + if [ -z %%EXPIRE_SUPPORT%% ]; then + echo "[Entrypoint] User expiration is only supported in MySQL 5.6+" else - cat << EOF > "$SQL" -ALTER USER 'roothost' PASSWORD EXPIRE; + echo "[Entrypoint] Setting root user as expired. Password will need to be changed before database can be used." + SQL=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + $install_devnull "$SQL" + if [ ! -z "$MYSQL_ROOT_HOST" ]; then + cat << EOF > "$SQL" +ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL fi - set -- "$@" --init-file="$SQL" - unset SQL fi echo @@ -181,41 +206,50 @@ EOF # Used by healthcheck to make sure it doesn't mistakenly report container # healthy during startup # Put the password into the temporary config file - touch /healthcheck.cnf - cat >"/healthcheck.cnf" <"/var/lib/mysql-files/healthcheck.cnf" < /etc/dnf/dnf.conf \ + && microdnf install -y $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --disablerepo=ol8_appstream \ + --enablerepo=mysql-cluster80-minimal $MYSQL_CLUSTER_PACKAGE \ + && microdnf clean all \ && mkdir /docker-entrypoint-initdb.d -VOLUME /var/lib/mysql +COPY prepare-image.sh / +RUN /prepare-image.sh && rm -f /prepare-image.sh + +ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock COPY docker-entrypoint.sh /entrypoint.sh COPY healthcheck.sh /healthcheck.sh @@ -38,7 +41,7 @@ COPY cnf/my.cnf /etc/ COPY cnf/mysql-cluster.cnf /etc/ ENTRYPOINT ["/entrypoint.sh"] -EXPOSE 3306 33060 2202 1186 HEALTHCHECK CMD /healthcheck.sh +EXPOSE 3306 33060 2202 1186 CMD ["mysqld"] diff --git a/mysql-cluster/8.0/docker-entrypoint.sh b/mysql-cluster/8.0/docker-entrypoint.sh index 56a58c0f1..21f945913 100755 --- a/mysql-cluster/8.0/docker-entrypoint.sh +++ b/mysql-cluster/8.0/docker-entrypoint.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, 2021, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -13,10 +13,9 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - set -e -echo "[Entrypoint] MySQL Docker Image 8.0.23-1.1.19-cluster" +echo "[Entrypoint] MySQL Docker Image 8.0.24-1.2.0" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -25,6 +24,15 @@ _get_config() { "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' } +# Generate a random password +_mkpw() { + letter=$(cat /dev/urandom| tr -dc a-zA-Z | dd bs=1 count=16 2> /dev/null ) + number=$(cat /dev/urandom| tr -dc 0-9 | dd bs=1 count=8 2> /dev/null) + special=$(cat /dev/urandom| tr -dc '=+@#%^&*_.,;:?/' | dd bs=1 count=8 2> /dev/null) + + echo $letter$number$special | fold -w 1 | shuf | tr -d '\n' +} + # If command starts with an option, prepend mysqld # This allows users to add command-line options without # needing to specify the "mysqld" command @@ -32,11 +40,21 @@ if [ "${1:0:1}" = '-' ]; then set -- mysqld "$@" fi +# Check if entrypoint (and the container) is running as root +if [ $(id -u) = "0" ]; then + is_root=1 + install_devnull="install /dev/null -m0600 -omysql -gmysql" + MYSQLD_USER=mysql +else + install_devnull="install /dev/null -m0600" + MYSQLD_USER=$(id -u) +fi + if [ "$1" = 'mysqld' ]; then # Test that the server can start. We redirect stdout to /dev/null so # only the error messages are left. result=0 - output=$("$@" --verbose --help 2>&1 > /dev/null) || result=$? + output=$("$@" --validate-config) || result=$? if [ ! "$result" = "0" ]; then echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' echo >&2 "[Entrypoint] $output" @@ -47,13 +65,6 @@ if [ "$1" = 'mysqld' ]; then DATADIR="$(_get_config 'datadir' "$@")" SOCKET="$(_get_config 'socket' "$@")" - if [ -n "$MYSQL_LOG_CONSOLE" ] || [ -n "console" ]; then - # Don't touch bind-mounted config files - if ! cat /proc/1/mounts | grep "etc/my.cnf"; then - sed -i 's/^log-error=/#&/' /etc/my.cnf - fi - fi - if [ ! -d "$DATADIR/mysql" ]; then # If the password variable is a filename we use the contents of the file. We # read this first to make sure that a proper error is generated for empty files. @@ -70,27 +81,44 @@ if [ "$1" = 'mysqld' ]; then MYSQL_RANDOM_ROOT_PASSWORD=true MYSQL_ONETIME_PASSWORD=true fi - mkdir -p "$DATADIR" - chown -R mysql:mysql "$DATADIR" + if [ ! -d "$DATADIR" ]; then + mkdir -p "$DATADIR" + chown mysql:mysql "$DATADIR" + fi echo '[Entrypoint] Initializing database' - "$@" --initialize-insecure + "$@" --user=$MYSQLD_USER --initialize-insecure echo '[Entrypoint] Database initialized' - "$@" --daemonize --skip-networking --socket="$SOCKET" + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" # To avoid using password on commandline, put it in a temporary file. # The file is only populated when and if the root password is set. PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) - install /dev/null -m0600 -omysql -gmysql "$PASSFILE" + $install_devnull "$PASSFILE" # Define the client command used throughout the script # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") - mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql - + if [ ! -z ]; + then + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break + fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 + fi + fi + + mysql_tzinfo_to_sql /usr/share/zoneinfo | %%SED_TZINFO%%"${mysql[@]}" mysql + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - MYSQL_ROOT_PASSWORD="$(pwmake 128)" + MYSQL_ROOT_PASSWORD="$(_mkpw)" echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" fi if [ -z "$MYSQL_ROOT_HOST" ]; then @@ -121,13 +149,6 @@ EOF mysql+=( "$MYSQL_DATABASE" ) fi - if [ -f "$MYSQL_PASSWORD" ]; then - MYSQL_PASSWORD="$(cat $MYSQL_PASSWORD)" - if [ -z "$MYSQL_PASSWORD" ]; then - echo >&2 '[Entrypoint] Empty MYSQL_PASSWORD file specified.' - exit 1 - fi - fi if [ "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then echo "CREATE USER '"$MYSQL_USER"'@'%' IDENTIFIED BY '"$MYSQL_PASSWORD"' ;" | "${mysql[@]}" @@ -156,21 +177,25 @@ EOF # This needs to be done outside the normal init, since mysqladmin shutdown will not work after if [ ! -z "$MYSQL_ONETIME_PASSWORD" ]; then - echo "[Entrypoint] Setting root user as expired. Password will need to be changed before database can be used." - SQL=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) - install /dev/null -m0600 -omysql -gmysql "$SQL" - if [ ! -z "$MYSQL_ROOT_HOST" ]; then - cat << EOF > "$SQL" -ALTER USER 'rootQL_ROOT_HOST}' PASSWORD EXPIRE; -ALTER USER 'roothost' PASSWORD EXPIRE; -EOF + if [ -z %%EXPIRE_SUPPORT%% ]; then + echo "[Entrypoint] User expiration is only supported in MySQL 5.6+" else - cat << EOF > "$SQL" -ALTER USER 'roothost' PASSWORD EXPIRE; + echo "[Entrypoint] Setting root user as expired. Password will need to be changed before database can be used." + SQL=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + $install_devnull "$SQL" + if [ ! -z "$MYSQL_ROOT_HOST" ]; then + cat << EOF > "$SQL" +ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL fi - set -- "$@" --init-file="$SQL" - unset SQL fi echo @@ -181,41 +206,50 @@ EOF # Used by healthcheck to make sure it doesn't mistakenly report container # healthy during startup # Put the password into the temporary config file - touch /healthcheck.cnf - cat >"/healthcheck.cnf" <"/var/lib/mysql-files/healthcheck.cnf" < tmpFile - sed -i 's#%%MYSQL_SHELL_PACKAGE%%#'"mysql-shell-${MYSQL_SHELL_VERSIONS[${MAJOR_VERSION}]}"'#g' tmpFile - sed -i 's#%%REPO%%#'"${REPO}"'#g' tmpFile - REPO_VERSION=${MAJOR_VERSION//\./} - sed -i 's#%%REPO_VERSION%%#'"${REPO_VERSION}"'#g' tmpFile - mv tmpFile ${MAJOR_VERSION}/Dockerfile - - # control.rb - sed 's#%%MYSQL_CLUSTER_PACKAGE_VERSION%%#'"${MYSQL_CLUSTER_VERSIONS[${MAJOR_VERSION}]}"'#g' template/control.rb > tmpFile - sed -i 's#%%MYSQL_SHELL_PACKAGE_VERSION%%#'"${MYSQL_SHELL_VERSIONS[${MAJOR_VERSION}]}"'#g' tmpFile - if [ ! -d "${MAJOR_VERSION}/inspec" ]; then - mkdir "${MAJOR_VERSION}/inspec" +REPO_NAME=mysql; [ -n "$2" ] && REPO_NAME=$2 + +declare -A PASSWORDSET +PASSWORDSET["7.5"]="ALTER USER 'root'@'localhost' IDENTIFIED BY '\${MYSQL_ROOT_PASSWORD}';" +PASSWORDSET["7.6"]=${PASSWORDSET["7.5"]} +PASSWORDSET["8.0"]=${PASSWORDSET["7.6"]} + +declare -A DATABASE_INIT +DATABASE_INIT["7.5"]="\"\$@\" --user=\$MYSQLD_USER --initialize-insecure" +DATABASE_INIT["7.6"]="\"\$@\" --user=\$MYSQLD_USER --initialize-insecure" +DATABASE_INIT["8.0"]="\"\$@\" --user=\$MYSQLD_USER --initialize-insecure" + +# 5.7+ has the --daemonize flag, which makes the process fork and then exit when +# the server is ready, removing the need for a fragile wait loop +declare -A INIT_STARTUP +INIT_STARTUP["7.5"]="\"\$@\" --user=\$MYSQLD_USER --daemonize --skip-networking --socket=\"\$SOCKET\"" +INIT_STARTUP["7.6"]="\"\$@\" --user=\$MYSQLD_USER --daemonize --skip-networking --socket=\"\$SOCKET\"" +INIT_STARTUP["8.0"]="\"\$@\" --user=\$MYSQLD_USER --daemonize --skip-networking --socket=\"\$SOCKET\"" + +declare -A STARTUP +STARTUP["7.5"]="exec \"\$@\" --user=\$MYSQLD_USER" +STARTUP["7.6"]="exec \"\$@\" --user=\$MYSQLD_USER" +STARTUP["8.0"]="export MYSQLD_PARENT_PID=\$\$ ; exec \"\$@\" --user=$MYSQLD_USER" + +declare -A STARTUP_WAIT +STARTUP_WAIT["7.5"]="\"\"" +STARTUP_WAIT["7.6"]="\"\"" + + +# MySQL 8.0 supports a call to validate the config, while older versions have it as a side +# effect of running --verbose --help +declare -A VALIDATE_CONFIG +VALIDATE_CONFIG["7.5"]="output=\$(\"\$@\" --verbose --help 2>\&1 > /dev/null) || result=\$?" +VALIDATE_CONFIG["7.6"]="output=\$(\"\$@\" --verbose --help 2>\&1 > /dev/null) || result=\$?" +VALIDATE_CONFIG["8.0"]="output=\$(\"\$@\" --validate-config) || result=\$?" + +# Data directories that must be created with special ownership and permissions when the image is built +declare -A PRECREATE_DIRS +PRECREATE_DIRS["7.5"]="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" +PRECREATE_DIRS["7.6"]="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" +PRECREATE_DIRS["8.0"]="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" + +for VERSION in "${!MYSQL_CLUSTER_VERSIONS[@]}" +do + # Dockerfiles + MYSQL_CLUSTER_REPOPATH=yum/mysql-$VERSION-community/docker/x86_64 + DOCKERFILE_TEMPLATE=template/Dockerfile + if [ "${VERSION}" != "8.0" ]; then + DOCKERFILE_TEMPLATE=template/Dockerfile-pre8 + fi + sed 's#%%MYSQL_CLUSTER_PACKAGE%%#'"mysql-cluster-community-server-minimal-${MYSQL_CLUSTER_VERSIONS[${VERSION}]}"'#g' $DOCKERFILE_TEMPLATE > tmpfile + sed -i 's#%%REPO%%#'"${REPO}"'#g' tmpfile + sed -i 's#%%REPO_NAME%%#'"${REPO_NAME}"'#g' tmpfile + REPO_VERSION=${VERSION//\./} + sed -i 's#%%REPO_VERSION%%#'"${REPO_VERSION}"'#g' tmpfile + + if [[ ! -z ${MYSQL_SHELL_VERSIONS[${VERSION}]} ]]; then + sed -i 's#%%MYSQL_SHELL_PACKAGE%%#'"mysql-shell-${MYSQL_SHELL_VERSIONS[${VERSION}]}"'#g' tmpfile + else + sed -i 's#%%MYSQL_SHELL_PACKAGE%%#'""'#g' tmpfile + fi + + mv tmpfile ${VERSION}/Dockerfile + + # Dockerfile_spec.rb + if [ ! -d "${VERSION}/inspec" ]; then + mkdir "${VERSION}/inspec" fi - mv tmpFile "${MAJOR_VERSION}/inspec/control.rb" + sed 's#%%MYSQL_CLUSTER_VERSION%%#'"${MYSQL_CLUSTER_VERSIONS[${VERSION}]}"'#g' template/control.rb > tmpFile + sed -i 's#%%MYSQL_SHELL_VERSION%%#'"${MYSQL_SHELL_VERSIONS[${VERSION}]}"'#g' tmpFile + mv tmpFile "${VERSION}/inspec/control.rb" # Entrypoint - sed 's#%%PASSWORDSET%%#'"${PASSWORDSET[${MAJOR_VERSION}]}"'#g' template/docker-entrypoint.sh > tmpFile - sed -i 's#%%SERVER_VERSION_FULL%%#'"${SERVER_VERSION_FULL[${MAJOR_VERSION}]}"'#g' tmpFile - mv tmpFile ${MAJOR_VERSION}/docker-entrypoint.sh - chmod +x ${MAJOR_VERSION}/docker-entrypoint.sh + sed 's#%%PASSWORDSET%%#'"${PASSWORDSET[${VERSION}]}"'#g' template/docker-entrypoint.sh > tmpfile + sed -i 's#%%DATABASE_INIT%%#'"${DATABASE_INIT[${VERSION}]}"'#g' tmpfile + sed -i 's#%%INIT_STARTUP%%#'"${INIT_STARTUP[${VERSION}]}"'#g' tmpfile + sed -i 's#%%STARTUP%%#'"${STARTUP[${VERSION}]}"'#g' tmpfile + sed -i 's#%%STARTUP_WAIT%%#'"${STARTUP_WAIT[${VERSION}]}"'#g' tmpfile + sed -i 's#%%FULL_SERVER_VERSION%%#'"${FULL_SERVER_VERSIONS[${VERSION}]}"'#g' tmpfile + sed -i 's#%%VALIDATE_CONFIG%%#'"${VALIDATE_CONFIG[${VERSION}]}"'#g' tmpfile + mv tmpfile ${VERSION}/docker-entrypoint.sh + chmod +x ${VERSION}/docker-entrypoint.sh # Healthcheck - cp template/healthcheck.sh ${MAJOR_VERSION}/ - chmod +x ${MAJOR_VERSION}/healthcheck.sh + cp template/healthcheck.sh ${VERSION}/ + chmod +x ${VERSION}/healthcheck.sh - # Config - cp -r template/cnf ${MAJOR_VERSION}/ + # Build-time preparation script + sed 's#%%PRECREATE_DIRS%%#'"${PRECREATE_DIRS[${VERSION}]}"'#g' template/prepare-image.sh > tmpfile + mv tmpfile ${VERSION}/prepare-image.sh + chmod +x ${VERSION}/prepare-image.sh done diff --git a/mysql-cluster/template/Dockerfile b/mysql-cluster/template/Dockerfile index aa4b38f75..829d1b601 100644 --- a/mysql-cluster/template/Dockerfile +++ b/mysql-cluster/template/Dockerfile @@ -1,4 +1,4 @@ -# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, 2021, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -13,24 +13,27 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -FROM oraclelinux:7-slim +FROM oraclelinux:8-slim ARG MYSQL_CLUSTER_PACKAGE=%%MYSQL_CLUSTER_PACKAGE%% ARG MYSQL_SHELL_PACKAGE=%%MYSQL_SHELL_PACKAGE%% -# Install server -RUN yum install -y \ - %%REPO%%/mysql-cluster-community-minimal-release-el7.rpm \ - %%REPO%%/mysql-community-release-el7.rpm \ - && yum-config-manager --enable mysql-cluster%%REPO_VERSION%%-minimal \ - && yum install -y \ - $MYSQL_CLUSTER_PACKAGE \ - $MYSQL_SHELL_PACKAGE \ - libpwquality \ - && yum clean all \ +# Setup repositories for minimal packages (all versions) +RUN rpm -U %%REPO%%/mysql-cluster-community-minimal-release-el8.rpm \ + && rpm -U %%REPO%%/mysql80-community-release-el8.rpm + +# Install server and shell 8.0 +RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ + && microdnf install -y $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --disablerepo=ol8_appstream \ + --enablerepo=%%REPO_NAME%%-cluster%%REPO_VERSION%%-minimal $MYSQL_CLUSTER_PACKAGE \ + && microdnf clean all \ && mkdir /docker-entrypoint-initdb.d -VOLUME /var/lib/mysql +COPY prepare-image.sh / +RUN /prepare-image.sh && rm -f /prepare-image.sh + +ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock COPY docker-entrypoint.sh /entrypoint.sh COPY healthcheck.sh /healthcheck.sh @@ -38,7 +41,7 @@ COPY cnf/my.cnf /etc/ COPY cnf/mysql-cluster.cnf /etc/ ENTRYPOINT ["/entrypoint.sh"] -EXPOSE 3306 33060 2202 1186 HEALTHCHECK CMD /healthcheck.sh +EXPOSE 3306 33060 2202 1186 CMD ["mysqld"] diff --git a/mysql-server/5.6/Dockerfile b/mysql-cluster/template/Dockerfile-pre8 similarity index 55% rename from mysql-server/5.6/Dockerfile rename to mysql-cluster/template/Dockerfile-pre8 index 017f53eb5..421fcee5d 100644 --- a/mysql-server/5.6/Dockerfile +++ b/mysql-cluster/template/Dockerfile-pre8 @@ -1,4 +1,4 @@ -# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, 2021, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -12,28 +12,34 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.6.51 -ARG MYSQL_SHELL_PACKAGE= - -# Install server -RUN yum install -y https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ - https://repo.mysql.com/mysql-community-release-el7.rpm \ - && yum-config-manager --enable mysql56-server-minimal \ - && yum install -y \ - $MYSQL_SERVER_PACKAGE \ - $MYSQL_SHELL_PACKAGE \ - libpwquality \ +ARG MYSQL_CLUSTER_PACKAGE=%%MYSQL_CLUSTER_PACKAGE%% +ARG MYSQL_SHELL_PACKAGE=%%MYSQL_SHELL_PACKAGE%% + +# Setup repositories for minimal packages (all versions) +RUN rpm -U %%REPO%%/mysql-cluster-community-minimal-release-el7.rpm \ + && rpm -U %%REPO%%/mysql80-community-release-el7-1.noarch.rpm + +# Install server and shell 8.0 +RUN yum install -y $MYSQL_SHELL_PACKAGE \ + && yum install -y $MYSQL_CLUSTER_PACKAGE --enablerepo=mysql-cluster76-minimal\ && yum clean all \ && mkdir /docker-entrypoint-initdb.d -VOLUME /var/lib/mysql +COPY prepare-image.sh / +RUN /prepare-image.sh && rm -f /prepare-image.sh + +ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock COPY docker-entrypoint.sh /entrypoint.sh COPY healthcheck.sh /healthcheck.sh +COPY cnf/my.cnf /etc/ +COPY cnf/mysql-cluster.cnf /etc/ + ENTRYPOINT ["/entrypoint.sh"] HEALTHCHECK CMD /healthcheck.sh -EXPOSE 3306 +EXPOSE 3306 33060 2202 1186 CMD ["mysqld"] diff --git a/mysql-cluster/template/control.rb b/mysql-cluster/template/control.rb index f8ded4a9c..9e47dc6d5 100644 --- a/mysql-cluster/template/control.rb +++ b/mysql-cluster/template/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '%%MYSQL_CLUSTER_PACKAGE_VERSION%%.*' } + its ('version') { should match '%%MYSQL_CLUSTER_VERSION%%.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '%%MYSQL_SHELL_PACKAGE_VERSION%%.*' } + its ('version') { should match '%%MYSQL_SHELL_VERSION%%.*' } end end diff --git a/mysql-cluster/template/docker-entrypoint.sh b/mysql-cluster/template/docker-entrypoint.sh index 3f5487aab..a18c9dfdd 100644 --- a/mysql-cluster/template/docker-entrypoint.sh +++ b/mysql-cluster/template/docker-entrypoint.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, 2021, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -13,10 +13,9 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - set -e -echo "[Entrypoint] MySQL Docker Image %%SERVER_VERSION_FULL%%" +echo "[Entrypoint] MySQL Docker Image %%FULL_SERVER_VERSION%%" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -25,6 +24,15 @@ _get_config() { "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' } +# Generate a random password +_mkpw() { + letter=$(cat /dev/urandom| tr -dc a-zA-Z | dd bs=1 count=16 2> /dev/null ) + number=$(cat /dev/urandom| tr -dc 0-9 | dd bs=1 count=8 2> /dev/null) + special=$(cat /dev/urandom| tr -dc '=+@#%^&*_.,;:?/' | dd bs=1 count=8 2> /dev/null) + + echo $letter$number$special | fold -w 1 | shuf | tr -d '\n' +} + # If command starts with an option, prepend mysqld # This allows users to add command-line options without # needing to specify the "mysqld" command @@ -32,11 +40,21 @@ if [ "${1:0:1}" = '-' ]; then set -- mysqld "$@" fi +# Check if entrypoint (and the container) is running as root +if [ $(id -u) = "0" ]; then + is_root=1 + install_devnull="install /dev/null -m0600 -omysql -gmysql" + MYSQLD_USER=mysql +else + install_devnull="install /dev/null -m0600" + MYSQLD_USER=$(id -u) +fi + if [ "$1" = 'mysqld' ]; then # Test that the server can start. We redirect stdout to /dev/null so # only the error messages are left. result=0 - output=$("$@" --verbose --help 2>&1 > /dev/null) || result=$? + %%VALIDATE_CONFIG%% if [ ! "$result" = "0" ]; then echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' echo >&2 "[Entrypoint] $output" @@ -47,13 +65,6 @@ if [ "$1" = 'mysqld' ]; then DATADIR="$(_get_config 'datadir' "$@")" SOCKET="$(_get_config 'socket' "$@")" - if [ -n "$MYSQL_LOG_CONSOLE" ] || [ -n "console" ]; then - # Don't touch bind-mounted config files - if ! cat /proc/1/mounts | grep "etc/my.cnf"; then - sed -i 's/^log-error=/#&/' /etc/my.cnf - fi - fi - if [ ! -d "$DATADIR/mysql" ]; then # If the password variable is a filename we use the contents of the file. We # read this first to make sure that a proper error is generated for empty files. @@ -70,27 +81,44 @@ if [ "$1" = 'mysqld' ]; then MYSQL_RANDOM_ROOT_PASSWORD=true MYSQL_ONETIME_PASSWORD=true fi - mkdir -p "$DATADIR" - chown -R mysql:mysql "$DATADIR" + if [ ! -d "$DATADIR" ]; then + mkdir -p "$DATADIR" + chown mysql:mysql "$DATADIR" + fi echo '[Entrypoint] Initializing database' - "$@" --initialize-insecure + %%DATABASE_INIT%% echo '[Entrypoint] Database initialized' - "$@" --daemonize --skip-networking --socket="$SOCKET" + %%INIT_STARTUP%% # To avoid using password on commandline, put it in a temporary file. # The file is only populated when and if the root password is set. PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) - install /dev/null -m0600 -omysql -gmysql "$PASSFILE" + $install_devnull "$PASSFILE" # Define the client command used throughout the script # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") - mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql - + if [ ! -z %%STARTUP_WAIT%% ]; + then + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break + fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 + fi + fi + + mysql_tzinfo_to_sql /usr/share/zoneinfo | %%SED_TZINFO%%"${mysql[@]}" mysql + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - MYSQL_ROOT_PASSWORD="$(pwmake 128)" + MYSQL_ROOT_PASSWORD="$(_mkpw)" echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" fi if [ -z "$MYSQL_ROOT_HOST" ]; then @@ -121,13 +149,6 @@ EOF mysql+=( "$MYSQL_DATABASE" ) fi - if [ -f "$MYSQL_PASSWORD" ]; then - MYSQL_PASSWORD="$(cat $MYSQL_PASSWORD)" - if [ -z "$MYSQL_PASSWORD" ]; then - echo >&2 '[Entrypoint] Empty MYSQL_PASSWORD file specified.' - exit 1 - fi - fi if [ "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then echo "CREATE USER '"$MYSQL_USER"'@'%' IDENTIFIED BY '"$MYSQL_PASSWORD"' ;" | "${mysql[@]}" @@ -156,21 +177,25 @@ EOF # This needs to be done outside the normal init, since mysqladmin shutdown will not work after if [ ! -z "$MYSQL_ONETIME_PASSWORD" ]; then - echo "[Entrypoint] Setting root user as expired. Password will need to be changed before database can be used." - SQL=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) - install /dev/null -m0600 -omysql -gmysql "$SQL" - if [ ! -z "$MYSQL_ROOT_HOST" ]; then - cat << EOF > "$SQL" -ALTER USER 'rootQL_ROOT_HOST}' PASSWORD EXPIRE; -ALTER USER 'roothost' PASSWORD EXPIRE; -EOF + if [ -z %%EXPIRE_SUPPORT%% ]; then + echo "[Entrypoint] User expiration is only supported in MySQL 5.6+" else - cat << EOF > "$SQL" -ALTER USER 'roothost' PASSWORD EXPIRE; + echo "[Entrypoint] Setting root user as expired. Password will need to be changed before database can be used." + SQL=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + $install_devnull "$SQL" + if [ ! -z "$MYSQL_ROOT_HOST" ]; then + cat << EOF > "$SQL" +ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL fi - set -- "$@" --init-file="$SQL" - unset SQL fi echo @@ -181,41 +206,50 @@ EOF # Used by healthcheck to make sure it doesn't mistakenly report container # healthy during startup # Put the password into the temporary config file - touch /healthcheck.cnf - cat >"/healthcheck.cnf" <"/var/lib/mysql-files/healthcheck.cnf" < "$PASSFILE" + DEFAULTS_EXTRA_FILE=$(mktemp) + cat >"$DEFAULTS_EXTRA_FILE" < "/dev/tcp/$MYSQL_HOST/$MYSQL_PORT") >/dev/null 2>&1; do + echo "[Entrypoint] Waiting for mysql server $MYSQL_HOST ($attempt_num/$max_tries)" + sleep $(( attempt_num++ )) + if (( attempt_num == max_tries )); then + exit 1 + fi + done + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST:$MYSQL_PORT. Checking for cluster state." + if ! [[ "$(mysql --defaults-extra-file="$DEFAULTS_EXTRA_FILE" -u "$MYSQL_USER" -h "$MYSQL_HOST" -P "$MYSQL_PORT" -e "show status;" 2> /dev/null)" ]]; then + echo "[Entrypoint] ERROR: Can not connect to database. Exiting." + exit 1 + fi + if [[ -n $MYSQL_INNODB_CLUSTER_MEMBERS ]]; then + attempt_num=0 + echo $attempt_num + echo $max_tries + until [ "$(mysql --defaults-extra-file="$DEFAULTS_EXTRA_FILE" -u "$MYSQL_USER" -h "$MYSQL_HOST" -P "$MYSQL_PORT" -N performance_schema -e "select count(MEMBER_STATE) >= $MYSQL_INNODB_CLUSTER_MEMBERS from replication_group_members where MEMBER_STATE = 'ONLINE';" 2> /dev/null)" -eq 1 ]; do + echo "[Entrypoint] Waiting for $MYSQL_INNODB_CLUSTER_MEMBERS cluster instances to become available via $MYSQL_HOST ($attempt_num/$max_tries)" + sleep $(( attempt_num++ )) + if (( attempt_num == max_tries )); then + exit 1 + fi + done + echo "[Entrypoint] Successfully contacted cluster with $MYSQL_INNODB_CLUSTER_MEMBERS members. Bootstrapping." + fi + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap." + if [ "$MYSQL_CREATE_ROUTER_USER" = "0" ]; then + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap reusing account \"$MYSQL_USER\"." + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force --account-create=never --account=$MYSQL_USER < "$PASSFILE" + else + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap." + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force < "$PASSFILE" + fi + + sed -i -e 's/logging_folder=.*$/logging_folder=/' /tmp/mysqlrouter/mysqlrouter.conf + echo "[Entrypoint] Starting mysql-router." + exec "$@" --config /tmp/mysqlrouter/mysqlrouter.conf +fi + +rm -f "$PASSFILE" +rm -f "$DEFAULTS_EXTRA_FILE" +unset DEFAULTS_EXTRA_FILE + +exec "$@" + diff --git a/mysql-server/5.5/docker-entrypoint.sh b/mysql-server/5.5/docker-entrypoint.sh deleted file mode 100755 index a75e774f1..000000000 --- a/mysql-server/5.5/docker-entrypoint.sh +++ /dev/null @@ -1,209 +0,0 @@ -#!/bin/bash -# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -set -e - -echo "[Entrypoint] MySQL Docker Image 5.5.62-1.1.10" -# Fetch value from server config -# We use mysqld --verbose --help instead of my_print_defaults because the -# latter only show values present in config files, and not server defaults -_get_config() { - local conf="$1"; shift - "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' -} - -# If command starts with an option, prepend mysqld -# This allows users to add command-line options without -# needing to specify the "mysqld" command -if [ "${1:0:1}" = '-' ]; then - set -- mysqld "$@" -fi - -if [ "$1" = 'mysqld' ]; then - # Test that the server can start. We redirect stdout to /dev/null so - # only the error messages are left. - result=0 - output=$("$@" --verbose --help 2>&1 > /dev/null) || result=$? - if [ ! "$result" = "0" ]; then - echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' - echo >&2 "[Entrypoint] $output" - exit 1 - fi - - # Get config - DATADIR="$(_get_config 'datadir' "$@")" - SOCKET="$(_get_config 'socket' "$@")" - - if [ -n "$MYSQL_LOG_CONSOLE" ] || [ -n "" ]; then - # Don't touch bind-mounted config files - if ! cat /proc/1/mounts | grep "etc/my.cnf"; then - sed -i 's/^log-error=/#&/' /etc/my.cnf - fi - fi - - if [ ! -d "$DATADIR/mysql" ]; then - # If the password variable is a filename we use the contents of the file. We - # read this first to make sure that a proper error is generated for empty files. - if [ -f "$MYSQL_ROOT_PASSWORD" ]; then - MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" - if [ -z "$MYSQL_ROOT_PASSWORD" ]; then - echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' - exit 1 - fi - fi - if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - echo >&2 '[Entrypoint] No password option specified for new database.' - echo >&2 '[Entrypoint] A random onetime password will be generated.' - MYSQL_RANDOM_ROOT_PASSWORD=true - MYSQL_ONETIME_PASSWORD=true - fi - mkdir -p "$DATADIR" - chown -R mysql:mysql "$DATADIR" - - echo '[Entrypoint] Initializing database' - mysql_install_db --user=mysql --datadir="$DATADIR" --rpm - echo '[Entrypoint] Database initialized' - - "$@" --skip-networking --socket="$SOCKET" & - - # To avoid using password on commandline, put it in a temporary file. - # The file is only populated when and if the root password is set. - PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) - install /dev/null -m0600 -omysql -gmysql "$PASSFILE" - # Define the client command used throughout the script - # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly - mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") - - if [ ! -z "yes" ]; - then - for i in {30..0}; do - if mysqladmin --socket="$SOCKET" ping &>/dev/null; then - break - fi - echo '[Entrypoint] Waiting for server...' - sleep 1 - done - if [ "$i" = 0 ]; then - echo >&2 '[Entrypoint] Timeout during MySQL init.' - exit 1 - fi - fi - - mysql_tzinfo_to_sql /usr/share/zoneinfo | sed 's/Local time zone must be set--see zic manual page/FCTY/' | "${mysql[@]}" mysql - - if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - MYSQL_ROOT_PASSWORD="$(pwmake 128)" - echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" - fi - if [ -z "$MYSQL_ROOT_HOST" ]; then - ROOTCREATE="SET PASSWORD FOR 'root'@'localhost'=PASSWORD('${MYSQL_ROOT_PASSWORD}');" - else - ROOTCREATE="SET PASSWORD FOR 'root'@'localhost'=PASSWORD('${MYSQL_ROOT_PASSWORD}'); \ - CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ - GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ - GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" - fi - "${mysql[@]}" <<-EOSQL - DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); - CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; - ${ROOTCREATE} - FLUSH PRIVILEGES ; - EOSQL - if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then - # Put the password into the temporary config file - cat >"$PASSFILE" < "$SQL" -ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; -ALTER USER 'root'@'localhost' PASSWORD EXPIRE; -EOF - else - cat << EOF > "$SQL" -ALTER USER 'root'@'localhost' PASSWORD EXPIRE; -EOF - fi - set -- "$@" --init-file="$SQL" - unset SQL - fi - fi - - echo - echo '[Entrypoint] MySQL init process done. Ready for start up.' - echo - fi - - # Used by healthcheck to make sure it doesn't mistakenly report container - # healthy during startup - # Put the password into the temporary config file - touch /healthcheck.cnf - cat >"/healthcheck.cnf" </dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' -} - -# If command starts with an option, prepend mysqld -# This allows users to add command-line options without -# needing to specify the "mysqld" command -if [ "${1:0:1}" = '-' ]; then - set -- mysqld "$@" -fi - -if [ "$1" = 'mysqld' ]; then - # Test that the server can start. We redirect stdout to /dev/null so - # only the error messages are left. - result=0 - output=$("$@" --verbose --help 2>&1 > /dev/null) || result=$? - if [ ! "$result" = "0" ]; then - echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' - echo >&2 "[Entrypoint] $output" - exit 1 - fi - - # Get config - DATADIR="$(_get_config 'datadir' "$@")" - SOCKET="$(_get_config 'socket' "$@")" - - if [ -n "$MYSQL_LOG_CONSOLE" ] || [ -n "" ]; then - # Don't touch bind-mounted config files - if ! cat /proc/1/mounts | grep "etc/my.cnf"; then - sed -i 's/^log-error=/#&/' /etc/my.cnf - fi - fi - - if [ ! -d "$DATADIR/mysql" ]; then - # If the password variable is a filename we use the contents of the file. We - # read this first to make sure that a proper error is generated for empty files. - if [ -f "$MYSQL_ROOT_PASSWORD" ]; then - MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" - if [ -z "$MYSQL_ROOT_PASSWORD" ]; then - echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' - exit 1 - fi - fi - if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - echo >&2 '[Entrypoint] No password option specified for new database.' - echo >&2 '[Entrypoint] A random onetime password will be generated.' - MYSQL_RANDOM_ROOT_PASSWORD=true - MYSQL_ONETIME_PASSWORD=true - fi - mkdir -p "$DATADIR" - chown -R mysql:mysql "$DATADIR" - - echo '[Entrypoint] Initializing database' - mysql_install_db --user=mysql --datadir="$DATADIR" --rpm --keep-my-cnf - echo '[Entrypoint] Database initialized' - - "$@" --skip-networking --socket="$SOCKET" & - - # To avoid using password on commandline, put it in a temporary file. - # The file is only populated when and if the root password is set. - PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) - install /dev/null -m0600 -omysql -gmysql "$PASSFILE" - # Define the client command used throughout the script - # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly - mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") - - if [ ! -z "yes" ]; - then - for i in {30..0}; do - if mysqladmin --socket="$SOCKET" ping &>/dev/null; then - break - fi - echo '[Entrypoint] Waiting for server...' - sleep 1 - done - if [ "$i" = 0 ]; then - echo >&2 '[Entrypoint] Timeout during MySQL init.' - exit 1 - fi - fi - - mysql_tzinfo_to_sql /usr/share/zoneinfo | sed 's/Local time zone must be set--see zic manual page/FCTY/' | "${mysql[@]}" mysql - - if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - MYSQL_ROOT_PASSWORD="$(pwmake 128)" - echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" - fi - if [ -z "$MYSQL_ROOT_HOST" ]; then - ROOTCREATE="SET PASSWORD FOR 'root'@'localhost'=PASSWORD('${MYSQL_ROOT_PASSWORD}');" - else - ROOTCREATE="SET PASSWORD FOR 'root'@'localhost'=PASSWORD('${MYSQL_ROOT_PASSWORD}'); \ - CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ - GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ - GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" - fi - "${mysql[@]}" <<-EOSQL - DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); - CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; - ${ROOTCREATE} - FLUSH PRIVILEGES ; - EOSQL - if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then - # Put the password into the temporary config file - cat >"$PASSFILE" < "$SQL" -ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; -ALTER USER 'root'@'localhost' PASSWORD EXPIRE; -EOF - else - cat << EOF > "$SQL" -ALTER USER 'root'@'localhost' PASSWORD EXPIRE; -EOF - fi - set -- "$@" --init-file="$SQL" - unset SQL - fi - fi - - echo - echo '[Entrypoint] MySQL init process done. Ready for start up.' - echo - fi - - # Used by healthcheck to make sure it doesn't mistakenly report container - # healthy during startup - # Put the password into the temporary config file - touch /healthcheck.cnf - cat >"/healthcheck.cnf" </dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' } +# Generate a random password +_mkpw() { + letter=$(cat /dev/urandom| tr -dc a-zA-Z | dd bs=1 count=16 2> /dev/null ) + number=$(cat /dev/urandom| tr -dc 0-9 | dd bs=1 count=8 2> /dev/null) + special=$(cat /dev/urandom| tr -dc '=+@#%^&*_.,;:?/' | dd bs=1 count=8 2> /dev/null) + + echo $letter$number$special | fold -w 1 | shuf | tr -d '\n' +} + # If command starts with an option, prepend mysqld # This allows users to add command-line options without # needing to specify the "mysqld" command @@ -31,6 +40,16 @@ if [ "${1:0:1}" = '-' ]; then set -- mysqld "$@" fi +# Check if entrypoint (and the container) is running as root +if [ $(id -u) = "0" ]; then + is_root=1 + install_devnull="install /dev/null -m0600 -omysql -gmysql" + MYSQLD_USER=mysql +else + install_devnull="install /dev/null -m0600" + MYSQLD_USER=$(id -u) +fi + if [ "$1" = 'mysqld' ]; then # Test that the server can start. We redirect stdout to /dev/null so # only the error messages are left. @@ -46,13 +65,6 @@ if [ "$1" = 'mysqld' ]; then DATADIR="$(_get_config 'datadir' "$@")" SOCKET="$(_get_config 'socket' "$@")" - if [ -n "$MYSQL_LOG_CONSOLE" ] || [ -n "" ]; then - # Don't touch bind-mounted config files - if ! cat /proc/1/mounts | grep "etc/my.cnf"; then - sed -i 's/^log-error=/#&/' /etc/my.cnf - fi - fi - if [ ! -d "$DATADIR/mysql" ]; then # If the password variable is a filename we use the contents of the file. We # read this first to make sure that a proper error is generated for empty files. @@ -69,19 +81,21 @@ if [ "$1" = 'mysqld' ]; then MYSQL_RANDOM_ROOT_PASSWORD=true MYSQL_ONETIME_PASSWORD=true fi - mkdir -p "$DATADIR" - chown -R mysql:mysql "$DATADIR" + if [ ! -d "$DATADIR" ]; then + mkdir -p "$DATADIR" + chown mysql:mysql "$DATADIR" + fi echo '[Entrypoint] Initializing database' - "$@" --initialize-insecure + "$@" --user=$MYSQLD_USER --initialize-insecure echo '[Entrypoint] Database initialized' - "$@" --daemonize --skip-networking --socket="$SOCKET" + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" # To avoid using password on commandline, put it in a temporary file. # The file is only populated when and if the root password is set. PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) - install /dev/null -m0600 -omysql -gmysql "$PASSFILE" + $install_devnull "$PASSFILE" # Define the client command used throughout the script # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") @@ -102,9 +116,9 @@ if [ "$1" = 'mysqld' ]; then fi mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql - + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - MYSQL_ROOT_PASSWORD="$(pwmake 128)" + MYSQL_ROOT_PASSWORD="$(_mkpw)" echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" fi if [ -z "$MYSQL_ROOT_HOST" ]; then @@ -163,25 +177,21 @@ EOF # This needs to be done outside the normal init, since mysqladmin shutdown will not work after if [ ! -z "$MYSQL_ONETIME_PASSWORD" ]; then - if [ -z "yes" ]; then - echo "[Entrypoint] User expiration is only supported in MySQL 5.6+" - else - echo "[Entrypoint] Setting root user as expired. Password will need to be changed before database can be used." - SQL=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) - install /dev/null -m0600 -omysql -gmysql "$SQL" - if [ ! -z "$MYSQL_ROOT_HOST" ]; then - cat << EOF > "$SQL" + echo "[Entrypoint] Setting root user as expired. Password will need to be changed before database can be used." + SQL=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + $install_devnull "$SQL" + if [ ! -z "$MYSQL_ROOT_HOST" ]; then + cat << EOF > "$SQL" ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; ALTER USER 'root'@'localhost' PASSWORD EXPIRE; EOF - else - cat << EOF > "$SQL" + else + cat << EOF > "$SQL" ALTER USER 'root'@'localhost' PASSWORD EXPIRE; EOF - fi - set -- "$@" --init-file="$SQL" - unset SQL fi + set -- "$@" --init-file="$SQL" + unset SQL fi echo @@ -192,17 +202,26 @@ EOF # Used by healthcheck to make sure it doesn't mistakenly report container # healthy during startup # Put the password into the temporary config file - touch /healthcheck.cnf - cat >"/healthcheck.cnf" <"/var/lib/mysql-files/healthcheck.cnf" < /etc/dnf/dnf.conf \ + && microdnf install -y $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --disablerepo=ol8_appstream \ + --enablerepo=mysql80-server-minimal $MYSQL_SERVER_PACKAGE \ + && microdnf clean all \ && mkdir /docker-entrypoint-initdb.d -VOLUME /var/lib/mysql +COPY prepare-image.sh / +RUN /prepare-image.sh && rm -f /prepare-image.sh + +ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock COPY docker-entrypoint.sh /entrypoint.sh COPY healthcheck.sh /healthcheck.sh diff --git a/mysql-server/8.0/docker-entrypoint.sh b/mysql-server/8.0/docker-entrypoint.sh index 24b5fbdf2..1057d5ed9 100755 --- a/mysql-server/8.0/docker-entrypoint.sh +++ b/mysql-server/8.0/docker-entrypoint.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, 2021, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.23-1.1.19" +echo "[Entrypoint] MySQL Docker Image 8.0.24-1.2.0" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -24,6 +24,15 @@ _get_config() { "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' } +# Generate a random password +_mkpw() { + letter=$(cat /dev/urandom| tr -dc a-zA-Z | dd bs=1 count=16 2> /dev/null ) + number=$(cat /dev/urandom| tr -dc 0-9 | dd bs=1 count=8 2> /dev/null) + special=$(cat /dev/urandom| tr -dc '=+@#%^&*_.,;:?/' | dd bs=1 count=8 2> /dev/null) + + echo $letter$number$special | fold -w 1 | shuf | tr -d '\n' +} + # If command starts with an option, prepend mysqld # This allows users to add command-line options without # needing to specify the "mysqld" command @@ -31,6 +40,16 @@ if [ "${1:0:1}" = '-' ]; then set -- mysqld "$@" fi +# Check if entrypoint (and the container) is running as root +if [ $(id -u) = "0" ]; then + is_root=1 + install_devnull="install /dev/null -m0600 -omysql -gmysql" + MYSQLD_USER=mysql +else + install_devnull="install /dev/null -m0600" + MYSQLD_USER=$(id -u) +fi + if [ "$1" = 'mysqld' ]; then # Test that the server can start. We redirect stdout to /dev/null so # only the error messages are left. @@ -46,13 +65,6 @@ if [ "$1" = 'mysqld' ]; then DATADIR="$(_get_config 'datadir' "$@")" SOCKET="$(_get_config 'socket' "$@")" - if [ -n "$MYSQL_LOG_CONSOLE" ] || [ -n "console" ]; then - # Don't touch bind-mounted config files - if ! cat /proc/1/mounts | grep "etc/my.cnf"; then - sed -i 's/^log-error=/#&/' /etc/my.cnf - fi - fi - if [ ! -d "$DATADIR/mysql" ]; then # If the password variable is a filename we use the contents of the file. We # read this first to make sure that a proper error is generated for empty files. @@ -69,19 +81,21 @@ if [ "$1" = 'mysqld' ]; then MYSQL_RANDOM_ROOT_PASSWORD=true MYSQL_ONETIME_PASSWORD=true fi - mkdir -p "$DATADIR" - chown -R mysql:mysql "$DATADIR" + if [ ! -d "$DATADIR" ]; then + mkdir -p "$DATADIR" + chown mysql:mysql "$DATADIR" + fi echo '[Entrypoint] Initializing database' - "$@" --initialize-insecure + "$@" --user=$MYSQLD_USER --initialize-insecure echo '[Entrypoint] Database initialized' - "$@" --daemonize --skip-networking --socket="$SOCKET" + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" # To avoid using password on commandline, put it in a temporary file. # The file is only populated when and if the root password is set. PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) - install /dev/null -m0600 -omysql -gmysql "$PASSFILE" + $install_devnull "$PASSFILE" # Define the client command used throughout the script # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") @@ -102,9 +116,9 @@ if [ "$1" = 'mysqld' ]; then fi mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql - + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - MYSQL_ROOT_PASSWORD="$(pwmake 128)" + MYSQL_ROOT_PASSWORD="$(_mkpw)" echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" fi if [ -z "$MYSQL_ROOT_HOST" ]; then @@ -163,25 +177,21 @@ EOF # This needs to be done outside the normal init, since mysqladmin shutdown will not work after if [ ! -z "$MYSQL_ONETIME_PASSWORD" ]; then - if [ -z "yes" ]; then - echo "[Entrypoint] User expiration is only supported in MySQL 5.6+" - else - echo "[Entrypoint] Setting root user as expired. Password will need to be changed before database can be used." - SQL=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) - install /dev/null -m0600 -omysql -gmysql "$SQL" - if [ ! -z "$MYSQL_ROOT_HOST" ]; then - cat << EOF > "$SQL" + echo "[Entrypoint] Setting root user as expired. Password will need to be changed before database can be used." + SQL=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + $install_devnull "$SQL" + if [ ! -z "$MYSQL_ROOT_HOST" ]; then + cat << EOF > "$SQL" ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; ALTER USER 'root'@'localhost' PASSWORD EXPIRE; EOF - else - cat << EOF > "$SQL" + else + cat << EOF > "$SQL" ALTER USER 'root'@'localhost' PASSWORD EXPIRE; EOF - fi - set -- "$@" --init-file="$SQL" - unset SQL fi + set -- "$@" --init-file="$SQL" + unset SQL fi echo @@ -192,17 +202,26 @@ EOF # Used by healthcheck to make sure it doesn't mistakenly report container # healthy during startup # Put the password into the temporary config file - touch /healthcheck.cnf - cat >"/healthcheck.cnf" <"/var/lib/mysql-files/healthcheck.cnf" < docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES a24888f0d6f4 mysql/mysql-server "/entrypoint.sh my..." 14 seconds ago Up 13 seconds (health: starting) 3306/tcp, 33060/tcp mysql1 -  +  The container initialization might take some time. When the server is ready for use, the `STATUS` of the container in the output of the `docker ps` command changes from `(health: starting)` to `(healthy)`. The `-d` option used in the `docker diff --git a/mysql-server/VERSION b/mysql-server/VERSION index 503bd88d7..09d31eb0b 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,20 +1,17 @@ -IMAGE_VERSION=1.1.19-2 +IMAGE_VERSION=1.2.0 declare -A MYSQL_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["5.6"]=5.6.51 -MYSQL_SERVER_VERSIONS["5.7"]=5.7.33 -MYSQL_SERVER_VERSIONS["8.0"]=8.0.23 +MYSQL_SERVER_VERSIONS["5.7"]=5.7.34 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.24 declare -A MYSQL_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["5.6"]="" MYSQL_SHELL_VERSIONS["5.7"]=8.0.23 MYSQL_SHELL_VERSIONS["8.0"]=8.0.23 declare -A FULL_SERVER_VERSIONS -FULL_SERVER_VERSIONS["5.6"]="${MYSQL_SERVER_VERSIONS["5.6"]}-${IMAGE_VERSION}" FULL_SERVER_VERSIONS["5.7"]="${MYSQL_SERVER_VERSIONS["5.7"]}-${IMAGE_VERSION}" FULL_SERVER_VERSIONS["8.0"]="${MYSQL_SERVER_VERSIONS["8.0"]}-${IMAGE_VERSION}" MULTIARCH_VERSIONS="8.0" -SINGLEARCH_VERSIONS="5.6 5.7" +SINGLEARCH_VERSIONS="5.7" LATEST="8.0" diff --git a/mysql-server/changelog b/mysql-server/changelog index 6730d35c6..eb8b16e60 100644 --- a/mysql-server/changelog +++ b/mysql-server/changelog @@ -1,3 +1,12 @@ +Changes in 1.2.0 (2021-01-15) + * Removed EOLed 5.5 and 5.6 + * Upgraded base image to el8-slim, switched from yum to microdnf + * Generate password internally in entryfile, removed pwmake + * Support for running in a container as non-root/mysql user + * Write MySQL files in /var/lib/mysql instead of / + * Always log to stderr + * Added MYSQL_INITIALIZE_ONLY option + Changes in 1.1.5 (2018-04-19) * Bumped server versions to 5.5.60, 5.6.40, 5.7.22 * MySQL Server 8.0 updated to 8.0.11 diff --git a/mysql-server/gen_dockerfiles.sh b/mysql-server/gen_dockerfiles.sh index 2c450e75e..7b9351e93 100755 --- a/mysql-server/gen_dockerfiles.sh +++ b/mysql-server/gen_dockerfiles.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, 2021, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -25,69 +25,51 @@ REPO=https://repo.mysql.com; [ -n "$1" ] && REPO=$1 # 33060 is the default port for the mysqlx plugin, new to 5.7 declare -A PORTS -PORTS["5.6"]="3306" PORTS["5.7"]="3306 33060" PORTS["8.0"]="3306 33060 33061" declare -A PASSWORDSET -PASSWORDSET["5.6"]="SET PASSWORD FOR 'root'@'localhost'=PASSWORD('\${MYSQL_ROOT_PASSWORD}');" PASSWORDSET["5.7"]="ALTER USER 'root'@'localhost' IDENTIFIED BY '\${MYSQL_ROOT_PASSWORD}';" PASSWORDSET["8.0"]=${PASSWORDSET["5.7"]} declare -A DATABASE_INIT -DATABASE_INIT["5.6"]="mysql_install_db --user=mysql --datadir=\"\$DATADIR\" --rpm --keep-my-cnf" -DATABASE_INIT["5.7"]="\"\$@\" --initialize-insecure" -DATABASE_INIT["8.0"]="\"\$@\" --initialize-insecure" +DATABASE_INIT["5.7"]="\"\$@\" --user=\$MYSQLD_USER --initialize-insecure" +DATABASE_INIT["8.0"]="\"\$@\" --user=\$MYSQLD_USER --initialize-insecure" # 5.7+ has the --daemonize flag, which makes the process fork and then exit when # the server is ready, removing the need for a fragile wait loop declare -A INIT_STARTUP -INIT_STARTUP["5.6"]="\"\$@\" --skip-networking --socket=\"\$SOCKET\" \&" -INIT_STARTUP["5.7"]="\"\$@\" --daemonize --skip-networking --socket=\"\$SOCKET\"" -INIT_STARTUP["8.0"]="\"\$@\" --daemonize --skip-networking --socket=\"\$SOCKET\"" +INIT_STARTUP["5.7"]="\"\$@\" --user=\$MYSQLD_USER --daemonize --skip-networking --socket=\"\$SOCKET\"" +INIT_STARTUP["8.0"]="\"\$@\" --user=\$MYSQLD_USER --daemonize --skip-networking --socket=\"\$SOCKET\"" declare -A STARTUP -STARTUP["5.5"]="exec \"\$@\"" -STARTUP["5.6"]="exec \"\$@\"" -STARTUP["5.7"]="exec \"\$@\"" -STARTUP["8.0"]="env MYSQLD_PARENT_PID=\$\$ \"\$@\"" +STARTUP["5.7"]="exec \"\$@\" --user=\$MYSQLD_USER" +STARTUP["8.0"]="export MYSQLD_PARENT_PID=\$\$ ; exec \"\$@\" --user=\$MYSQLD_USER" declare -A STARTUP_WAIT -STARTUP_WAIT["5.6"]="\"yes\"" STARTUP_WAIT["5.7"]="\"\"" STARTUP_WAIT["8.0"]="\"\"" -# The option to set a user as expired, (forcing a password change before -# any other action can be taken) was added in 5.6 -declare -A EXPIRE_SUPPORT -EXPIRE_SUPPORT["5.6"]="\"yes\"" -EXPIRE_SUPPORT["5.7"]="\"yes\"" -EXPIRE_SUPPORT["8.0"]="\"yes\"" - -# sed is for https://bugs.mysql.com/bug.php?id=20545 -declare -A TZINFO_WORKAROUND -TZINFO_WORKAROUND["5.6"]="sed 's/Local time zone must be set--see zic manual page/FCTY/' | " -TZINFO_WORKAROUND["5.7"]="" -TZINFO_WORKAROUND["8.0"]="" - -# Logging to console (stderr) makes server log available with the «docker logs command» -declare -A DEFAULT_LOG -DEFAULT_LOG["5.6"]="" -DEFAULT_LOG["5.7"]="" -DEFAULT_LOG["8.0"]="console" - # MySQL 8.0 supports a call to validate the config, while older versions have it as a side # effect of running --verbose --help declare -A VALIDATE_CONFIG -VALIDATE_CONFIG["5.6"]="output=\$(\"\$@\" --verbose --help 2>\&1 > /dev/null) || result=\$?" VALIDATE_CONFIG["5.7"]="output=\$(\"\$@\" --verbose --help 2>\&1 > /dev/null) || result=\$?" VALIDATE_CONFIG["8.0"]="output=\$(\"\$@\" --validate-config) || result=\$?" +# Data directories that must be created with special ownership and permissions when the image is built +declare -A PRECREATE_DIRS +PRECREATE_DIRS["5.7"]="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" +PRECREATE_DIRS["8.0"]="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" + for VERSION in "${!MYSQL_SERVER_VERSIONS[@]}" do # Dockerfiles MYSQL_SERVER_REPOPATH=yum/mysql-$VERSION-community/docker/x86_64 - sed 's#%%MYSQL_SERVER_PACKAGE%%#'"mysql-community-server-minimal-${MYSQL_SERVER_VERSIONS[${VERSION}]}"'#g' template/Dockerfile > tmpfile + DOCKERFILE_TEMPLATE=template/Dockerfile + if [ "${VERSION}" != "8.0" ]; then + DOCKERFILE_TEMPLATE=template/Dockerfile-pre8 + fi + sed 's#%%MYSQL_SERVER_PACKAGE%%#'"mysql-community-server-minimal-${MYSQL_SERVER_VERSIONS[${VERSION}]}"'#g' $DOCKERFILE_TEMPLATE > tmpfile sed -i 's#%%REPO%%#'"${REPO}"'#g' tmpfile REPO_VERSION=${VERSION//\./} sed -i 's#%%REPO_VERSION%%#'"${REPO_VERSION}"'#g' tmpfile @@ -105,30 +87,22 @@ do if [ ! -d "${VERSION}/inspec" ]; then mkdir "${VERSION}/inspec" fi - if [ "${VERSION}" == "5.7" ] || [ "${VERSION}" == "8.0" ]; then - sed 's#%%MYSQL_SERVER_VERSION%%#'"${MYSQL_SERVER_VERSIONS[${VERSION}]}"'#g' template/control.rb > tmpFile - sed -i 's#%%MYSQL_SHELL_VERSION%%#'"${MYSQL_SHELL_VERSIONS[${VERSION}]}"'#g' tmpFile - if [ "${VERSION}" == "5.7" ]; then - sed -i 's#%%PORTS%%#'"3306/tcp, 33060/tcp"'#g' tmpFile - else - sed -i 's#%%PORTS%%#'"3306/tcp, 33060-33061/tcp"'#g' tmpFile - fi - mv tmpFile "${VERSION}/inspec/control.rb" + sed 's#%%MYSQL_SERVER_VERSION%%#'"${MYSQL_SERVER_VERSIONS[${VERSION}]}"'#g' template/control.rb > tmpFile + sed -i 's#%%MYSQL_SHELL_VERSION%%#'"${MYSQL_SHELL_VERSIONS[${VERSION}]}"'#g' tmpFile + if [ "${VERSION}" == "5.7" ]; then + sed -i 's#%%PORTS%%#'"3306/tcp, 33060/tcp"'#g' tmpFile else - sed 's#%%MYSQL_SERVER_VERSION%%#'"${MYSQL_SERVER_VERSIONS[${VERSION}]}"'#g' template/control_pre57.rb > tmpFile - mv tmpFile "${VERSION}/inspec/control.rb" + sed -i 's#%%PORTS%%#'"3306/tcp, 33060-33061/tcp"'#g' tmpFile fi + mv tmpFile "${VERSION}/inspec/control.rb" # Entrypoint sed 's#%%PASSWORDSET%%#'"${PASSWORDSET[${VERSION}]}"'#g' template/docker-entrypoint.sh > tmpfile sed -i 's#%%DATABASE_INIT%%#'"${DATABASE_INIT[${VERSION}]}"'#g' tmpfile - sed -i 's#%%EXPIRE_SUPPORT%%#'"${EXPIRE_SUPPORT[${VERSION}]}"'#g' tmpfile - sed -i 's#%%SED_TZINFO%%#'"${TZINFO_WORKAROUND[${VERSION}]}"'#g' tmpfile sed -i 's#%%INIT_STARTUP%%#'"${INIT_STARTUP[${VERSION}]}"'#g' tmpfile sed -i 's#%%STARTUP%%#'"${STARTUP[${VERSION}]}"'#g' tmpfile sed -i 's#%%STARTUP_WAIT%%#'"${STARTUP_WAIT[${VERSION}]}"'#g' tmpfile sed -i 's#%%FULL_SERVER_VERSION%%#'"${FULL_SERVER_VERSIONS[${VERSION}]}"'#g' tmpfile - sed -i 's#%%DEFAULT_LOG%%#'"${DEFAULT_LOG[${VERSION}]}"'#g' tmpfile sed -i 's#%%VALIDATE_CONFIG%%#'"${VALIDATE_CONFIG[${VERSION}]}"'#g' tmpfile mv tmpfile ${VERSION}/docker-entrypoint.sh chmod +x ${VERSION}/docker-entrypoint.sh @@ -136,4 +110,9 @@ do # Healthcheck cp template/healthcheck.sh ${VERSION}/ chmod +x ${VERSION}/healthcheck.sh + + # Build-time preparation script + sed 's#%%PRECREATE_DIRS%%#'"${PRECREATE_DIRS[${VERSION}]}"'#g' template/prepare-image.sh > tmpfile + mv tmpfile ${VERSION}/prepare-image.sh + chmod +x ${VERSION}/prepare-image.sh done diff --git a/mysql-server/template/Dockerfile b/mysql-server/template/Dockerfile index 23942be9e..a96e0c7fb 100644 --- a/mysql-server/template/Dockerfile +++ b/mysql-server/template/Dockerfile @@ -1,4 +1,4 @@ -# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, 2021, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -12,23 +12,28 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -FROM oraclelinux:7-slim + +FROM oraclelinux:8-slim ARG MYSQL_SERVER_PACKAGE=%%MYSQL_SERVER_PACKAGE%% ARG MYSQL_SHELL_PACKAGE=%%MYSQL_SHELL_PACKAGE%% -# Install server -RUN yum install -y %%REPO%%/mysql-community-minimal-release-el7.rpm \ - %%REPO%%/mysql-community-release-el7.rpm \ - && yum-config-manager --enable mysql%%REPO_VERSION%%-server-minimal \ - && yum install -y \ - $MYSQL_SERVER_PACKAGE \ - $MYSQL_SHELL_PACKAGE \ - libpwquality \ - && yum clean all \ +# Setup repositories for minimal packages (all versions) +RUN rpm -U %%REPO%%/mysql-community-minimal-release-el8.rpm \ + && rpm -U %%REPO%%/mysql80-community-release-el8-1.noarch.rpm + +# Install server and shell 8.0 +RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ + && microdnf install -y $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --disablerepo=ol8_appstream \ + --enablerepo=mysql%%REPO_VERSION%%-server-minimal $MYSQL_SERVER_PACKAGE \ + && microdnf clean all \ && mkdir /docker-entrypoint-initdb.d -VOLUME /var/lib/mysql +COPY prepare-image.sh / +RUN /prepare-image.sh && rm -f /prepare-image.sh + +ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock COPY docker-entrypoint.sh /entrypoint.sh COPY healthcheck.sh /healthcheck.sh diff --git a/mysql-server/5.5/Dockerfile b/mysql-server/template/Dockerfile-pre8 similarity index 55% rename from mysql-server/5.5/Dockerfile rename to mysql-server/template/Dockerfile-pre8 index ff481f020..b77a5d9cc 100644 --- a/mysql-server/5.5/Dockerfile +++ b/mysql-server/template/Dockerfile-pre8 @@ -1,4 +1,4 @@ -# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, 2021, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -14,26 +14,31 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.5.62 -ARG MYSQL_SHELL_PACKAGE= - -# Install server -RUN yum install -y https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ - https://repo.mysql.com/mysql-community-release-el7.rpm \ - && yum-config-manager --enable mysql55-server-minimal \ - && yum install -y \ - $MYSQL_SERVER_PACKAGE \ - $MYSQL_SHELL_PACKAGE \ - libpwquality \ +ARG MYSQL_SERVER_PACKAGE=%%MYSQL_SERVER_PACKAGE%% +ARG MYSQL_SHELL_PACKAGE=%%MYSQL_SHELL_PACKAGE%% + +# Setup repositories for minimal packages (all versions) +RUN rpm -U %%REPO%%/mysql-community-minimal-release-el7.rpm \ + && rpm -U %%REPO%%/mysql80-community-release-el7-1.noarch.rpm + +# Install server and shell 8.0 +RUN yum install -y $MYSQL_SHELL_PACKAGE \ + && yum install -y $MYSQL_SERVER_PACKAGE --enablerepo=mysql57-server-minimal\ && yum clean all \ && mkdir /docker-entrypoint-initdb.d -VOLUME /var/lib/mysql +# Ensure mysqld logs go to stderr +RUN sed -i 's/^log-error=/#&/' /etc/my.cnf + +COPY prepare-image.sh / +RUN /prepare-image.sh && rm -f /prepare-image.sh + +ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock COPY docker-entrypoint.sh /entrypoint.sh COPY healthcheck.sh /healthcheck.sh ENTRYPOINT ["/entrypoint.sh"] HEALTHCHECK CMD /healthcheck.sh -EXPOSE 3306 +EXPOSE %%PORTS%% CMD ["mysqld"] diff --git a/mysql-server/template/control.rb b/mysql-server/template/control.rb index 3c6db8d4b..d110bcc06 100644 --- a/mysql-server/template/control.rb +++ b/mysql-server/template/control.rb @@ -8,15 +8,12 @@ its('command') { should match '/entrypoint.sh mysqld' } end end -control 'server-package' do +control 'packages' do impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } its ('version') { should match '%%MYSQL_SERVER_VERSION%%.*' } end -end -control 'shell-package' do - impact 0.5 describe package('mysql-shell') do it { should be_installed } its ('version') { should match '%%MYSQL_SHELL_VERSION%%.*' } diff --git a/mysql-server/template/control_pre57.rb b/mysql-server/template/control_pre57.rb deleted file mode 100644 index 44dff62ae..000000000 --- a/mysql-server/template/control_pre57.rb +++ /dev/null @@ -1,17 +0,0 @@ -control 'container' do - impact 0.5 - describe docker_container('mysql-server') do - it { should exist } - it { should be_running } - its('repo') { should eq 'mysql/mysql-server' } - its('ports') { should eq '3306/tcp' } - its('command') { should match '/entrypoint.sh mysqld' } - end -end -control 'server-package' do - impact 0.5 - describe package('mysql-community-server-minimal') do - it { should be_installed } - its ('version') { should match '%%MYSQL_SERVER_VERSION%%.*' } - end -end diff --git a/mysql-server/template/docker-entrypoint.sh b/mysql-server/template/docker-entrypoint.sh index b9553159a..76bc8cb1b 100644 --- a/mysql-server/template/docker-entrypoint.sh +++ b/mysql-server/template/docker-entrypoint.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, 2021, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -24,6 +24,15 @@ _get_config() { "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' } +# Generate a random password +_mkpw() { + letter=$(cat /dev/urandom| tr -dc a-zA-Z | dd bs=1 count=16 2> /dev/null ) + number=$(cat /dev/urandom| tr -dc 0-9 | dd bs=1 count=8 2> /dev/null) + special=$(cat /dev/urandom| tr -dc '=+@#%^&*_.,;:?/' | dd bs=1 count=8 2> /dev/null) + + echo $letter$number$special | fold -w 1 | shuf | tr -d '\n' +} + # If command starts with an option, prepend mysqld # This allows users to add command-line options without # needing to specify the "mysqld" command @@ -31,6 +40,16 @@ if [ "${1:0:1}" = '-' ]; then set -- mysqld "$@" fi +# Check if entrypoint (and the container) is running as root +if [ $(id -u) = "0" ]; then + is_root=1 + install_devnull="install /dev/null -m0600 -omysql -gmysql" + MYSQLD_USER=mysql +else + install_devnull="install /dev/null -m0600" + MYSQLD_USER=$(id -u) +fi + if [ "$1" = 'mysqld' ]; then # Test that the server can start. We redirect stdout to /dev/null so # only the error messages are left. @@ -46,13 +65,6 @@ if [ "$1" = 'mysqld' ]; then DATADIR="$(_get_config 'datadir' "$@")" SOCKET="$(_get_config 'socket' "$@")" - if [ -n "$MYSQL_LOG_CONSOLE" ] || [ -n "%%DEFAULT_LOG%%" ]; then - # Don't touch bind-mounted config files - if ! cat /proc/1/mounts | grep "etc/my.cnf"; then - sed -i 's/^log-error=/#&/' /etc/my.cnf - fi - fi - if [ ! -d "$DATADIR/mysql" ]; then # If the password variable is a filename we use the contents of the file. We # read this first to make sure that a proper error is generated for empty files. @@ -69,8 +81,10 @@ if [ "$1" = 'mysqld' ]; then MYSQL_RANDOM_ROOT_PASSWORD=true MYSQL_ONETIME_PASSWORD=true fi - mkdir -p "$DATADIR" - chown -R mysql:mysql "$DATADIR" + if [ ! -d "$DATADIR" ]; then + mkdir -p "$DATADIR" + chown mysql:mysql "$DATADIR" + fi echo '[Entrypoint] Initializing database' %%DATABASE_INIT%% @@ -81,7 +95,7 @@ if [ "$1" = 'mysqld' ]; then # To avoid using password on commandline, put it in a temporary file. # The file is only populated when and if the root password is set. PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) - install /dev/null -m0600 -omysql -gmysql "$PASSFILE" + $install_devnull "$PASSFILE" # Define the client command used throughout the script # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") @@ -101,10 +115,10 @@ if [ "$1" = 'mysqld' ]; then fi fi - mysql_tzinfo_to_sql /usr/share/zoneinfo | %%SED_TZINFO%%"${mysql[@]}" mysql - + mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - MYSQL_ROOT_PASSWORD="$(pwmake 128)" + MYSQL_ROOT_PASSWORD="$(_mkpw)" echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" fi if [ -z "$MYSQL_ROOT_HOST" ]; then @@ -163,25 +177,21 @@ EOF # This needs to be done outside the normal init, since mysqladmin shutdown will not work after if [ ! -z "$MYSQL_ONETIME_PASSWORD" ]; then - if [ -z %%EXPIRE_SUPPORT%% ]; then - echo "[Entrypoint] User expiration is only supported in MySQL 5.6+" - else - echo "[Entrypoint] Setting root user as expired. Password will need to be changed before database can be used." - SQL=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) - install /dev/null -m0600 -omysql -gmysql "$SQL" - if [ ! -z "$MYSQL_ROOT_HOST" ]; then - cat << EOF > "$SQL" + echo "[Entrypoint] Setting root user as expired. Password will need to be changed before database can be used." + SQL=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + $install_devnull "$SQL" + if [ ! -z "$MYSQL_ROOT_HOST" ]; then + cat << EOF > "$SQL" ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; ALTER USER 'root'@'localhost' PASSWORD EXPIRE; EOF - else - cat << EOF > "$SQL" + else + cat << EOF > "$SQL" ALTER USER 'root'@'localhost' PASSWORD EXPIRE; EOF - fi - set -- "$@" --init-file="$SQL" - unset SQL fi + set -- "$@" --init-file="$SQL" + unset SQL fi echo @@ -192,17 +202,26 @@ EOF # Used by healthcheck to make sure it doesn't mistakenly report container # healthy during startup # Put the password into the temporary config file - touch /healthcheck.cnf - cat >"/healthcheck.cnf" <"/var/lib/mysql-files/healthcheck.cnf" < Date: Tue, 23 Feb 2021 17:45:48 +0100 Subject: [PATCH 203/386] Revert server versions to currently released ones The version specified in the VERSION file should be that of the current release version Change-Id: If572233147686728cb04c3a01e93139b5498d2cc --- mysql-cluster/VERSION | 2 +- mysql-server/VERSION | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mysql-cluster/VERSION b/mysql-cluster/VERSION index 01aee75cf..d35cbf44e 100644 --- a/mysql-cluster/VERSION +++ b/mysql-cluster/VERSION @@ -3,7 +3,7 @@ IMAGE_VERSION=1.2.0 declare -A MYSQL_CLUSTER_VERSIONS MYSQL_CLUSTER_VERSIONS["7.5"]=7.5.21 MYSQL_CLUSTER_VERSIONS["7.6"]=7.6.17 -MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.24 +MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.23 declare -A MYSQL_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["7.5"]=8.0.23 diff --git a/mysql-server/VERSION b/mysql-server/VERSION index 09d31eb0b..e45bfca05 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,8 +1,8 @@ IMAGE_VERSION=1.2.0 declare -A MYSQL_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["5.7"]=5.7.34 -MYSQL_SERVER_VERSIONS["8.0"]=8.0.24 +MYSQL_SERVER_VERSIONS["5.7"]=5.7.33 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.23 declare -A MYSQL_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["5.7"]=8.0.23 From 9d3203b2b09afb32418921ab983d9fcb50d0386c Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Fri, 26 Feb 2021 14:41:31 +0100 Subject: [PATCH 204/386] Cluster: Use parameters for the repo name for 7.6 and 7.5 The template dockerfile specified the 7.6 repo instead of taking it as a parameter, causing the 7.5 build to fail. Change-Id: Ic93c53f86fd5e15356bbdead0586f9314237bbd6 --- mysql-cluster/template/Dockerfile-pre8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-cluster/template/Dockerfile-pre8 b/mysql-cluster/template/Dockerfile-pre8 index 421fcee5d..2685a4f57 100644 --- a/mysql-cluster/template/Dockerfile-pre8 +++ b/mysql-cluster/template/Dockerfile-pre8 @@ -24,7 +24,7 @@ RUN rpm -U %%REPO%%/mysql-cluster-community-minimal-release-el7.rpm \ # Install server and shell 8.0 RUN yum install -y $MYSQL_SHELL_PACKAGE \ - && yum install -y $MYSQL_CLUSTER_PACKAGE --enablerepo=mysql-cluster76-minimal\ + && yum install -y $MYSQL_CLUSTER_PACKAGE --enablerepo=%%REPO_NAME%%-cluster%%REPO_VERSION%%-minimal\ && yum clean all \ && mkdir /docker-entrypoint-initdb.d From 7e4661cbedad50431e8bf56041232ad4771c91c2 Mon Sep 17 00:00:00 2001 From: Robert Neumayer Date: Mon, 1 Mar 2021 09:45:02 +0100 Subject: [PATCH 205/386] Update test script The tests were refactored, but the script wasn't updated. Now we call the correct test profiles again. Change-Id: I3044b5201295941b0ade35ca8474922cb1a909fa --- mysql-server/test.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mysql-server/test.sh b/mysql-server/test.sh index 1f7536c7a..35584e9a7 100755 --- a/mysql-server/test.sh +++ b/mysql-server/test.sh @@ -43,10 +43,7 @@ for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do done docker run -d --name mysql-server mysql/mysql-server:"$MAJOR_VERSION$ARCH_SUFFIX" inspec exec --no-color "$MAJOR_VERSION/inspec/control.rb" --controls container - inspec exec --no-color "$MAJOR_VERSION/inspec/control.rb" -t docker://mysql-server --controls server-package - if [ "${MAJOR_VERSION}" == "5.7" ] || [ "${MAJOR_VERSION}" == "8.0" ]; then - inspec exec "$MAJOR_VERSION/inspec/control.rb" -t docker://mysql-server --controls shell-package - fi + inspec exec --no-color "$MAJOR_VERSION/inspec/control.rb" -t docker://mysql-server --controls packages docker stop mysql-server docker rm mysql-server done From 30c0a73da5e870eedb2455fe58d1ee1d8fc4bcd1 Mon Sep 17 00:00:00 2001 From: Alfredo Kojima Date: Tue, 23 Feb 2021 12:39:01 -0800 Subject: [PATCH 206/386] Allow starting container with bash etc Entrypoint now executes commands as given by user if it's not the default mysqld, e.g. when starting as docker run -it /bin/bash Change-Id: I59fac57d0dd793f2bc8666d801a1b4bdb16c06f6 --- mysql-server/template/docker-entrypoint.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/mysql-server/template/docker-entrypoint.sh b/mysql-server/template/docker-entrypoint.sh index 76bc8cb1b..fe82c3ac5 100644 --- a/mysql-server/template/docker-entrypoint.sh +++ b/mysql-server/template/docker-entrypoint.sh @@ -217,11 +217,7 @@ EOF else echo "[Entrypoint] Starting MySQL %%FULL_SERVER_VERSION%%" fi + %%STARTUP%% else - if [ -n "$MYSQL_INITIALIZE_ONLY" ]; then - echo "[Entrypoint] MySQL already initialized and MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." - exit 0 - fi + exec "$@" fi - -%%STARTUP%% From eef8cdd729f8ffd02be954cabb157233e0ff3cd3 Mon Sep 17 00:00:00 2001 From: Robert Neumayer Date: Wed, 3 Mar 2021 10:09:19 +0100 Subject: [PATCH 207/386] Update versions to be independent As a consequence of the repo move we must have distinct git tags (VERSION) per product. This can be updated at some point in the future but without this change existing build automation will likely fail as of now. Change-Id: Ie8687045ef24bfec0a472cd44da8e112cef1581e --- mysql-cluster/VERSION | 2 +- mysql-server/VERSION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-cluster/VERSION b/mysql-cluster/VERSION index d35cbf44e..aeffeaba8 100644 --- a/mysql-cluster/VERSION +++ b/mysql-cluster/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.2.0 +IMAGE_VERSION=1.2.0-cluster declare -A MYSQL_CLUSTER_VERSIONS MYSQL_CLUSTER_VERSIONS["7.5"]=7.5.21 diff --git a/mysql-server/VERSION b/mysql-server/VERSION index e45bfca05..3f9dfc174 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.2.0 +IMAGE_VERSION=1.2.0-server declare -A MYSQL_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["5.7"]=5.7.33 From 312bc576494cc6f5fb51d6cb4e4f5d0b934d7d10 Mon Sep 17 00:00:00 2001 From: Alfredo Kojima Date: Fri, 26 Feb 2021 08:54:21 -0800 Subject: [PATCH 208/386] WL#14493,Bug#32034038,Bug#31249934 Router Docker Image Added a new MYSQL_CREATE_ROUTER_USER option, which when set to 0, will reuse the account used for bootstrap for the router runtime. Fixed MYSQL_INNODB_CLUSTER_MEMBERS to also allow more than the specified number of members to be ONLINE. Fixed the image to allow bootstrapping and running as an arbitrary, non-root user. Expose the HTTP REST interface at port 8443 Changed the exposed router ports to match the new router defaults of 6446, 6447, 6448 and 6449 Also fixes: Bug #32034038 ROUTER DOCKER IMAGE CREATES A NEW ACCOUNT ON EVERY RESTART Bug #31249934 MYSQL ROUTER DOCKER SHOULD USE MYSQL_INNODB_CLUSTER_MEMBERS AS LOWER LIMIT Change-Id: If4d59fe1b4072e4296ce4365f5a427837920622e --- mysql-router/8.0/Dockerfile | 21 ++++++---------- mysql-router/8.0/README.md | 40 ++++++++++++++++++++++++------ mysql-router/8.0/inspec/control.rb | 6 +---- mysql-router/8.0/run.sh | 38 ++++++++++++++++++++-------- mysql-router/README.md | 23 +++++++++++++++-- mysql-router/VERSION | 7 +----- mysql-router/gen_dockerfiles.sh | 11 ++++++-- mysql-router/template/Dockerfile | 21 ++++++---------- mysql-router/template/control.rb | 6 +---- mysql-router/template/run.sh | 18 ++++++++------ 10 files changed, 120 insertions(+), 71 deletions(-) diff --git a/mysql-router/8.0/Dockerfile b/mysql-router/8.0/Dockerfile index e735539f9..449ccd505 100644 --- a/mysql-router/8.0/Dockerfile +++ b/mysql-router/8.0/Dockerfile @@ -1,4 +1,4 @@ -# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2021, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -12,24 +12,19 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -FROM oraclelinux:7-slim +FROM oraclelinux:8-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.23 +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.23 ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.23 -RUN yum install -y https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ - https://repo.mysql.com/mysql-community-release-el7.rpm \ - && yum-config-manager --enable mysql80-server-minimal \ - && yum-config-manager --enable mysql-tools-community \ - && yum install -y \ - $MYSQL_SERVER_PACKAGE \ - $MYSQL_ROUTER_PACKAGE \ - libpwquality \ - && yum clean all +RUN rpm -U http://repo.no.oracle.com/mysql-weekly/repos-stage/mysql80-community-release-el8-1.noarch.rpm \ + && microdnf install -y --disablerepo=ol8_appstream \ + $MYSQL_CLIENT_PACKAGE $MYSQL_ROUTER_PACKAGE \ + && microdnf clean all COPY run.sh /run.sh HEALTHCHECK \ CMD mysqladmin --port 6446 --protocol TCP ping 2>&1 | grep Access || exit 1 -EXPOSE 6446 6447 64460 64470 +EXPOSE 6446 6447 6448 6449 8443 ENTRYPOINT ["/run.sh"] CMD ["mysqlrouter"] diff --git a/mysql-router/8.0/README.md b/mysql-router/8.0/README.md index 5afd24c6c..6b2f90cce 100644 --- a/mysql-router/8.0/README.md +++ b/mysql-router/8.0/README.md @@ -11,13 +11,13 @@ developers to extend MySQL Router for custom use cases. # Supported Tags and Respective Dockerfile Links -* MySQL Router 8.0 (tag: [latest](https://github.com/mysql/mysql-docker/tree/mysql-router/8.0),[8.0](https://github.com/mysql/mysql-docker/tree/mysql-router/8.0),[8.0.4-rc](https://github.com/mysql/mysql-docker/tree/mysql-router/8.0) (mysql-router/8.0/Dockerfile) +* MySQL Router 8.0 (tag: [`latest`, `8.0`](https://github.com/mysql/mysql-docker/blob/mysql-router/8.0/Dockerfile)) ([mysql-router/8.0/Dockerfile](https://github.com/mysql/mysql-docker/blob/mysql-router/8.0/Dockerfile)) Images are updated when new MySQL Server maintenance releases and development milestones are published. Please note that non-GA releases are for preview purposes only and should not be used in production setups. # How to Use the MySQL Router Images -The image currently uses the following variables: +The image currently uses the following mandatory variables: | Variable | Description | | ------------------------ | ------------------------------------------- | @@ -25,18 +25,25 @@ The image currently uses the following variables: | MYSQL_PORT | Port to use | | MYSQL_USER | User to connect with | | MYSQL_PASSWORD | Password to connect with | -| MYSQL_INNODB_NUM_MEMBERS | The number of cluster instances to wait for | -Running in a container requires a working InnoDB cluster. The run script waits -for the given mysql host to be up, the InnoDB cluster to have -MYSQL_INNODB_NUM_MEMBERS members and then uses the given server for its +Running in a container requires a working InnoDB cluster. + +The image uses the following optional variables: + +| Variable | Description | +| ------------------------ | ------------------------------------------- | +| MYSQL_INNODB_CLUSTER_MEMBERS | Wait for at least this number of cluster instances to be ONLINE | +| MYSQL_CREATE_ROUTER_USER | Whether to create a new account for the Router to use when it's running. Defaults to 1, set to 0 to disable. | + +If supplied the run script waits for the given mysql host to be up, the InnoDB cluster to have +MYSQL_INNODB_CLUSTER_MEMBERS members and then uses the given server for its bootstrap mode [Bootstrapping](https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-deploying-bootstrapping.html). The image can be run via: ``` -docker run -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -e MYSQL_INNODB_NUM_MEMBERS=3 -ti mysql-router +docker run -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -e MYSQL_INNODB_CLUSTER_MEMBERS=3 -ti mysql/mysql-router ``` It can be verified by typing: @@ -48,6 +55,23 @@ docker ps The following output should be displayed: ``` -4954b1c80be1 mysql-router:8.0 "/run.sh mysqlrouter" About a minute ago Up About a minute (healthy) 6447/tcp, 64460/tcp, 0.0.0.0:6446->6446/tcp, 64470/tcp innodbcluster_mysql-router_1 +4954b1c80be1 mysql-router:8.0 "/run.sh mysqlrouter" About a minute ago Up About a minute (healthy) 6447/tcp, 6448/tcp, 0.0.0.0:6446->6446/tcp, 6449/tcp innodbcluster_mysql-router_1 ``` +# Exposed Ports + +The following TCP ports are exposed by the MySQL Router container: + +| Port | Description +| ----- | --------------------------------------------------------------------------------------- | +| 6446 | R/W connection port. Clients that connect to this port will be forwarded to the PRIMARY | +| 6447 | R/O connection port. Clients that connect to this port will be forwarded to a SECONDARY | +| 6448 | X Protocol R/W connection port. R/W port for X protocol client connections | +| 6449 | X Protocol R/O connection port. R/O port for X protocol client connections | +| 8443 | HTTPS REST interface port. | + +For more information about the REST interface API, see: + +https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-rest-api-reference.html + + diff --git a/mysql-router/8.0/inspec/control.rb b/mysql-router/8.0/inspec/control.rb index 15dd649e8..e9b1f6a1e 100644 --- a/mysql-router/8.0/inspec/control.rb +++ b/mysql-router/8.0/inspec/control.rb @@ -4,16 +4,12 @@ it { should exist } it { should be_running } its('repo') { should eq 'mysql/mysql-router' } - its('ports') { should eq '6446-6447/tcp, 64460/tcp, 64470/tcp' } + its('ports') { should eq '6446-6449/tcp, 8443/tcp' } its('command') { should match '/run.sh.*' } end end control 'packages' do impact 0.5 - describe package('mysql-community-server-minimal') do - it { should be_installed } - its ('version') { should match '8.0.23.*' } - end describe package('mysql-router-community') do it { should be_installed } its ('version') { should match '8.0.23.*' } diff --git a/mysql-router/8.0/run.sh b/mysql-router/8.0/run.sh index a52394e38..e73f3cc7b 100755 --- a/mysql-router/8.0/run.sh +++ b/mysql-router/8.0/run.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2021, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -26,6 +26,16 @@ if [ "$1" = 'mysqlrouter' ]; then exit 1 fi + if [ -z $MYSQL_CREATE_ROUTER_USER ]; then + MYSQL_CREATE_ROUTER_USER=1 + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is not set, Router will generate a new account to be used at runtime." + echo "[Entrypoint] Set it to 0 to reuse $MYSQL_USER instead." + elif [ "$MYSQL_CREATE_ROUTER_USER" = "0" ]; then + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is 0, Router will reuse $MYSQL_USER account at runtime" + else + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is not 0, Router will generate a new account to be used at runtime" + fi + PASSFILE=$(mktemp) echo "$MYSQL_PASSWORD" > "$PASSFILE" DEFAULTS_EXTRA_FILE=$(mktemp) @@ -37,34 +47,41 @@ EOF max_tries=12 attempt_num=0 until (echo > "/dev/tcp/$MYSQL_HOST/$MYSQL_PORT") >/dev/null 2>&1; do - echo "Waiting for mysql server $MYSQL_HOST ($attempt_num/$max_tries)" + echo "[Entrypoint] Waiting for mysql server $MYSQL_HOST ($attempt_num/$max_tries)" sleep $(( attempt_num++ )) if (( attempt_num == max_tries )); then exit 1 fi done - echo "Succesfully contacted mysql server at $MYSQL_HOST. Checking for cluster state." + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST:$MYSQL_PORT. Checking for cluster state." if ! [[ "$(mysql --defaults-extra-file="$DEFAULTS_EXTRA_FILE" -u "$MYSQL_USER" -h "$MYSQL_HOST" -P "$MYSQL_PORT" -e "show status;" 2> /dev/null)" ]]; then - echo "Can not connect to database. Exiting." + echo "[Entrypoint] ERROR: Can not connect to database. Exiting." exit 1 fi if [[ -n $MYSQL_INNODB_CLUSTER_MEMBERS ]]; then attempt_num=0 echo $attempt_num echo $max_tries - until [ "$(mysql --defaults-extra-file="$DEFAULTS_EXTRA_FILE" -u "$MYSQL_USER" -h "$MYSQL_HOST" -P "$MYSQL_PORT" -N performance_schema -e "select count(MEMBER_STATE) = $MYSQL_INNODB_CLUSTER_MEMBERS from replication_group_members where MEMBER_STATE = 'ONLINE';" 2> /dev/null)" -eq 1 ]; do - echo "Waiting for $MYSQL_INNODB_CLUSTER_MEMBERS cluster instances to become available via $MYSQL_HOST ($attempt_num/$max_tries)" + until [ "$(mysql --defaults-extra-file="$DEFAULTS_EXTRA_FILE" -u "$MYSQL_USER" -h "$MYSQL_HOST" -P "$MYSQL_PORT" -N performance_schema -e "select count(MEMBER_STATE) >= $MYSQL_INNODB_CLUSTER_MEMBERS from replication_group_members where MEMBER_STATE = 'ONLINE';" 2> /dev/null)" -eq 1 ]; do + echo "[Entrypoint] Waiting for $MYSQL_INNODB_CLUSTER_MEMBERS cluster instances to become available via $MYSQL_HOST ($attempt_num/$max_tries)" sleep $(( attempt_num++ )) if (( attempt_num == max_tries )); then exit 1 fi done - echo "Successfully contacted cluster with $MYSQL_INNODB_CLUSTER_MEMBERS members. Bootstrapping." + echo "[Entrypoint] Successfully contacted cluster with $MYSQL_INNODB_CLUSTER_MEMBERS members. Bootstrapping." + fi + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap." + if [ "$MYSQL_CREATE_ROUTER_USER" = "0" ]; then + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap reusing account \"$MYSQL_USER\"." + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force --account-create=never --account=$MYSQL_USER < "$PASSFILE" + else + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap." + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force < "$PASSFILE" fi - echo "Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap." - mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --user=mysqlrouter --directory /tmp/mysqlrouter --force < "$PASSFILE" + sed -i -e 's/logging_folder=.*$/logging_folder=/' /tmp/mysqlrouter/mysqlrouter.conf - echo "Starting mysql-router." + echo "[Entrypoint] Starting mysql-router." exec "$@" --config /tmp/mysqlrouter/mysqlrouter.conf fi @@ -73,3 +90,4 @@ rm -f "$DEFAULTS_EXTRA_FILE" unset DEFAULTS_EXTRA_FILE exec "$@" + diff --git a/mysql-router/README.md b/mysql-router/README.md index ceb6e4b0e..6b2f90cce 100644 --- a/mysql-router/README.md +++ b/mysql-router/README.md @@ -32,7 +32,8 @@ The image uses the following optional variables: | Variable | Description | | ------------------------ | ------------------------------------------- | -| MYSQL_INNODB_CLUSTER_MEMBERS | The number of cluster instances to wait for | +| MYSQL_INNODB_CLUSTER_MEMBERS | Wait for at least this number of cluster instances to be ONLINE | +| MYSQL_CREATE_ROUTER_USER | Whether to create a new account for the Router to use when it's running. Defaults to 1, set to 0 to disable. | If supplied the run script waits for the given mysql host to be up, the InnoDB cluster to have MYSQL_INNODB_CLUSTER_MEMBERS members and then uses the given server for its @@ -54,5 +55,23 @@ docker ps The following output should be displayed: ``` -4954b1c80be1 mysql-router:8.0 "/run.sh mysqlrouter" About a minute ago Up About a minute (healthy) 6447/tcp, 64460/tcp, 0.0.0.0:6446->6446/tcp, 64470/tcp innodbcluster_mysql-router_1 +4954b1c80be1 mysql-router:8.0 "/run.sh mysqlrouter" About a minute ago Up About a minute (healthy) 6447/tcp, 6448/tcp, 0.0.0.0:6446->6446/tcp, 6449/tcp innodbcluster_mysql-router_1 ``` + +# Exposed Ports + +The following TCP ports are exposed by the MySQL Router container: + +| Port | Description +| ----- | --------------------------------------------------------------------------------------- | +| 6446 | R/W connection port. Clients that connect to this port will be forwarded to the PRIMARY | +| 6447 | R/O connection port. Clients that connect to this port will be forwarded to a SECONDARY | +| 6448 | X Protocol R/W connection port. R/W port for X protocol client connections | +| 6449 | X Protocol R/O connection port. R/O port for X protocol client connections | +| 8443 | HTTPS REST interface port. | + +For more information about the REST interface API, see: + +https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-rest-api-reference.html + + diff --git a/mysql-router/VERSION b/mysql-router/VERSION index 3e7d185cd..0d6135efd 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -1,10 +1,5 @@ -IMAGE_VERSION=0.13-router +IMAGE_VERSION=1.0.1 declare -A MYSQL_ROUTER_VERSIONS MYSQL_ROUTER_VERSIONS["8.0"]=8.0.23 declare -A MYSQL_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["8.0"]=8.0.23 - -declare -A FULL_ROUTER_VERSIONS -FULL_ROUTER_VERSIONS["8.0"]="${MYSQL_ROUTER_VERSIONS["8.0"]}-${IMAGE_VERSION}" - -LATEST="8.0" diff --git a/mysql-router/gen_dockerfiles.sh b/mysql-router/gen_dockerfiles.sh index 6b437ea9a..b390059d9 100755 --- a/mysql-router/gen_dockerfiles.sh +++ b/mysql-router/gen_dockerfiles.sh @@ -6,7 +6,7 @@ source ./VERSION REPO=https://repo.mysql.com; [ -n "$1" ] && REPO=$1 for MAJOR_VERSION in "${!MYSQL_ROUTER_VERSIONS[@]}"; do - sed 's#%%MYSQL_SERVER_PACKAGE%%#'"mysql-community-server-minimal-${MYSQL_SERVER_VERSIONS[${MAJOR_VERSION}]}"'#g' template/Dockerfile > tmpFile + sed 's#%%MYSQL_CLIENT_PACKAGE%%#'"mysql-community-client-${MYSQL_SERVER_VERSIONS[${MAJOR_VERSION}]}"'#g' template/Dockerfile > tmpFile sed -i 's#%%MYSQL_ROUTER_PACKAGE%%#'"mysql-router-community-${MYSQL_ROUTER_VERSIONS[${MAJOR_VERSION}]}"'#g' tmpFile sed -i 's#%%REPO%%#'"${REPO}"'#g' tmpFile REPO_VERSION=${MAJOR_VERSION//\./} @@ -14,10 +14,17 @@ for MAJOR_VERSION in "${!MYSQL_ROUTER_VERSIONS[@]}"; do mv tmpFile $MAJOR_VERSION/Dockerfile # update test template - sed -e 's#%%MYSQL_SERVER_PACKAGE_VERSION%%#'"${MYSQL_SERVER_VERSIONS[${MAJOR_VERSION}]}"'#g' template/control.rb > tmpFile + sed -e 's#%%MYSQL_CLIENT_PACKAGE_VERSION%%#'"${MYSQL_SERVER_VERSIONS[${MAJOR_VERSION}]}"'#g' template/control.rb > tmpFile sed -i -e 's#%%MYSQL_ROUTER_PACKAGE_VERSION%%#'"${MYSQL_ROUTER_VERSIONS[${MAJOR_VERSION}]}"'#g' tmpFile if [ ! -d "${MAJOR_VERSION}/inspec" ]; then mkdir "${MAJOR_VERSION}/inspec" fi mv tmpFile "${MAJOR_VERSION}/inspec/control.rb" + + # copy entrypoint script + cp template/run.sh $MAJOR_VERSION/run.sh + chmod +x $MAJOR_VERSION/run.sh + + cp README.md $MAJOR_VERSION/ done + diff --git a/mysql-router/template/Dockerfile b/mysql-router/template/Dockerfile index e721fee16..5de17b56a 100644 --- a/mysql-router/template/Dockerfile +++ b/mysql-router/template/Dockerfile @@ -1,4 +1,4 @@ -# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2021, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -12,24 +12,19 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -FROM oraclelinux:7-slim +FROM oraclelinux:8-slim -ARG MYSQL_SERVER_PACKAGE=%%MYSQL_SERVER_PACKAGE%% +ARG MYSQL_CLIENT_PACKAGE=%%MYSQL_CLIENT_PACKAGE%% ARG MYSQL_ROUTER_PACKAGE=%%MYSQL_ROUTER_PACKAGE%% -RUN yum install -y %%REPO%%/mysql-community-minimal-release-el7.rpm \ - %%REPO%%/mysql-community-release-el7.rpm \ - && yum-config-manager --enable mysql%%REPO_VERSION%%-server-minimal \ - && yum-config-manager --enable mysql-tools-community \ - && yum install -y \ - $MYSQL_SERVER_PACKAGE \ - $MYSQL_ROUTER_PACKAGE \ - libpwquality \ - && yum clean all +RUN rpm -U %%REPO%%/mysql%%REPO_VERSION%%-community-release-el8-1.noarch.rpm \ + && microdnf install -y --disablerepo=ol8_appstream \ + $MYSQL_CLIENT_PACKAGE $MYSQL_ROUTER_PACKAGE \ + && microdnf clean all COPY run.sh /run.sh HEALTHCHECK \ CMD mysqladmin --port 6446 --protocol TCP ping 2>&1 | grep Access || exit 1 -EXPOSE 6446 6447 64460 64470 +EXPOSE 6446 6447 6448 6449 8443 ENTRYPOINT ["/run.sh"] CMD ["mysqlrouter"] diff --git a/mysql-router/template/control.rb b/mysql-router/template/control.rb index 04532ab0d..35f458382 100644 --- a/mysql-router/template/control.rb +++ b/mysql-router/template/control.rb @@ -4,16 +4,12 @@ it { should exist } it { should be_running } its('repo') { should eq 'mysql/mysql-router' } - its('ports') { should eq '6446-6447/tcp, 64460/tcp, 64470/tcp' } + its('ports') { should eq '6446-6449/tcp, 8443/tcp' } its('command') { should match '/run.sh.*' } end end control 'packages' do impact 0.5 - describe package('mysql-community-server-minimal') do - it { should be_installed } - its ('version') { should match '%%MYSQL_SERVER_PACKAGE_VERSION%%.*' } - end describe package('mysql-router-community') do it { should be_installed } its ('version') { should match '%%MYSQL_ROUTER_PACKAGE_VERSION%%.*' } diff --git a/mysql-router/template/run.sh b/mysql-router/template/run.sh index e73f3cc7b..796f919fb 100755 --- a/mysql-router/template/run.sh +++ b/mysql-router/template/run.sh @@ -26,18 +26,20 @@ if [ "$1" = 'mysqlrouter' ]; then exit 1 fi + PASSFILE=$(mktemp) + echo "$MYSQL_PASSWORD" > "$PASSFILE" if [ -z $MYSQL_CREATE_ROUTER_USER ]; then + echo "$MYSQL_PASSWORD" >> "$PASSFILE" MYSQL_CREATE_ROUTER_USER=1 echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is not set, Router will generate a new account to be used at runtime." echo "[Entrypoint] Set it to 0 to reuse $MYSQL_USER instead." elif [ "$MYSQL_CREATE_ROUTER_USER" = "0" ]; then + echo "$MYSQL_PASSWORD" >> "$PASSFILE" echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is 0, Router will reuse $MYSQL_USER account at runtime" else echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is not 0, Router will generate a new account to be used at runtime" fi - PASSFILE=$(mktemp) - echo "$MYSQL_PASSWORD" > "$PASSFILE" DEFAULTS_EXTRA_FILE=$(mktemp) cat >"$DEFAULTS_EXTRA_FILE" < /dev/null)" ]]; then - echo "[Entrypoint] ERROR: Can not connect to database. Exiting." - exit 1 + echo "[Entrypoint] ERROR: Can not connect to database. Exiting." + exit 1 fi if [[ -n $MYSQL_INNODB_CLUSTER_MEMBERS ]]; then attempt_num=0 @@ -71,13 +73,15 @@ EOF done echo "[Entrypoint] Successfully contacted cluster with $MYSQL_INNODB_CLUSTER_MEMBERS members. Bootstrapping." fi - echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap." + if [ $(id -u) = "0" ]; then + opt_user=--user=mysqlrouter + fi if [ "$MYSQL_CREATE_ROUTER_USER" = "0" ]; then echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap reusing account \"$MYSQL_USER\"." - mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force --account-create=never --account=$MYSQL_USER < "$PASSFILE" + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force --account-create=never --account=$MYSQL_USER $opt_user < "$PASSFILE" || exit 1 else echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap." - mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force < "$PASSFILE" + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force $opt_user < "$PASSFILE" || exit 1 fi sed -i -e 's/logging_folder=.*$/logging_folder=/' /tmp/mysqlrouter/mysqlrouter.conf From 1eb2d586b7478d8a35fa8752983343196c36c9ae Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 9 Mar 2021 20:59:41 +0100 Subject: [PATCH 209/386] Update server and router versions to 8.0.24 Change-Id: Id8a4d2f47e2479863b9d2f3a563df0d93ab04a36 --- mysql-router/VERSION | 4 ++-- mysql-server/VERSION | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-router/VERSION b/mysql-router/VERSION index 0d6135efd..7b16d6529 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -1,5 +1,5 @@ IMAGE_VERSION=1.0.1 declare -A MYSQL_ROUTER_VERSIONS -MYSQL_ROUTER_VERSIONS["8.0"]=8.0.23 +MYSQL_ROUTER_VERSIONS["8.0"]=8.0.24 declare -A MYSQL_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["8.0"]=8.0.23 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.24 diff --git a/mysql-server/VERSION b/mysql-server/VERSION index 3f9dfc174..793a5c013 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,8 +1,8 @@ -IMAGE_VERSION=1.2.0-server +IMAGE_VERSION=1.2.1-server declare -A MYSQL_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["5.7"]=5.7.33 -MYSQL_SERVER_VERSIONS["8.0"]=8.0.23 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.24 declare -A MYSQL_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["5.7"]=8.0.23 From 9df7635369865657db380fb5e22c708c4a8377a2 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 9 Mar 2021 21:12:29 +0100 Subject: [PATCH 210/386] Add full version variable to router's VERSION file The variable is needed by the image tagging script Change-Id: I9a6e34148ff905b49ed6528b0dacfcd14528e657 --- mysql-router/VERSION | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mysql-router/VERSION b/mysql-router/VERSION index 7b16d6529..67724750d 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -3,3 +3,8 @@ declare -A MYSQL_ROUTER_VERSIONS MYSQL_ROUTER_VERSIONS["8.0"]=8.0.24 declare -A MYSQL_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["8.0"]=8.0.24 + +declare -A FULL_ROUTER_VERSIONS +FULL_ROUTER_VERSIONS["8.0"]="${MYSQL_ROUTER_VERSIONS["8.0"]}-${IMAGE_VERSION}" + +LATEST="8.0" From c89dfa2e2afc5a1898fe4e7ddbde2d39812b2a40 Mon Sep 17 00:00:00 2001 From: Alfredo Kojima Date: Thu, 4 Mar 2021 07:42:46 -0800 Subject: [PATCH 211/386] Added router documentation link to README Updated router version, fixed entrypoint to not re-execute router after router exits Change-Id: Ibfca6b1e0a68dca16f207430af58a93cacb2f732 --- mysql-router/README.md | 2 ++ mysql-router/VERSION | 2 +- mysql-router/template/control.rb | 4 ++++ mysql-router/template/run.sh | 13 ++++++------- mysql-router/test.sh | 4 ++-- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/mysql-router/README.md b/mysql-router/README.md index 6b2f90cce..77a4c0237 100644 --- a/mysql-router/README.md +++ b/mysql-router/README.md @@ -74,4 +74,6 @@ For more information about the REST interface API, see: https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-rest-api-reference.html +For full usage documentation, see: +https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-installation-docker.html diff --git a/mysql-router/VERSION b/mysql-router/VERSION index 67724750d..93ecbcddf 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.0.1 +IMAGE_VERSION=1.0.1-router declare -A MYSQL_ROUTER_VERSIONS MYSQL_ROUTER_VERSIONS["8.0"]=8.0.24 declare -A MYSQL_SERVER_VERSIONS diff --git a/mysql-router/template/control.rb b/mysql-router/template/control.rb index 35f458382..9ed85deab 100644 --- a/mysql-router/template/control.rb +++ b/mysql-router/template/control.rb @@ -10,6 +10,10 @@ end control 'packages' do impact 0.5 + describe package('mysql-community-client') do + it { should be_installed } + its ('version') { should match '%%MYSQL_CLIENT_PACKAGE_VERSION%%.*' } + end describe package('mysql-router-community') do it { should be_installed } its ('version') { should match '%%MYSQL_ROUTER_PACKAGE_VERSION%%.*' } diff --git a/mysql-router/template/run.sh b/mysql-router/template/run.sh index 796f919fb..9d1e78bfb 100755 --- a/mysql-router/template/run.sh +++ b/mysql-router/template/run.sh @@ -87,11 +87,10 @@ EOF sed -i -e 's/logging_folder=.*$/logging_folder=/' /tmp/mysqlrouter/mysqlrouter.conf echo "[Entrypoint] Starting mysql-router." exec "$@" --config /tmp/mysqlrouter/mysqlrouter.conf -fi - -rm -f "$PASSFILE" -rm -f "$DEFAULTS_EXTRA_FILE" -unset DEFAULTS_EXTRA_FILE - -exec "$@" + rm -f "$PASSFILE" + rm -f "$DEFAULTS_EXTRA_FILE" + unset DEFAULTS_EXTRA_FILE +else + exec "$@" +fi diff --git a/mysql-router/test.sh b/mysql-router/test.sh index 33f4903b4..e2b507273 100755 --- a/mysql-router/test.sh +++ b/mysql-router/test.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2021, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -22,7 +22,7 @@ source ./VERSION for MAJOR_VERSION in "${!MYSQL_ROUTER_VERSIONS[@]}" do - docker run -d -e MYSQL_HOST=x -e MYSQL_PORT=9 -e MYSQL_USER=x -e MYSQL_PASSWORD=x -e MYSQL_INNODB_NUM_MEMBERS=1 --name mysql-router mysql/mysql-router:$MAJOR_VERSION sleep 5000 + docker run -d -e MYSQL_HOST=x -e MYSQL_PORT=9 -e MYSQL_USER=x -e MYSQL_PASSWORD=x -e MYSQL_INNODB_CLUSTER_MEMBERS=1 --name mysql-router mysql/mysql-router:$MAJOR_VERSION sleep 5000 inspec exec $MAJOR_VERSION/inspec/control.rb --controls container inspec exec $MAJOR_VERSION/inspec/control.rb -t docker://mysql-router --controls packages docker stop mysql-router From 70c5bf94fb78fb213138d4186209cf887dfb97b4 Mon Sep 17 00:00:00 2001 From: Alfredo Kojima Date: Wed, 10 Mar 2021 17:58:18 -0800 Subject: [PATCH 212/386] Fixed RESTART of mysqld process, clean up gen_dockerfile mysqld only accepts MYSQLD_PARENT_PID if it matches the return value of getppid(), so get the parent pid by using the procfs. Change-Id: I4a816b3377874a10b0b8bb26f7362187bf20eee7 --- mysql-server/8.0/docker-entrypoint.sh | 2 +- mysql-server/gen_dockerfiles.sh | 22 --------------- mysql-server/template/docker-entrypoint.sh | 31 +++++++++++----------- 3 files changed, 16 insertions(+), 39 deletions(-) diff --git a/mysql-server/8.0/docker-entrypoint.sh b/mysql-server/8.0/docker-entrypoint.sh index 1057d5ed9..cb05d6215 100755 --- a/mysql-server/8.0/docker-entrypoint.sh +++ b/mysql-server/8.0/docker-entrypoint.sh @@ -224,4 +224,4 @@ else fi fi -export MYSQLD_PARENT_PID=$$ ; exec "$@" --user=$MYSQLD_USER +export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) ; exec "$@" --user=$MYSQLD_USER diff --git a/mysql-server/gen_dockerfiles.sh b/mysql-server/gen_dockerfiles.sh index 7b9351e93..c2bf05a21 100755 --- a/mysql-server/gen_dockerfiles.sh +++ b/mysql-server/gen_dockerfiles.sh @@ -32,24 +32,6 @@ declare -A PASSWORDSET PASSWORDSET["5.7"]="ALTER USER 'root'@'localhost' IDENTIFIED BY '\${MYSQL_ROOT_PASSWORD}';" PASSWORDSET["8.0"]=${PASSWORDSET["5.7"]} -declare -A DATABASE_INIT -DATABASE_INIT["5.7"]="\"\$@\" --user=\$MYSQLD_USER --initialize-insecure" -DATABASE_INIT["8.0"]="\"\$@\" --user=\$MYSQLD_USER --initialize-insecure" - -# 5.7+ has the --daemonize flag, which makes the process fork and then exit when -# the server is ready, removing the need for a fragile wait loop -declare -A INIT_STARTUP -INIT_STARTUP["5.7"]="\"\$@\" --user=\$MYSQLD_USER --daemonize --skip-networking --socket=\"\$SOCKET\"" -INIT_STARTUP["8.0"]="\"\$@\" --user=\$MYSQLD_USER --daemonize --skip-networking --socket=\"\$SOCKET\"" - -declare -A STARTUP -STARTUP["5.7"]="exec \"\$@\" --user=\$MYSQLD_USER" -STARTUP["8.0"]="export MYSQLD_PARENT_PID=\$\$ ; exec \"\$@\" --user=\$MYSQLD_USER" - -declare -A STARTUP_WAIT -STARTUP_WAIT["5.7"]="\"\"" -STARTUP_WAIT["8.0"]="\"\"" - # MySQL 8.0 supports a call to validate the config, while older versions have it as a side # effect of running --verbose --help declare -A VALIDATE_CONFIG @@ -98,10 +80,6 @@ do # Entrypoint sed 's#%%PASSWORDSET%%#'"${PASSWORDSET[${VERSION}]}"'#g' template/docker-entrypoint.sh > tmpfile - sed -i 's#%%DATABASE_INIT%%#'"${DATABASE_INIT[${VERSION}]}"'#g' tmpfile - sed -i 's#%%INIT_STARTUP%%#'"${INIT_STARTUP[${VERSION}]}"'#g' tmpfile - sed -i 's#%%STARTUP%%#'"${STARTUP[${VERSION}]}"'#g' tmpfile - sed -i 's#%%STARTUP_WAIT%%#'"${STARTUP_WAIT[${VERSION}]}"'#g' tmpfile sed -i 's#%%FULL_SERVER_VERSION%%#'"${FULL_SERVER_VERSIONS[${VERSION}]}"'#g' tmpfile sed -i 's#%%VALIDATE_CONFIG%%#'"${VALIDATE_CONFIG[${VERSION}]}"'#g' tmpfile mv tmpfile ${VERSION}/docker-entrypoint.sh diff --git a/mysql-server/template/docker-entrypoint.sh b/mysql-server/template/docker-entrypoint.sh index fe82c3ac5..d0530b904 100644 --- a/mysql-server/template/docker-entrypoint.sh +++ b/mysql-server/template/docker-entrypoint.sh @@ -87,10 +87,10 @@ if [ "$1" = 'mysqld' ]; then fi echo '[Entrypoint] Initializing database' - %%DATABASE_INIT%% - echo '[Entrypoint] Database initialized' + "$@" --user=$MYSQLD_USER --initialize-insecure - %%INIT_STARTUP%% + echo '[Entrypoint] Database initialized' + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" # To avoid using password on commandline, put it in a temporary file. # The file is only populated when and if the root password is set. @@ -100,19 +100,16 @@ if [ "$1" = 'mysqld' ]; then # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") - if [ ! -z %%STARTUP_WAIT%% ]; - then - for i in {30..0}; do - if mysqladmin --socket="$SOCKET" ping &>/dev/null; then - break - fi - echo '[Entrypoint] Waiting for server...' - sleep 1 - done - if [ "$i" = 0 ]; then - echo >&2 '[Entrypoint] Timeout during MySQL init.' - exit 1 + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 fi mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql @@ -217,7 +214,9 @@ EOF else echo "[Entrypoint] Starting MySQL %%FULL_SERVER_VERSION%%" fi - %%STARTUP%% + # 4th value of /proc/$pid/stat is the ppid, same as getppid() + export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) + exec "$@" --user=$MYSQLD_USER else exec "$@" fi From b692089958cb39baafef3e2a2833f91467af8e30 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Wed, 17 Mar 2021 14:03:45 +0100 Subject: [PATCH 213/386] Update versions for 8.0.24 release cycle Change-Id: I26eac174dac6db002b9c4ab68b5d40051ba4a3dd --- mysql-cluster/VERSION | 14 +++++++------- mysql-server/VERSION | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/mysql-cluster/VERSION b/mysql-cluster/VERSION index aeffeaba8..b71895721 100644 --- a/mysql-cluster/VERSION +++ b/mysql-cluster/VERSION @@ -1,14 +1,14 @@ -IMAGE_VERSION=1.2.0-cluster +IMAGE_VERSION=1.2.1-cluster declare -A MYSQL_CLUSTER_VERSIONS -MYSQL_CLUSTER_VERSIONS["7.5"]=7.5.21 -MYSQL_CLUSTER_VERSIONS["7.6"]=7.6.17 -MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.23 +MYSQL_CLUSTER_VERSIONS["7.5"]=7.5.22 +MYSQL_CLUSTER_VERSIONS["7.6"]=7.6.18 +MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.24 declare -A MYSQL_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["7.5"]=8.0.23 -MYSQL_SHELL_VERSIONS["7.6"]=8.0.23 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.23 +MYSQL_SHELL_VERSIONS["7.5"]=8.0.24 +MYSQL_SHELL_VERSIONS["7.6"]=8.0.24 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.24 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["7.5"]="${MYSQL_CLUSTER_VERSIONS["7.5"]}-${IMAGE_VERSION}" diff --git a/mysql-server/VERSION b/mysql-server/VERSION index 793a5c013..4ead7a199 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,12 +1,12 @@ IMAGE_VERSION=1.2.1-server declare -A MYSQL_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["5.7"]=5.7.33 +MYSQL_SERVER_VERSIONS["5.7"]=5.7.34 MYSQL_SERVER_VERSIONS["8.0"]=8.0.24 declare -A MYSQL_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["5.7"]=8.0.23 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.23 +MYSQL_SHELL_VERSIONS["5.7"]=8.0.24 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.24 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["5.7"]="${MYSQL_SERVER_VERSIONS["5.7"]}-${IMAGE_VERSION}" From 7158c91a5c3f19f7d64c0bb8c656fa88e1fb22f1 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 21 Apr 2021 13:20:42 +0000 Subject: [PATCH 214/386] Release version 1.2.1-cluster * Update versions for 8.0.24 release cycle * Fixed RESTART of mysqld process, clean up gen_dockerfile * Added router documentation link to README * Add full version variable to router's VERSION file * Update server and router versions to 8.0.24 * WL#14493,Bug#32034038,Bug#31249934 Router Docker Image * Update versions to be independent * Allow starting container with bash etc * Update test script * Cluster: Use parameters for the repo name for 7.6 and 7.5 * Revert server versions to currently released ones * WL14492 MySQL Server and Cluster Docker Images * Merged community server, router and mysql-cluster docker image branches. * Bump image version for out-of-cycle release to get correct shell version * Update shell version to 8.0.23 --- mysql-cluster/7.5/Dockerfile | 6 +++--- mysql-cluster/7.5/docker-entrypoint.sh | 4 ++-- mysql-cluster/7.5/inspec/control.rb | 4 ++-- mysql-cluster/7.6/Dockerfile | 4 ++-- mysql-cluster/7.6/docker-entrypoint.sh | 4 ++-- mysql-cluster/7.6/inspec/control.rb | 4 ++-- mysql-cluster/8.0/Dockerfile | 2 +- mysql-cluster/8.0/docker-entrypoint.sh | 4 ++-- mysql-cluster/8.0/inspec/control.rb | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/mysql-cluster/7.5/Dockerfile b/mysql-cluster/7.5/Dockerfile index 22cf2af4e..64606d80f 100644 --- a/mysql-cluster/7.5/Dockerfile +++ b/mysql-cluster/7.5/Dockerfile @@ -15,8 +15,8 @@ FROM oraclelinux:7-slim -ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.5.21 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.23 +ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.5.22 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.24 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el7.rpm \ @@ -24,7 +24,7 @@ RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el7.rp # Install server and shell 8.0 RUN yum install -y $MYSQL_SHELL_PACKAGE \ - && yum install -y $MYSQL_CLUSTER_PACKAGE --enablerepo=mysql-cluster76-minimal\ + && yum install -y $MYSQL_CLUSTER_PACKAGE --enablerepo=mysql-cluster75-minimal\ && yum clean all \ && mkdir /docker-entrypoint-initdb.d diff --git a/mysql-cluster/7.5/docker-entrypoint.sh b/mysql-cluster/7.5/docker-entrypoint.sh index d6290fef6..b09a77447 100755 --- a/mysql-cluster/7.5/docker-entrypoint.sh +++ b/mysql-cluster/7.5/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 7.5.21-1.2.0" +echo "[Entrypoint] MySQL Docker Image 7.5.22-1.2.1-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -219,7 +219,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 7.5.21-1.2.0" + echo "[Entrypoint] Starting MySQL 7.5.22-1.2.1-cluster" fi else if [ -n "$MYSQL_INITIALIZE_ONLY" ]; then diff --git a/mysql-cluster/7.5/inspec/control.rb b/mysql-cluster/7.5/inspec/control.rb index 4603e36a8..08fbba780 100644 --- a/mysql-cluster/7.5/inspec/control.rb +++ b/mysql-cluster/7.5/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '7.5.21.*' } + its ('version') { should match '7.5.22.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.23.*' } + its ('version') { should match '8.0.24.*' } end end diff --git a/mysql-cluster/7.6/Dockerfile b/mysql-cluster/7.6/Dockerfile index 78199a48c..4a0200467 100644 --- a/mysql-cluster/7.6/Dockerfile +++ b/mysql-cluster/7.6/Dockerfile @@ -15,8 +15,8 @@ FROM oraclelinux:7-slim -ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.6.17 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.23 +ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.6.18 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.24 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el7.rpm \ diff --git a/mysql-cluster/7.6/docker-entrypoint.sh b/mysql-cluster/7.6/docker-entrypoint.sh index 6e8a75ea5..9acc4fd65 100755 --- a/mysql-cluster/7.6/docker-entrypoint.sh +++ b/mysql-cluster/7.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 7.6.17-1.2.0" +echo "[Entrypoint] MySQL Docker Image 7.6.18-1.2.1-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -219,7 +219,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 7.6.17-1.2.0" + echo "[Entrypoint] Starting MySQL 7.6.18-1.2.1-cluster" fi else if [ -n "$MYSQL_INITIALIZE_ONLY" ]; then diff --git a/mysql-cluster/7.6/inspec/control.rb b/mysql-cluster/7.6/inspec/control.rb index 9ac2c3228..53a80a946 100644 --- a/mysql-cluster/7.6/inspec/control.rb +++ b/mysql-cluster/7.6/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '7.6.17.*' } + its ('version') { should match '7.6.18.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.23.*' } + its ('version') { should match '8.0.24.*' } end end diff --git a/mysql-cluster/8.0/Dockerfile b/mysql-cluster/8.0/Dockerfile index 4862d12c3..87beddb8e 100644 --- a/mysql-cluster/8.0/Dockerfile +++ b/mysql-cluster/8.0/Dockerfile @@ -16,7 +16,7 @@ FROM oraclelinux:8-slim ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-8.0.24 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.23 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.24 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el8.rpm \ diff --git a/mysql-cluster/8.0/docker-entrypoint.sh b/mysql-cluster/8.0/docker-entrypoint.sh index 21f945913..8c7324c03 100755 --- a/mysql-cluster/8.0/docker-entrypoint.sh +++ b/mysql-cluster/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.24-1.2.0" +echo "[Entrypoint] MySQL Docker Image 8.0.24-1.2.1-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -219,7 +219,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.24-1.2.0" + echo "[Entrypoint] Starting MySQL 8.0.24-1.2.1-cluster" fi else if [ -n "$MYSQL_INITIALIZE_ONLY" ]; then diff --git a/mysql-cluster/8.0/inspec/control.rb b/mysql-cluster/8.0/inspec/control.rb index c77571df4..56955a9b9 100644 --- a/mysql-cluster/8.0/inspec/control.rb +++ b/mysql-cluster/8.0/inspec/control.rb @@ -16,6 +16,6 @@ end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.23.*' } + its ('version') { should match '8.0.24.*' } end end From 2ed4df0242fe585892f27eb5c930b2f092139bd5 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Mon, 26 Apr 2021 09:19:58 +0200 Subject: [PATCH 215/386] Remove -1.noarch from config rpm urls This can lead to us installing older config packages. The file without this part is a symlink to the newest one. Change-Id: Id3008b80b84ba6bbfcd05bd86b36166e9cbdd73f --- mysql-cluster/template/Dockerfile-pre8 | 2 +- mysql-router/template/Dockerfile | 2 +- mysql-server/template/Dockerfile | 2 +- mysql-server/template/Dockerfile-pre8 | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-cluster/template/Dockerfile-pre8 b/mysql-cluster/template/Dockerfile-pre8 index 2685a4f57..25afea460 100644 --- a/mysql-cluster/template/Dockerfile-pre8 +++ b/mysql-cluster/template/Dockerfile-pre8 @@ -20,7 +20,7 @@ ARG MYSQL_SHELL_PACKAGE=%%MYSQL_SHELL_PACKAGE%% # Setup repositories for minimal packages (all versions) RUN rpm -U %%REPO%%/mysql-cluster-community-minimal-release-el7.rpm \ - && rpm -U %%REPO%%/mysql80-community-release-el7-1.noarch.rpm + && rpm -U %%REPO%%/mysql80-community-release-el7.rpm # Install server and shell 8.0 RUN yum install -y $MYSQL_SHELL_PACKAGE \ diff --git a/mysql-router/template/Dockerfile b/mysql-router/template/Dockerfile index 5de17b56a..8bfd82d72 100644 --- a/mysql-router/template/Dockerfile +++ b/mysql-router/template/Dockerfile @@ -17,7 +17,7 @@ FROM oraclelinux:8-slim ARG MYSQL_CLIENT_PACKAGE=%%MYSQL_CLIENT_PACKAGE%% ARG MYSQL_ROUTER_PACKAGE=%%MYSQL_ROUTER_PACKAGE%% -RUN rpm -U %%REPO%%/mysql%%REPO_VERSION%%-community-release-el8-1.noarch.rpm \ +RUN rpm -U %%REPO%%/mysql%%REPO_VERSION%%-community-release-el8.rpm \ && microdnf install -y --disablerepo=ol8_appstream \ $MYSQL_CLIENT_PACKAGE $MYSQL_ROUTER_PACKAGE \ && microdnf clean all diff --git a/mysql-server/template/Dockerfile b/mysql-server/template/Dockerfile index a96e0c7fb..e1612a911 100644 --- a/mysql-server/template/Dockerfile +++ b/mysql-server/template/Dockerfile @@ -20,7 +20,7 @@ ARG MYSQL_SHELL_PACKAGE=%%MYSQL_SHELL_PACKAGE%% # Setup repositories for minimal packages (all versions) RUN rpm -U %%REPO%%/mysql-community-minimal-release-el8.rpm \ - && rpm -U %%REPO%%/mysql80-community-release-el8-1.noarch.rpm + && rpm -U %%REPO%%/mysql80-community-release-el8.rpm # Install server and shell 8.0 RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ diff --git a/mysql-server/template/Dockerfile-pre8 b/mysql-server/template/Dockerfile-pre8 index b77a5d9cc..be209fe18 100644 --- a/mysql-server/template/Dockerfile-pre8 +++ b/mysql-server/template/Dockerfile-pre8 @@ -19,7 +19,7 @@ ARG MYSQL_SHELL_PACKAGE=%%MYSQL_SHELL_PACKAGE%% # Setup repositories for minimal packages (all versions) RUN rpm -U %%REPO%%/mysql-community-minimal-release-el7.rpm \ - && rpm -U %%REPO%%/mysql80-community-release-el7-1.noarch.rpm + && rpm -U %%REPO%%/mysql80-community-release-el7.rpm # Install server and shell 8.0 RUN yum install -y $MYSQL_SHELL_PACKAGE \ From b3ee45ab70094ff37eb8b9a7b1be2f86e2f09095 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Mon, 26 Apr 2021 10:12:27 +0200 Subject: [PATCH 216/386] Bump image versions for fix release Change-Id: Iea4e13dc580750c77ae7aa17da30042221f46e72 --- mysql-cluster/VERSION | 2 +- mysql-router/VERSION | 2 +- mysql-server/VERSION | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mysql-cluster/VERSION b/mysql-cluster/VERSION index b71895721..796e7d29f 100644 --- a/mysql-cluster/VERSION +++ b/mysql-cluster/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.2.1-cluster +IMAGE_VERSION=1.2.2-cluster declare -A MYSQL_CLUSTER_VERSIONS MYSQL_CLUSTER_VERSIONS["7.5"]=7.5.22 diff --git a/mysql-router/VERSION b/mysql-router/VERSION index 93ecbcddf..1f5db3ac6 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.0.1-router +IMAGE_VERSION=1.0.2-router declare -A MYSQL_ROUTER_VERSIONS MYSQL_ROUTER_VERSIONS["8.0"]=8.0.24 declare -A MYSQL_SERVER_VERSIONS diff --git a/mysql-server/VERSION b/mysql-server/VERSION index 4ead7a199..f9319db53 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.2.1-server +IMAGE_VERSION=1.2.2-server declare -A MYSQL_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["5.7"]=5.7.34 From a6b33275c9a8a16345005a99f0403d1b3fa4a4fa Mon Sep 17 00:00:00 2001 From: Robert Neumayer Date: Wed, 21 Apr 2021 08:06:53 +0200 Subject: [PATCH 217/386] Use more specific name for testing containers If test runs of multiple major versions are run on the same host, we can end up unintentionally deleting containers while the tests are running. By adding the version to the test container name we should be able to avoid that. Requires changes in template generation, tests, and test scripts. Change-Id: I5f264ca06548020cc85be5b8055a04fa7f354dd5 --- mysql-cluster/gen_dockerfiles.sh | 1 + mysql-cluster/template/control.rb | 2 +- mysql-cluster/test.sh | 8 ++++---- mysql-router/gen_dockerfiles.sh | 1 + mysql-router/template/control.rb | 2 +- mysql-router/test.sh | 8 ++++---- mysql-server/gen_dockerfiles.sh | 1 + mysql-server/template/control.rb | 2 +- mysql-server/test.sh | 8 ++++---- 9 files changed, 18 insertions(+), 15 deletions(-) diff --git a/mysql-cluster/gen_dockerfiles.sh b/mysql-cluster/gen_dockerfiles.sh index f671c4e59..24e328b4e 100755 --- a/mysql-cluster/gen_dockerfiles.sh +++ b/mysql-cluster/gen_dockerfiles.sh @@ -92,6 +92,7 @@ do fi sed 's#%%MYSQL_CLUSTER_VERSION%%#'"${MYSQL_CLUSTER_VERSIONS[${VERSION}]}"'#g' template/control.rb > tmpFile sed -i 's#%%MYSQL_SHELL_VERSION%%#'"${MYSQL_SHELL_VERSIONS[${VERSION}]}"'#g' tmpFile + sed -i 's#%%MAJOR_VERSION%%#'"${VERSION}"'#g' tmpFile mv tmpFile "${VERSION}/inspec/control.rb" # Entrypoint diff --git a/mysql-cluster/template/control.rb b/mysql-cluster/template/control.rb index 9e47dc6d5..8e5d95df2 100644 --- a/mysql-cluster/template/control.rb +++ b/mysql-cluster/template/control.rb @@ -1,6 +1,6 @@ control 'container' do impact 0.5 - describe docker_container('mysql-cluster') do + describe docker_container('mysql-cluster-%%MAJOR_VERSION%%') do it { should exist } it { should be_running } its('repo') { should eq 'mysql/mysql-cluster' } diff --git a/mysql-cluster/test.sh b/mysql-cluster/test.sh index 3b7f2fa9e..da202821b 100755 --- a/mysql-cluster/test.sh +++ b/mysql-cluster/test.sh @@ -23,9 +23,9 @@ source VERSION MAJOR_VERSIONS=("${!MYSQL_CLUSTER_VERSIONS[@]}"); [ -n "$1" ] && MAJOR_VERSIONS=("${@:1}") for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do - docker run -d -e MYSQL_RANDOM_ROOT_PASSWORD=true --name mysql-cluster mysql/mysql-cluster:$MAJOR_VERSION --log-error + docker run -d -e MYSQL_RANDOM_ROOT_PASSWORD=true --name "mysql-cluster-$MAJOR_VERSION" "mysql/mysql-cluster:$MAJOR_VERSION" --log-error inspec exec --no-color $MAJOR_VERSION/inspec/control.rb --controls container - inspec exec --no-color $MAJOR_VERSION/inspec/control.rb -t docker://mysql-cluster --controls packages - docker stop mysql-cluster - docker rm mysql-cluster + inspec exec --no-color $MAJOR_VERSION/inspec/control.rb -t "docker://mysql-cluster-$MAJOR_VERSION" --controls packages + docker stop "mysql-cluster-$MAJOR_VERSION" + docker rm "mysql-cluster-$MAJOR_VERSION" done diff --git a/mysql-router/gen_dockerfiles.sh b/mysql-router/gen_dockerfiles.sh index b390059d9..ce071a008 100755 --- a/mysql-router/gen_dockerfiles.sh +++ b/mysql-router/gen_dockerfiles.sh @@ -16,6 +16,7 @@ for MAJOR_VERSION in "${!MYSQL_ROUTER_VERSIONS[@]}"; do # update test template sed -e 's#%%MYSQL_CLIENT_PACKAGE_VERSION%%#'"${MYSQL_SERVER_VERSIONS[${MAJOR_VERSION}]}"'#g' template/control.rb > tmpFile sed -i -e 's#%%MYSQL_ROUTER_PACKAGE_VERSION%%#'"${MYSQL_ROUTER_VERSIONS[${MAJOR_VERSION}]}"'#g' tmpFile + sed -i -e 's#%%MAJOR_VERSION%%#'"${MAJOR_VERSION}"'#g' tmpFile if [ ! -d "${MAJOR_VERSION}/inspec" ]; then mkdir "${MAJOR_VERSION}/inspec" fi diff --git a/mysql-router/template/control.rb b/mysql-router/template/control.rb index 9ed85deab..11e17e56e 100644 --- a/mysql-router/template/control.rb +++ b/mysql-router/template/control.rb @@ -1,6 +1,6 @@ control 'container' do impact 0.5 - describe docker_container('mysql-router') do + describe docker_container('mysql-router-%%MAJOR_VERSION%%') do it { should exist } it { should be_running } its('repo') { should eq 'mysql/mysql-router' } diff --git a/mysql-router/test.sh b/mysql-router/test.sh index e2b507273..76d77042e 100755 --- a/mysql-router/test.sh +++ b/mysql-router/test.sh @@ -22,9 +22,9 @@ source ./VERSION for MAJOR_VERSION in "${!MYSQL_ROUTER_VERSIONS[@]}" do - docker run -d -e MYSQL_HOST=x -e MYSQL_PORT=9 -e MYSQL_USER=x -e MYSQL_PASSWORD=x -e MYSQL_INNODB_CLUSTER_MEMBERS=1 --name mysql-router mysql/mysql-router:$MAJOR_VERSION sleep 5000 + docker run -d -e MYSQL_HOST=x -e MYSQL_PORT=9 -e MYSQL_USER=x -e MYSQL_PASSWORD=x -e MYSQL_INNODB_CLUSTER_MEMBERS=1 --name "mysql-router-$MAJOR_VERSION" mysql/mysql-router:$MAJOR_VERSION sleep 5000 inspec exec $MAJOR_VERSION/inspec/control.rb --controls container - inspec exec $MAJOR_VERSION/inspec/control.rb -t docker://mysql-router --controls packages - docker stop mysql-router - docker rm mysql-router + inspec exec $MAJOR_VERSION/inspec/control.rb -t "docker://mysql-router-$MAJOR_VERSION" --controls packages + docker stop "mysql-router-$MAJOR_VERSION" + docker rm "mysql-router-$MAJOR_VERSION" done diff --git a/mysql-server/gen_dockerfiles.sh b/mysql-server/gen_dockerfiles.sh index c2bf05a21..a338d4112 100755 --- a/mysql-server/gen_dockerfiles.sh +++ b/mysql-server/gen_dockerfiles.sh @@ -71,6 +71,7 @@ do fi sed 's#%%MYSQL_SERVER_VERSION%%#'"${MYSQL_SERVER_VERSIONS[${VERSION}]}"'#g' template/control.rb > tmpFile sed -i 's#%%MYSQL_SHELL_VERSION%%#'"${MYSQL_SHELL_VERSIONS[${VERSION}]}"'#g' tmpFile + sed -i 's#%%MAJOR_VERSION%%#'"${VERSION}"'#g' tmpFile if [ "${VERSION}" == "5.7" ]; then sed -i 's#%%PORTS%%#'"3306/tcp, 33060/tcp"'#g' tmpFile else diff --git a/mysql-server/template/control.rb b/mysql-server/template/control.rb index d110bcc06..e881f6eee 100644 --- a/mysql-server/template/control.rb +++ b/mysql-server/template/control.rb @@ -1,6 +1,6 @@ control 'container' do impact 0.5 - describe docker_container('mysql-server') do + describe docker_container('mysql-server-%%MAJOR_VERSION%%') do it { should exist } it { should be_running } its('repo') { should eq 'mysql/mysql-server' } diff --git a/mysql-server/test.sh b/mysql-server/test.sh index 35584e9a7..13235ddae 100755 --- a/mysql-server/test.sh +++ b/mysql-server/test.sh @@ -41,9 +41,9 @@ for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do ARCH_SUFFIX="-$ARCH" fi done - docker run -d --name mysql-server mysql/mysql-server:"$MAJOR_VERSION$ARCH_SUFFIX" + docker run -d --name "mysql-server-$MAJOR_VERSION" mysql/mysql-server:"$MAJOR_VERSION$ARCH_SUFFIX" inspec exec --no-color "$MAJOR_VERSION/inspec/control.rb" --controls container - inspec exec --no-color "$MAJOR_VERSION/inspec/control.rb" -t docker://mysql-server --controls packages - docker stop mysql-server - docker rm mysql-server + inspec exec --no-color "$MAJOR_VERSION/inspec/control.rb" -t "docker://mysql-server-$MAJOR_VERSION" --controls packages + docker stop "mysql-server-$MAJOR_VERSION" + docker rm "mysql-server-$MAJOR_VERSION" done From f1ce806cb3399d72a79b2e243c9be4848c0e1b16 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Mon, 26 Apr 2021 08:47:40 +0000 Subject: [PATCH 218/386] Release version 1.2.2-cluster * Use more specific name for testing containers * Bump image versions for fix release * Remove -1.noarch from config rpm urls --- mysql-cluster/7.5/Dockerfile | 2 +- mysql-cluster/7.5/docker-entrypoint.sh | 4 ++-- mysql-cluster/7.5/inspec/control.rb | 2 +- mysql-cluster/7.6/Dockerfile | 2 +- mysql-cluster/7.6/docker-entrypoint.sh | 4 ++-- mysql-cluster/7.6/inspec/control.rb | 2 +- mysql-cluster/8.0/docker-entrypoint.sh | 4 ++-- mysql-cluster/8.0/inspec/control.rb | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/mysql-cluster/7.5/Dockerfile b/mysql-cluster/7.5/Dockerfile index 64606d80f..92f5a77a2 100644 --- a/mysql-cluster/7.5/Dockerfile +++ b/mysql-cluster/7.5/Dockerfile @@ -20,7 +20,7 @@ ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.24 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el7.rpm \ - && rpm -U https://repo.mysql.com/mysql80-community-release-el7-1.noarch.rpm + && rpm -U https://repo.mysql.com/mysql80-community-release-el7.rpm # Install server and shell 8.0 RUN yum install -y $MYSQL_SHELL_PACKAGE \ diff --git a/mysql-cluster/7.5/docker-entrypoint.sh b/mysql-cluster/7.5/docker-entrypoint.sh index b09a77447..e7d23370c 100755 --- a/mysql-cluster/7.5/docker-entrypoint.sh +++ b/mysql-cluster/7.5/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 7.5.22-1.2.1-cluster" +echo "[Entrypoint] MySQL Docker Image 7.5.22-1.2.2-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -219,7 +219,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 7.5.22-1.2.1-cluster" + echo "[Entrypoint] Starting MySQL 7.5.22-1.2.2-cluster" fi else if [ -n "$MYSQL_INITIALIZE_ONLY" ]; then diff --git a/mysql-cluster/7.5/inspec/control.rb b/mysql-cluster/7.5/inspec/control.rb index 08fbba780..82fe9522f 100644 --- a/mysql-cluster/7.5/inspec/control.rb +++ b/mysql-cluster/7.5/inspec/control.rb @@ -1,6 +1,6 @@ control 'container' do impact 0.5 - describe docker_container('mysql-cluster') do + describe docker_container('mysql-cluster-7.5') do it { should exist } it { should be_running } its('repo') { should eq 'mysql/mysql-cluster' } diff --git a/mysql-cluster/7.6/Dockerfile b/mysql-cluster/7.6/Dockerfile index 4a0200467..8eac58b7e 100644 --- a/mysql-cluster/7.6/Dockerfile +++ b/mysql-cluster/7.6/Dockerfile @@ -20,7 +20,7 @@ ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.24 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el7.rpm \ - && rpm -U https://repo.mysql.com/mysql80-community-release-el7-1.noarch.rpm + && rpm -U https://repo.mysql.com/mysql80-community-release-el7.rpm # Install server and shell 8.0 RUN yum install -y $MYSQL_SHELL_PACKAGE \ diff --git a/mysql-cluster/7.6/docker-entrypoint.sh b/mysql-cluster/7.6/docker-entrypoint.sh index 9acc4fd65..4c7467212 100755 --- a/mysql-cluster/7.6/docker-entrypoint.sh +++ b/mysql-cluster/7.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 7.6.18-1.2.1-cluster" +echo "[Entrypoint] MySQL Docker Image 7.6.18-1.2.2-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -219,7 +219,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 7.6.18-1.2.1-cluster" + echo "[Entrypoint] Starting MySQL 7.6.18-1.2.2-cluster" fi else if [ -n "$MYSQL_INITIALIZE_ONLY" ]; then diff --git a/mysql-cluster/7.6/inspec/control.rb b/mysql-cluster/7.6/inspec/control.rb index 53a80a946..2148ffd0d 100644 --- a/mysql-cluster/7.6/inspec/control.rb +++ b/mysql-cluster/7.6/inspec/control.rb @@ -1,6 +1,6 @@ control 'container' do impact 0.5 - describe docker_container('mysql-cluster') do + describe docker_container('mysql-cluster-7.6') do it { should exist } it { should be_running } its('repo') { should eq 'mysql/mysql-cluster' } diff --git a/mysql-cluster/8.0/docker-entrypoint.sh b/mysql-cluster/8.0/docker-entrypoint.sh index 8c7324c03..5a37e6496 100755 --- a/mysql-cluster/8.0/docker-entrypoint.sh +++ b/mysql-cluster/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.24-1.2.1-cluster" +echo "[Entrypoint] MySQL Docker Image 8.0.24-1.2.2-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -219,7 +219,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.24-1.2.1-cluster" + echo "[Entrypoint] Starting MySQL 8.0.24-1.2.2-cluster" fi else if [ -n "$MYSQL_INITIALIZE_ONLY" ]; then diff --git a/mysql-cluster/8.0/inspec/control.rb b/mysql-cluster/8.0/inspec/control.rb index 56955a9b9..4c2863c30 100644 --- a/mysql-cluster/8.0/inspec/control.rb +++ b/mysql-cluster/8.0/inspec/control.rb @@ -1,6 +1,6 @@ control 'container' do impact 0.5 - describe docker_container('mysql-cluster') do + describe docker_container('mysql-cluster-8.0') do it { should exist } it { should be_running } its('repo') { should eq 'mysql/mysql-cluster' } From ed6ec06d91ee01670b3d4ae47a069183b56222f7 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Mon, 26 Apr 2021 09:38:37 +0000 Subject: [PATCH 219/386] Release version 1.2.2-server --- mysql-server/5.7/Dockerfile | 4 +-- mysql-server/5.7/docker-entrypoint.sh | 37 ++++++++++++--------------- mysql-server/5.7/inspec/control.rb | 4 +-- mysql-server/8.0/Dockerfile | 4 +-- mysql-server/8.0/docker-entrypoint.sh | 37 ++++++++++++--------------- mysql-server/8.0/inspec/control.rb | 4 +-- 6 files changed, 40 insertions(+), 50 deletions(-) diff --git a/mysql-server/5.7/Dockerfile b/mysql-server/5.7/Dockerfile index 54856b5c5..9b411833c 100644 --- a/mysql-server/5.7/Dockerfile +++ b/mysql-server/5.7/Dockerfile @@ -15,11 +15,11 @@ FROM oraclelinux:7-slim ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.34 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.23 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.24 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ - && rpm -U https://repo.mysql.com/mysql80-community-release-el7-1.noarch.rpm + && rpm -U https://repo.mysql.com/mysql80-community-release-el7.rpm # Install server and shell 8.0 RUN yum install -y $MYSQL_SHELL_PACKAGE \ diff --git a/mysql-server/5.7/docker-entrypoint.sh b/mysql-server/5.7/docker-entrypoint.sh index cccdec449..90819792a 100755 --- a/mysql-server/5.7/docker-entrypoint.sh +++ b/mysql-server/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.34-1.2.0" +echo "[Entrypoint] MySQL Docker Image 5.7.34-1.2.2-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -88,8 +88,8 @@ if [ "$1" = 'mysqld' ]; then echo '[Entrypoint] Initializing database' "$@" --user=$MYSQLD_USER --initialize-insecure - echo '[Entrypoint] Database initialized' + echo '[Entrypoint] Database initialized' "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" # To avoid using password on commandline, put it in a temporary file. @@ -100,19 +100,16 @@ if [ "$1" = 'mysqld' ]; then # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") - if [ ! -z "" ]; - then - for i in {30..0}; do - if mysqladmin --socket="$SOCKET" ping &>/dev/null; then - break - fi - echo '[Entrypoint] Waiting for server...' - sleep 1 - done - if [ "$i" = 0 ]; then - echo >&2 '[Entrypoint] Timeout during MySQL init.' - exit 1 + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 fi mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql @@ -215,13 +212,11 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 5.7.34-1.2.0" + echo "[Entrypoint] Starting MySQL 5.7.34-1.2.2-server" fi + # 4th value of /proc/$pid/stat is the ppid, same as getppid() + export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) + exec "$@" --user=$MYSQLD_USER else - if [ -n "$MYSQL_INITIALIZE_ONLY" ]; then - echo "[Entrypoint] MySQL already initialized and MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." - exit 0 - fi + exec "$@" fi - -exec "$@" --user=$MYSQLD_USER diff --git a/mysql-server/5.7/inspec/control.rb b/mysql-server/5.7/inspec/control.rb index 5acef6dd1..03dedf6c8 100644 --- a/mysql-server/5.7/inspec/control.rb +++ b/mysql-server/5.7/inspec/control.rb @@ -1,6 +1,6 @@ control 'container' do impact 0.5 - describe docker_container('mysql-server') do + describe docker_container('mysql-server-5.7') do it { should exist } it { should be_running } its('repo') { should eq 'mysql/mysql-server' } @@ -16,6 +16,6 @@ end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.23.*' } + its ('version') { should match '8.0.24.*' } end end diff --git a/mysql-server/8.0/Dockerfile b/mysql-server/8.0/Dockerfile index 056e5e54c..7545bb735 100644 --- a/mysql-server/8.0/Dockerfile +++ b/mysql-server/8.0/Dockerfile @@ -16,11 +16,11 @@ FROM oraclelinux:8-slim ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.24 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.23 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.24 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-community-minimal-release-el8.rpm \ - && rpm -U https://repo.mysql.com/mysql80-community-release-el8-1.noarch.rpm + && rpm -U https://repo.mysql.com/mysql80-community-release-el8.rpm # Install server and shell 8.0 RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ diff --git a/mysql-server/8.0/docker-entrypoint.sh b/mysql-server/8.0/docker-entrypoint.sh index cb05d6215..86cb0dd9d 100755 --- a/mysql-server/8.0/docker-entrypoint.sh +++ b/mysql-server/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.24-1.2.0" +echo "[Entrypoint] MySQL Docker Image 8.0.24-1.2.2-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -88,8 +88,8 @@ if [ "$1" = 'mysqld' ]; then echo '[Entrypoint] Initializing database' "$@" --user=$MYSQLD_USER --initialize-insecure - echo '[Entrypoint] Database initialized' + echo '[Entrypoint] Database initialized' "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" # To avoid using password on commandline, put it in a temporary file. @@ -100,19 +100,16 @@ if [ "$1" = 'mysqld' ]; then # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") - if [ ! -z "" ]; - then - for i in {30..0}; do - if mysqladmin --socket="$SOCKET" ping &>/dev/null; then - break - fi - echo '[Entrypoint] Waiting for server...' - sleep 1 - done - if [ "$i" = 0 ]; then - echo >&2 '[Entrypoint] Timeout during MySQL init.' - exit 1 + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 fi mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql @@ -215,13 +212,11 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.24-1.2.0" + echo "[Entrypoint] Starting MySQL 8.0.24-1.2.2-server" fi + # 4th value of /proc/$pid/stat is the ppid, same as getppid() + export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) + exec "$@" --user=$MYSQLD_USER else - if [ -n "$MYSQL_INITIALIZE_ONLY" ]; then - echo "[Entrypoint] MySQL already initialized and MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." - exit 0 - fi + exec "$@" fi - -export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) ; exec "$@" --user=$MYSQLD_USER diff --git a/mysql-server/8.0/inspec/control.rb b/mysql-server/8.0/inspec/control.rb index 161f08154..7e7a187d7 100644 --- a/mysql-server/8.0/inspec/control.rb +++ b/mysql-server/8.0/inspec/control.rb @@ -1,6 +1,6 @@ control 'container' do impact 0.5 - describe docker_container('mysql-server') do + describe docker_container('mysql-server-8.0') do it { should exist } it { should be_running } its('repo') { should eq 'mysql/mysql-server' } @@ -16,6 +16,6 @@ end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.23.*' } + its ('version') { should match '8.0.24.*' } end end From 79e088372a8b9d5b593573f57a50bd4a41529147 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Mon, 26 Apr 2021 12:03:47 +0000 Subject: [PATCH 220/386] Release version 1.0.2-router --- mysql-router/8.0/Dockerfile | 6 +++--- mysql-router/8.0/README.md | 2 ++ mysql-router/8.0/inspec/control.rb | 8 ++++++-- mysql-router/8.0/run.sh | 31 ++++++++++++++++-------------- 4 files changed, 28 insertions(+), 19 deletions(-) diff --git a/mysql-router/8.0/Dockerfile b/mysql-router/8.0/Dockerfile index 449ccd505..92a80f3a6 100644 --- a/mysql-router/8.0/Dockerfile +++ b/mysql-router/8.0/Dockerfile @@ -14,10 +14,10 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:8-slim -ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.23 -ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.23 +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.24 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.24 -RUN rpm -U http://repo.no.oracle.com/mysql-weekly/repos-stage/mysql80-community-release-el8-1.noarch.rpm \ +RUN rpm -U https://repo.mysql.com/mysql80-community-release-el8.rpm \ && microdnf install -y --disablerepo=ol8_appstream \ $MYSQL_CLIENT_PACKAGE $MYSQL_ROUTER_PACKAGE \ && microdnf clean all diff --git a/mysql-router/8.0/README.md b/mysql-router/8.0/README.md index 6b2f90cce..77a4c0237 100644 --- a/mysql-router/8.0/README.md +++ b/mysql-router/8.0/README.md @@ -74,4 +74,6 @@ For more information about the REST interface API, see: https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-rest-api-reference.html +For full usage documentation, see: +https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-installation-docker.html diff --git a/mysql-router/8.0/inspec/control.rb b/mysql-router/8.0/inspec/control.rb index e9b1f6a1e..8b49a4809 100644 --- a/mysql-router/8.0/inspec/control.rb +++ b/mysql-router/8.0/inspec/control.rb @@ -1,6 +1,6 @@ control 'container' do impact 0.5 - describe docker_container('mysql-router') do + describe docker_container('mysql-router-8.0') do it { should exist } it { should be_running } its('repo') { should eq 'mysql/mysql-router' } @@ -10,8 +10,12 @@ end control 'packages' do impact 0.5 + describe package('mysql-community-client') do + it { should be_installed } + its ('version') { should match '8.0.24.*' } + end describe package('mysql-router-community') do it { should be_installed } - its ('version') { should match '8.0.23.*' } + its ('version') { should match '8.0.24.*' } end end diff --git a/mysql-router/8.0/run.sh b/mysql-router/8.0/run.sh index e73f3cc7b..9d1e78bfb 100755 --- a/mysql-router/8.0/run.sh +++ b/mysql-router/8.0/run.sh @@ -26,18 +26,20 @@ if [ "$1" = 'mysqlrouter' ]; then exit 1 fi + PASSFILE=$(mktemp) + echo "$MYSQL_PASSWORD" > "$PASSFILE" if [ -z $MYSQL_CREATE_ROUTER_USER ]; then + echo "$MYSQL_PASSWORD" >> "$PASSFILE" MYSQL_CREATE_ROUTER_USER=1 echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is not set, Router will generate a new account to be used at runtime." echo "[Entrypoint] Set it to 0 to reuse $MYSQL_USER instead." elif [ "$MYSQL_CREATE_ROUTER_USER" = "0" ]; then + echo "$MYSQL_PASSWORD" >> "$PASSFILE" echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is 0, Router will reuse $MYSQL_USER account at runtime" else echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is not 0, Router will generate a new account to be used at runtime" fi - PASSFILE=$(mktemp) - echo "$MYSQL_PASSWORD" > "$PASSFILE" DEFAULTS_EXTRA_FILE=$(mktemp) cat >"$DEFAULTS_EXTRA_FILE" < /dev/null)" ]]; then - echo "[Entrypoint] ERROR: Can not connect to database. Exiting." - exit 1 + echo "[Entrypoint] ERROR: Can not connect to database. Exiting." + exit 1 fi if [[ -n $MYSQL_INNODB_CLUSTER_MEMBERS ]]; then attempt_num=0 @@ -71,23 +73,24 @@ EOF done echo "[Entrypoint] Successfully contacted cluster with $MYSQL_INNODB_CLUSTER_MEMBERS members. Bootstrapping." fi - echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap." + if [ $(id -u) = "0" ]; then + opt_user=--user=mysqlrouter + fi if [ "$MYSQL_CREATE_ROUTER_USER" = "0" ]; then echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap reusing account \"$MYSQL_USER\"." - mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force --account-create=never --account=$MYSQL_USER < "$PASSFILE" + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force --account-create=never --account=$MYSQL_USER $opt_user < "$PASSFILE" || exit 1 else echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap." - mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force < "$PASSFILE" + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force $opt_user < "$PASSFILE" || exit 1 fi sed -i -e 's/logging_folder=.*$/logging_folder=/' /tmp/mysqlrouter/mysqlrouter.conf echo "[Entrypoint] Starting mysql-router." exec "$@" --config /tmp/mysqlrouter/mysqlrouter.conf -fi - -rm -f "$PASSFILE" -rm -f "$DEFAULTS_EXTRA_FILE" -unset DEFAULTS_EXTRA_FILE - -exec "$@" + rm -f "$PASSFILE" + rm -f "$DEFAULTS_EXTRA_FILE" + unset DEFAULTS_EXTRA_FILE +else + exec "$@" +fi From 82e21f03ee56fe9ec21bb803a3ae56c6ec0d05b7 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Wed, 28 Apr 2021 09:18:06 +0200 Subject: [PATCH 221/386] Bump versions for 8.0.25 release Change-Id: Id796fe40afd387271d0b3863ea38986d7e878c6f --- mysql-cluster/VERSION | 10 +++++----- mysql-router/VERSION | 6 +++--- mysql-server/VERSION | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/mysql-cluster/VERSION b/mysql-cluster/VERSION index 796e7d29f..aa2849904 100644 --- a/mysql-cluster/VERSION +++ b/mysql-cluster/VERSION @@ -1,14 +1,14 @@ -IMAGE_VERSION=1.2.2-cluster +IMAGE_VERSION=1.2.3-cluster declare -A MYSQL_CLUSTER_VERSIONS MYSQL_CLUSTER_VERSIONS["7.5"]=7.5.22 MYSQL_CLUSTER_VERSIONS["7.6"]=7.6.18 -MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.24 +MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.25 declare -A MYSQL_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["7.5"]=8.0.24 -MYSQL_SHELL_VERSIONS["7.6"]=8.0.24 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.24 +MYSQL_SHELL_VERSIONS["7.5"]=8.0.25 +MYSQL_SHELL_VERSIONS["7.6"]=8.0.25 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.25 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["7.5"]="${MYSQL_CLUSTER_VERSIONS["7.5"]}-${IMAGE_VERSION}" diff --git a/mysql-router/VERSION b/mysql-router/VERSION index 1f5db3ac6..b621de33d 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -1,8 +1,8 @@ -IMAGE_VERSION=1.0.2-router +IMAGE_VERSION=1.0.3-router declare -A MYSQL_ROUTER_VERSIONS -MYSQL_ROUTER_VERSIONS["8.0"]=8.0.24 +MYSQL_ROUTER_VERSIONS["8.0"]=8.0.25 declare -A MYSQL_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["8.0"]=8.0.24 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.25 declare -A FULL_ROUTER_VERSIONS FULL_ROUTER_VERSIONS["8.0"]="${MYSQL_ROUTER_VERSIONS["8.0"]}-${IMAGE_VERSION}" diff --git a/mysql-server/VERSION b/mysql-server/VERSION index f9319db53..21ff60842 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,12 +1,12 @@ -IMAGE_VERSION=1.2.2-server +IMAGE_VERSION=1.2.3-server declare -A MYSQL_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["5.7"]=5.7.34 -MYSQL_SERVER_VERSIONS["8.0"]=8.0.24 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.25 declare -A MYSQL_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["5.7"]=8.0.24 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.24 +MYSQL_SHELL_VERSIONS["5.7"]=8.0.25 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.25 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["5.7"]="${MYSQL_SERVER_VERSIONS["5.7"]}-${IMAGE_VERSION}" From 8bc19a4a29365aed016d93069104a0c39647a410 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Fri, 7 May 2021 13:14:59 +0200 Subject: [PATCH 222/386] Fix --user flag always appended to all commands in cluster image For 8.0, the entrypoint would always set the --user flag for the command. This is only meant for the mysqld process, and would break any commands not supporting this flag, such as most of the ndb commands, attempts to open a bash shell for debugging, etc. Change-Id: Ibb7550b1071184e55c292a342449d6a0bfe35fac --- mysql-cluster/template/docker-entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mysql-cluster/template/docker-entrypoint.sh b/mysql-cluster/template/docker-entrypoint.sh index a18c9dfdd..bd39afee8 100644 --- a/mysql-cluster/template/docker-entrypoint.sh +++ b/mysql-cluster/template/docker-entrypoint.sh @@ -221,6 +221,7 @@ EOF else echo "[Entrypoint] Starting MySQL %%FULL_SERVER_VERSION%%" fi + %%STARTUP%% else if [ -n "$MYSQL_INITIALIZE_ONLY" ]; then echo "[Entrypoint] MySQL already initialized and MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." @@ -250,6 +251,6 @@ else exit 1 fi fi + exec "$@" fi -%%STARTUP%% From 160e39a64890e42341bc1fb65a0c28e8e73a45cb Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 11 May 2021 09:56:01 +0200 Subject: [PATCH 223/386] Remove unused TZINFO subsitution variable from cluster template This causes a startup error for the container Change-Id: Ie01fa0353cc5d07dea8b68ca30fc688ed85e2d19 --- mysql-cluster/template/docker-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-cluster/template/docker-entrypoint.sh b/mysql-cluster/template/docker-entrypoint.sh index bd39afee8..8c0259c38 100644 --- a/mysql-cluster/template/docker-entrypoint.sh +++ b/mysql-cluster/template/docker-entrypoint.sh @@ -115,7 +115,7 @@ if [ "$1" = 'mysqld' ]; then fi fi - mysql_tzinfo_to_sql /usr/share/zoneinfo | %%SED_TZINFO%%"${mysql[@]}" mysql + mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then MYSQL_ROOT_PASSWORD="$(_mkpw)" From 34a0a60bd13eae71646068a8ee854d71a9958b71 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 12 May 2021 06:59:45 +0000 Subject: [PATCH 224/386] Release version 1.2.3-cluster --- mysql-cluster/7.5/Dockerfile | 2 +- mysql-cluster/7.5/docker-entrypoint.sh | 9 +++++---- mysql-cluster/7.5/inspec/control.rb | 2 +- mysql-cluster/7.6/Dockerfile | 2 +- mysql-cluster/7.6/docker-entrypoint.sh | 9 +++++---- mysql-cluster/7.6/inspec/control.rb | 2 +- mysql-cluster/8.0/Dockerfile | 4 ++-- mysql-cluster/8.0/docker-entrypoint.sh | 9 +++++---- mysql-cluster/8.0/inspec/control.rb | 4 ++-- 9 files changed, 23 insertions(+), 20 deletions(-) diff --git a/mysql-cluster/7.5/Dockerfile b/mysql-cluster/7.5/Dockerfile index 92f5a77a2..20df0de42 100644 --- a/mysql-cluster/7.5/Dockerfile +++ b/mysql-cluster/7.5/Dockerfile @@ -16,7 +16,7 @@ FROM oraclelinux:7-slim ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.5.22 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.24 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.25 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el7.rpm \ diff --git a/mysql-cluster/7.5/docker-entrypoint.sh b/mysql-cluster/7.5/docker-entrypoint.sh index e7d23370c..1670ca4ec 100755 --- a/mysql-cluster/7.5/docker-entrypoint.sh +++ b/mysql-cluster/7.5/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 7.5.22-1.2.2-cluster" +echo "[Entrypoint] MySQL Docker Image 7.5.22-1.2.3-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -115,7 +115,7 @@ if [ "$1" = 'mysqld' ]; then fi fi - mysql_tzinfo_to_sql /usr/share/zoneinfo | %%SED_TZINFO%%"${mysql[@]}" mysql + mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then MYSQL_ROOT_PASSWORD="$(_mkpw)" @@ -219,8 +219,9 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 7.5.22-1.2.2-cluster" + echo "[Entrypoint] Starting MySQL 7.5.22-1.2.3-cluster" fi + exec "$@" --user=$MYSQLD_USER else if [ -n "$MYSQL_INITIALIZE_ONLY" ]; then echo "[Entrypoint] MySQL already initialized and MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." @@ -250,6 +251,6 @@ else exit 1 fi fi + exec "$@" fi -exec "$@" --user=$MYSQLD_USER diff --git a/mysql-cluster/7.5/inspec/control.rb b/mysql-cluster/7.5/inspec/control.rb index 82fe9522f..13880ec3d 100644 --- a/mysql-cluster/7.5/inspec/control.rb +++ b/mysql-cluster/7.5/inspec/control.rb @@ -16,6 +16,6 @@ end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.24.*' } + its ('version') { should match '8.0.25.*' } end end diff --git a/mysql-cluster/7.6/Dockerfile b/mysql-cluster/7.6/Dockerfile index 8eac58b7e..f4d7fff82 100644 --- a/mysql-cluster/7.6/Dockerfile +++ b/mysql-cluster/7.6/Dockerfile @@ -16,7 +16,7 @@ FROM oraclelinux:7-slim ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.6.18 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.24 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.25 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el7.rpm \ diff --git a/mysql-cluster/7.6/docker-entrypoint.sh b/mysql-cluster/7.6/docker-entrypoint.sh index 4c7467212..3d874049d 100755 --- a/mysql-cluster/7.6/docker-entrypoint.sh +++ b/mysql-cluster/7.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 7.6.18-1.2.2-cluster" +echo "[Entrypoint] MySQL Docker Image 7.6.18-1.2.3-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -115,7 +115,7 @@ if [ "$1" = 'mysqld' ]; then fi fi - mysql_tzinfo_to_sql /usr/share/zoneinfo | %%SED_TZINFO%%"${mysql[@]}" mysql + mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then MYSQL_ROOT_PASSWORD="$(_mkpw)" @@ -219,8 +219,9 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 7.6.18-1.2.2-cluster" + echo "[Entrypoint] Starting MySQL 7.6.18-1.2.3-cluster" fi + exec "$@" --user=$MYSQLD_USER else if [ -n "$MYSQL_INITIALIZE_ONLY" ]; then echo "[Entrypoint] MySQL already initialized and MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." @@ -250,6 +251,6 @@ else exit 1 fi fi + exec "$@" fi -exec "$@" --user=$MYSQLD_USER diff --git a/mysql-cluster/7.6/inspec/control.rb b/mysql-cluster/7.6/inspec/control.rb index 2148ffd0d..aeca6840d 100644 --- a/mysql-cluster/7.6/inspec/control.rb +++ b/mysql-cluster/7.6/inspec/control.rb @@ -16,6 +16,6 @@ end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.24.*' } + its ('version') { should match '8.0.25.*' } end end diff --git a/mysql-cluster/8.0/Dockerfile b/mysql-cluster/8.0/Dockerfile index 87beddb8e..e645817ed 100644 --- a/mysql-cluster/8.0/Dockerfile +++ b/mysql-cluster/8.0/Dockerfile @@ -15,8 +15,8 @@ FROM oraclelinux:8-slim -ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-8.0.24 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.24 +ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-8.0.25 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.25 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el8.rpm \ diff --git a/mysql-cluster/8.0/docker-entrypoint.sh b/mysql-cluster/8.0/docker-entrypoint.sh index 5a37e6496..98a6e674b 100755 --- a/mysql-cluster/8.0/docker-entrypoint.sh +++ b/mysql-cluster/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.24-1.2.2-cluster" +echo "[Entrypoint] MySQL Docker Image 8.0.25-1.2.3-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -115,7 +115,7 @@ if [ "$1" = 'mysqld' ]; then fi fi - mysql_tzinfo_to_sql /usr/share/zoneinfo | %%SED_TZINFO%%"${mysql[@]}" mysql + mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then MYSQL_ROOT_PASSWORD="$(_mkpw)" @@ -219,8 +219,9 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.24-1.2.2-cluster" + echo "[Entrypoint] Starting MySQL 8.0.25-1.2.3-cluster" fi + export MYSQLD_PARENT_PID=$$ ; exec "$@" --user= else if [ -n "$MYSQL_INITIALIZE_ONLY" ]; then echo "[Entrypoint] MySQL already initialized and MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." @@ -250,6 +251,6 @@ else exit 1 fi fi + exec "$@" fi -export MYSQLD_PARENT_PID=$$ ; exec "$@" --user= diff --git a/mysql-cluster/8.0/inspec/control.rb b/mysql-cluster/8.0/inspec/control.rb index 4c2863c30..cf57b0950 100644 --- a/mysql-cluster/8.0/inspec/control.rb +++ b/mysql-cluster/8.0/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.24.*' } + its ('version') { should match '8.0.25.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.24.*' } + its ('version') { should match '8.0.25.*' } end end From 3beb5f74a03db34961f6a0d006af42e8c0729d27 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 12 May 2021 07:21:59 +0000 Subject: [PATCH 225/386] Release version 1.2.3-server --- mysql-server/5.7/Dockerfile | 2 +- mysql-server/5.7/docker-entrypoint.sh | 4 ++-- mysql-server/5.7/inspec/control.rb | 2 +- mysql-server/8.0/Dockerfile | 4 ++-- mysql-server/8.0/docker-entrypoint.sh | 4 ++-- mysql-server/8.0/inspec/control.rb | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/mysql-server/5.7/Dockerfile b/mysql-server/5.7/Dockerfile index 9b411833c..3c12695c4 100644 --- a/mysql-server/5.7/Dockerfile +++ b/mysql-server/5.7/Dockerfile @@ -15,7 +15,7 @@ FROM oraclelinux:7-slim ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.34 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.24 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.25 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ diff --git a/mysql-server/5.7/docker-entrypoint.sh b/mysql-server/5.7/docker-entrypoint.sh index 90819792a..856420a60 100755 --- a/mysql-server/5.7/docker-entrypoint.sh +++ b/mysql-server/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.34-1.2.2-server" +echo "[Entrypoint] MySQL Docker Image 5.7.34-1.2.3-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -212,7 +212,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 5.7.34-1.2.2-server" + echo "[Entrypoint] Starting MySQL 5.7.34-1.2.3-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/5.7/inspec/control.rb b/mysql-server/5.7/inspec/control.rb index 03dedf6c8..78b19cee9 100644 --- a/mysql-server/5.7/inspec/control.rb +++ b/mysql-server/5.7/inspec/control.rb @@ -16,6 +16,6 @@ end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.24.*' } + its ('version') { should match '8.0.25.*' } end end diff --git a/mysql-server/8.0/Dockerfile b/mysql-server/8.0/Dockerfile index 7545bb735..dbc541220 100644 --- a/mysql-server/8.0/Dockerfile +++ b/mysql-server/8.0/Dockerfile @@ -15,8 +15,8 @@ FROM oraclelinux:8-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.24 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.24 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.25 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.25 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-community-minimal-release-el8.rpm \ diff --git a/mysql-server/8.0/docker-entrypoint.sh b/mysql-server/8.0/docker-entrypoint.sh index 86cb0dd9d..6192ab419 100755 --- a/mysql-server/8.0/docker-entrypoint.sh +++ b/mysql-server/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.24-1.2.2-server" +echo "[Entrypoint] MySQL Docker Image 8.0.25-1.2.3-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -212,7 +212,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.24-1.2.2-server" + echo "[Entrypoint] Starting MySQL 8.0.25-1.2.3-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/8.0/inspec/control.rb b/mysql-server/8.0/inspec/control.rb index 7e7a187d7..5fba6bf0f 100644 --- a/mysql-server/8.0/inspec/control.rb +++ b/mysql-server/8.0/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.24.*' } + its ('version') { should match '8.0.25.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.24.*' } + its ('version') { should match '8.0.25.*' } end end From e4da2922ad3c6f77fcd28007a6b98f31c6ee0b47 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 12 May 2021 08:22:01 +0000 Subject: [PATCH 226/386] Release version 1.0.3-router --- mysql-router/8.0/Dockerfile | 4 ++-- mysql-router/8.0/inspec/control.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-router/8.0/Dockerfile b/mysql-router/8.0/Dockerfile index 92a80f3a6..fc8bda8b0 100644 --- a/mysql-router/8.0/Dockerfile +++ b/mysql-router/8.0/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:8-slim -ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.24 -ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.24 +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.25 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.25 RUN rpm -U https://repo.mysql.com/mysql80-community-release-el8.rpm \ && microdnf install -y --disablerepo=ol8_appstream \ diff --git a/mysql-router/8.0/inspec/control.rb b/mysql-router/8.0/inspec/control.rb index 8b49a4809..300344f0f 100644 --- a/mysql-router/8.0/inspec/control.rb +++ b/mysql-router/8.0/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-community-client') do it { should be_installed } - its ('version') { should match '8.0.24.*' } + its ('version') { should match '8.0.25.*' } end describe package('mysql-router-community') do it { should be_installed } - its ('version') { should match '8.0.24.*' } + its ('version') { should match '8.0.25.*' } end end From ce5d5fa2a8d97311a113c68f7e898eca576cb229 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Wed, 9 Jun 2021 10:40:09 +0200 Subject: [PATCH 227/386] Bump versions for 8.0.26 release Change-Id: Ibff02b06b6898748a32d1a29f1e37564f5960e1a --- mysql-cluster/VERSION | 14 +++++++------- mysql-router/VERSION | 6 +++--- mysql-server/VERSION | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/mysql-cluster/VERSION b/mysql-cluster/VERSION index aa2849904..b2ec39399 100644 --- a/mysql-cluster/VERSION +++ b/mysql-cluster/VERSION @@ -1,14 +1,14 @@ -IMAGE_VERSION=1.2.3-cluster +IMAGE_VERSION=1.2.4-cluster declare -A MYSQL_CLUSTER_VERSIONS -MYSQL_CLUSTER_VERSIONS["7.5"]=7.5.22 -MYSQL_CLUSTER_VERSIONS["7.6"]=7.6.18 -MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.25 +MYSQL_CLUSTER_VERSIONS["7.5"]=7.5.23 +MYSQL_CLUSTER_VERSIONS["7.6"]=7.6.19 +MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.26 declare -A MYSQL_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["7.5"]=8.0.25 -MYSQL_SHELL_VERSIONS["7.6"]=8.0.25 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.25 +MYSQL_SHELL_VERSIONS["7.5"]=8.0.26 +MYSQL_SHELL_VERSIONS["7.6"]=8.0.26 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.26 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["7.5"]="${MYSQL_CLUSTER_VERSIONS["7.5"]}-${IMAGE_VERSION}" diff --git a/mysql-router/VERSION b/mysql-router/VERSION index b621de33d..b06e5539f 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -1,8 +1,8 @@ -IMAGE_VERSION=1.0.3-router +IMAGE_VERSION=1.0.4-router declare -A MYSQL_ROUTER_VERSIONS -MYSQL_ROUTER_VERSIONS["8.0"]=8.0.25 +MYSQL_ROUTER_VERSIONS["8.0"]=8.0.26 declare -A MYSQL_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["8.0"]=8.0.25 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.26 declare -A FULL_ROUTER_VERSIONS FULL_ROUTER_VERSIONS["8.0"]="${MYSQL_ROUTER_VERSIONS["8.0"]}-${IMAGE_VERSION}" diff --git a/mysql-server/VERSION b/mysql-server/VERSION index 21ff60842..581595a82 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,12 +1,12 @@ -IMAGE_VERSION=1.2.3-server +IMAGE_VERSION=1.2.4-server declare -A MYSQL_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["5.7"]=5.7.34 -MYSQL_SERVER_VERSIONS["8.0"]=8.0.25 +MYSQL_SERVER_VERSIONS["5.7"]=5.7.35 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.26 declare -A MYSQL_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["5.7"]=8.0.25 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.25 +MYSQL_SHELL_VERSIONS["5.7"]=8.0.26 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.26 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["5.7"]="${MYSQL_SERVER_VERSIONS["5.7"]}-${IMAGE_VERSION}" From f7944b93cb665de57a3ac6c9ee921532b1d7c5f2 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Tue, 20 Jul 2021 12:53:14 +0000 Subject: [PATCH 228/386] Release version 1.2.4-cluster * Bump versions for 8.0.26 release --- mysql-cluster/7.5/Dockerfile | 4 ++-- mysql-cluster/7.5/docker-entrypoint.sh | 4 ++-- mysql-cluster/7.5/inspec/control.rb | 4 ++-- mysql-cluster/7.6/Dockerfile | 4 ++-- mysql-cluster/7.6/docker-entrypoint.sh | 4 ++-- mysql-cluster/7.6/inspec/control.rb | 4 ++-- mysql-cluster/8.0/Dockerfile | 4 ++-- mysql-cluster/8.0/docker-entrypoint.sh | 4 ++-- mysql-cluster/8.0/inspec/control.rb | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/mysql-cluster/7.5/Dockerfile b/mysql-cluster/7.5/Dockerfile index 20df0de42..34e1abce1 100644 --- a/mysql-cluster/7.5/Dockerfile +++ b/mysql-cluster/7.5/Dockerfile @@ -15,8 +15,8 @@ FROM oraclelinux:7-slim -ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.5.22 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.25 +ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.5.23 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.26 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el7.rpm \ diff --git a/mysql-cluster/7.5/docker-entrypoint.sh b/mysql-cluster/7.5/docker-entrypoint.sh index 1670ca4ec..5b9270611 100755 --- a/mysql-cluster/7.5/docker-entrypoint.sh +++ b/mysql-cluster/7.5/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 7.5.22-1.2.3-cluster" +echo "[Entrypoint] MySQL Docker Image 7.5.23-1.2.4-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -219,7 +219,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 7.5.22-1.2.3-cluster" + echo "[Entrypoint] Starting MySQL 7.5.23-1.2.4-cluster" fi exec "$@" --user=$MYSQLD_USER else diff --git a/mysql-cluster/7.5/inspec/control.rb b/mysql-cluster/7.5/inspec/control.rb index 13880ec3d..6f7721408 100644 --- a/mysql-cluster/7.5/inspec/control.rb +++ b/mysql-cluster/7.5/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '7.5.22.*' } + its ('version') { should match '7.5.23.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.25.*' } + its ('version') { should match '8.0.26.*' } end end diff --git a/mysql-cluster/7.6/Dockerfile b/mysql-cluster/7.6/Dockerfile index f4d7fff82..ed269c156 100644 --- a/mysql-cluster/7.6/Dockerfile +++ b/mysql-cluster/7.6/Dockerfile @@ -15,8 +15,8 @@ FROM oraclelinux:7-slim -ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.6.18 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.25 +ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.6.19 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.26 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el7.rpm \ diff --git a/mysql-cluster/7.6/docker-entrypoint.sh b/mysql-cluster/7.6/docker-entrypoint.sh index 3d874049d..994b1d5fb 100755 --- a/mysql-cluster/7.6/docker-entrypoint.sh +++ b/mysql-cluster/7.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 7.6.18-1.2.3-cluster" +echo "[Entrypoint] MySQL Docker Image 7.6.19-1.2.4-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -219,7 +219,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 7.6.18-1.2.3-cluster" + echo "[Entrypoint] Starting MySQL 7.6.19-1.2.4-cluster" fi exec "$@" --user=$MYSQLD_USER else diff --git a/mysql-cluster/7.6/inspec/control.rb b/mysql-cluster/7.6/inspec/control.rb index aeca6840d..a2b910d51 100644 --- a/mysql-cluster/7.6/inspec/control.rb +++ b/mysql-cluster/7.6/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '7.6.18.*' } + its ('version') { should match '7.6.19.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.25.*' } + its ('version') { should match '8.0.26.*' } end end diff --git a/mysql-cluster/8.0/Dockerfile b/mysql-cluster/8.0/Dockerfile index e645817ed..c919c820f 100644 --- a/mysql-cluster/8.0/Dockerfile +++ b/mysql-cluster/8.0/Dockerfile @@ -15,8 +15,8 @@ FROM oraclelinux:8-slim -ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-8.0.25 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.25 +ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-8.0.26 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.26 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el8.rpm \ diff --git a/mysql-cluster/8.0/docker-entrypoint.sh b/mysql-cluster/8.0/docker-entrypoint.sh index 98a6e674b..7401f397c 100755 --- a/mysql-cluster/8.0/docker-entrypoint.sh +++ b/mysql-cluster/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.25-1.2.3-cluster" +echo "[Entrypoint] MySQL Docker Image 8.0.26-1.2.4-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -219,7 +219,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.25-1.2.3-cluster" + echo "[Entrypoint] Starting MySQL 8.0.26-1.2.4-cluster" fi export MYSQLD_PARENT_PID=$$ ; exec "$@" --user= else diff --git a/mysql-cluster/8.0/inspec/control.rb b/mysql-cluster/8.0/inspec/control.rb index cf57b0950..7f261198b 100644 --- a/mysql-cluster/8.0/inspec/control.rb +++ b/mysql-cluster/8.0/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.25.*' } + its ('version') { should match '8.0.26.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.25.*' } + its ('version') { should match '8.0.26.*' } end end From cf75d8ba6ad4a80a23bc1e43535f8a7f020b908e Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Tue, 20 Jul 2021 14:17:10 +0000 Subject: [PATCH 229/386] Release version 1.2.4-server * Bump versions for 8.0.26 release --- mysql-server/5.7/Dockerfile | 4 ++-- mysql-server/5.7/docker-entrypoint.sh | 4 ++-- mysql-server/5.7/inspec/control.rb | 4 ++-- mysql-server/8.0/Dockerfile | 4 ++-- mysql-server/8.0/docker-entrypoint.sh | 4 ++-- mysql-server/8.0/inspec/control.rb | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/mysql-server/5.7/Dockerfile b/mysql-server/5.7/Dockerfile index 3c12695c4..0f5a0b103 100644 --- a/mysql-server/5.7/Dockerfile +++ b/mysql-server/5.7/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.34 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.25 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.35 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.26 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ diff --git a/mysql-server/5.7/docker-entrypoint.sh b/mysql-server/5.7/docker-entrypoint.sh index 856420a60..b8df1e916 100755 --- a/mysql-server/5.7/docker-entrypoint.sh +++ b/mysql-server/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.34-1.2.3-server" +echo "[Entrypoint] MySQL Docker Image 5.7.35-1.2.4-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -212,7 +212,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 5.7.34-1.2.3-server" + echo "[Entrypoint] Starting MySQL 5.7.35-1.2.4-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/5.7/inspec/control.rb b/mysql-server/5.7/inspec/control.rb index 78b19cee9..7116147a0 100644 --- a/mysql-server/5.7/inspec/control.rb +++ b/mysql-server/5.7/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '5.7.34.*' } + its ('version') { should match '5.7.35.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.25.*' } + its ('version') { should match '8.0.26.*' } end end diff --git a/mysql-server/8.0/Dockerfile b/mysql-server/8.0/Dockerfile index dbc541220..5250b7671 100644 --- a/mysql-server/8.0/Dockerfile +++ b/mysql-server/8.0/Dockerfile @@ -15,8 +15,8 @@ FROM oraclelinux:8-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.25 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.25 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.26 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.26 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-community-minimal-release-el8.rpm \ diff --git a/mysql-server/8.0/docker-entrypoint.sh b/mysql-server/8.0/docker-entrypoint.sh index 6192ab419..3287b151e 100755 --- a/mysql-server/8.0/docker-entrypoint.sh +++ b/mysql-server/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.25-1.2.3-server" +echo "[Entrypoint] MySQL Docker Image 8.0.26-1.2.4-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -212,7 +212,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.25-1.2.3-server" + echo "[Entrypoint] Starting MySQL 8.0.26-1.2.4-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/8.0/inspec/control.rb b/mysql-server/8.0/inspec/control.rb index 5fba6bf0f..8be0bfba7 100644 --- a/mysql-server/8.0/inspec/control.rb +++ b/mysql-server/8.0/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.25.*' } + its ('version') { should match '8.0.26.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.25.*' } + its ('version') { should match '8.0.26.*' } end end From 824a9b857ed208d441fe690c4d0ffe35e4e3baad Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Tue, 20 Jul 2021 14:22:55 +0000 Subject: [PATCH 230/386] Release version 1.0.4-router * Bump versions for 8.0.26 release --- mysql-router/8.0/Dockerfile | 4 ++-- mysql-router/8.0/inspec/control.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-router/8.0/Dockerfile b/mysql-router/8.0/Dockerfile index fc8bda8b0..b68befe79 100644 --- a/mysql-router/8.0/Dockerfile +++ b/mysql-router/8.0/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:8-slim -ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.25 -ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.25 +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.26 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.26 RUN rpm -U https://repo.mysql.com/mysql80-community-release-el8.rpm \ && microdnf install -y --disablerepo=ol8_appstream \ diff --git a/mysql-router/8.0/inspec/control.rb b/mysql-router/8.0/inspec/control.rb index 300344f0f..6ab824dbb 100644 --- a/mysql-router/8.0/inspec/control.rb +++ b/mysql-router/8.0/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-community-client') do it { should be_installed } - its ('version') { should match '8.0.25.*' } + its ('version') { should match '8.0.26.*' } end describe package('mysql-router-community') do it { should be_installed } - its ('version') { should match '8.0.25.*' } + its ('version') { should match '8.0.26.*' } end end From 885e79dd63c839acd8020dfe9ae697210778c258 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Schl=C3=BCter?= Date: Thu, 1 Jul 2021 12:41:25 +0200 Subject: [PATCH 231/386] WL#14703 Ignore timezone during initialization of Docker container Change-Id: I49539d50728053e3e45cb79af77840ce8ba417f3 --- mysql-server/5.7/docker-entrypoint.sh | 12 ++++++++++-- mysql-server/8.0/docker-entrypoint.sh | 12 ++++++++++-- mysql-server/template/docker-entrypoint.sh | 12 ++++++++++-- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/mysql-server/5.7/docker-entrypoint.sh b/mysql-server/5.7/docker-entrypoint.sh index b8df1e916..664774cd0 100755 --- a/mysql-server/5.7/docker-entrypoint.sh +++ b/mysql-server/5.7/docker-entrypoint.sh @@ -86,11 +86,19 @@ if [ "$1" = 'mysqld' ]; then chown mysql:mysql "$DATADIR" fi + # The user can set a default_timezone either in a my.cnf file + # they mount into the container or on command line + # (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`) + # however the timezone tables will only be populated in a later + # stage of this script. By using +00:00 as timezone we override + # the user's choice during initialization. Later the server + # will be restarted using the user's option. + echo '[Entrypoint] Initializing database' - "$@" --user=$MYSQLD_USER --initialize-insecure + "$@" --user=$MYSQLD_USER --initialize-insecure --default-time-zone=+00:00 echo '[Entrypoint] Database initialized' - "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" --default-time-zone=+00:00 # To avoid using password on commandline, put it in a temporary file. # The file is only populated when and if the root password is set. diff --git a/mysql-server/8.0/docker-entrypoint.sh b/mysql-server/8.0/docker-entrypoint.sh index 3287b151e..8ebd1eb2d 100755 --- a/mysql-server/8.0/docker-entrypoint.sh +++ b/mysql-server/8.0/docker-entrypoint.sh @@ -86,11 +86,19 @@ if [ "$1" = 'mysqld' ]; then chown mysql:mysql "$DATADIR" fi + # The user can set a default_timezone either in a my.cnf file + # they mount into the container or on command line + # (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`) + # however the timezone tables will only be populated in a later + # stage of this script. By using +00:00 as timezone we override + # the user's choice during initialization. Later the server + # will be restarted using the user's option. + echo '[Entrypoint] Initializing database' - "$@" --user=$MYSQLD_USER --initialize-insecure + "$@" --user=$MYSQLD_USER --initialize-insecure --default-time-zone=+00:00 echo '[Entrypoint] Database initialized' - "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" --default-time-zone=+00:00 # To avoid using password on commandline, put it in a temporary file. # The file is only populated when and if the root password is set. diff --git a/mysql-server/template/docker-entrypoint.sh b/mysql-server/template/docker-entrypoint.sh index d0530b904..6052c591a 100644 --- a/mysql-server/template/docker-entrypoint.sh +++ b/mysql-server/template/docker-entrypoint.sh @@ -86,11 +86,19 @@ if [ "$1" = 'mysqld' ]; then chown mysql:mysql "$DATADIR" fi + # The user can set a default_timezone either in a my.cnf file + # they mount into the container or on command line + # (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`) + # however the timezone tables will only be populated in a later + # stage of this script. By using +00:00 as timezone we override + # the user's choice during initialization. Later the server + # will be restarted using the user's option. + echo '[Entrypoint] Initializing database' - "$@" --user=$MYSQLD_USER --initialize-insecure + "$@" --user=$MYSQLD_USER --initialize-insecure --default-time-zone=+00:00 echo '[Entrypoint] Database initialized' - "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" --default-time-zone=+00:00 # To avoid using password on commandline, put it in a temporary file. # The file is only populated when and if the root password is set. From 5e13a4cffd854169671b182d002cec9c49a5ecb6 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Wed, 8 Sep 2021 09:44:17 +0200 Subject: [PATCH 232/386] Bump versions for 8.0.27 release cycle Change-Id: I0c858c396d51ce04ad9d8c1c16c325a922d1057c --- mysql-cluster/VERSION | 14 +++++++------- mysql-router/VERSION | 6 +++--- mysql-server/VERSION | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/mysql-cluster/VERSION b/mysql-cluster/VERSION index b2ec39399..8a5fa0ef0 100644 --- a/mysql-cluster/VERSION +++ b/mysql-cluster/VERSION @@ -1,14 +1,14 @@ -IMAGE_VERSION=1.2.4-cluster +IMAGE_VERSION=1.2.5-cluster declare -A MYSQL_CLUSTER_VERSIONS -MYSQL_CLUSTER_VERSIONS["7.5"]=7.5.23 -MYSQL_CLUSTER_VERSIONS["7.6"]=7.6.19 -MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.26 +MYSQL_CLUSTER_VERSIONS["7.5"]=7.5.24 +MYSQL_CLUSTER_VERSIONS["7.6"]=7.6.20 +MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.27 declare -A MYSQL_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["7.5"]=8.0.26 -MYSQL_SHELL_VERSIONS["7.6"]=8.0.26 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.26 +MYSQL_SHELL_VERSIONS["7.5"]=8.0.27 +MYSQL_SHELL_VERSIONS["7.6"]=8.0.27 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.27 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["7.5"]="${MYSQL_CLUSTER_VERSIONS["7.5"]}-${IMAGE_VERSION}" diff --git a/mysql-router/VERSION b/mysql-router/VERSION index b06e5539f..e42626df6 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -1,8 +1,8 @@ -IMAGE_VERSION=1.0.4-router +IMAGE_VERSION=1.0.5-router declare -A MYSQL_ROUTER_VERSIONS -MYSQL_ROUTER_VERSIONS["8.0"]=8.0.26 +MYSQL_ROUTER_VERSIONS["8.0"]=8.0.27 declare -A MYSQL_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["8.0"]=8.0.26 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.27 declare -A FULL_ROUTER_VERSIONS FULL_ROUTER_VERSIONS["8.0"]="${MYSQL_ROUTER_VERSIONS["8.0"]}-${IMAGE_VERSION}" diff --git a/mysql-server/VERSION b/mysql-server/VERSION index 581595a82..95868a515 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,12 +1,12 @@ -IMAGE_VERSION=1.2.4-server +IMAGE_VERSION=1.2.5-server declare -A MYSQL_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["5.7"]=5.7.35 -MYSQL_SERVER_VERSIONS["8.0"]=8.0.26 +MYSQL_SERVER_VERSIONS["5.7"]=5.7.36 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.27 declare -A MYSQL_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["5.7"]=8.0.26 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.26 +MYSQL_SHELL_VERSIONS["5.7"]=8.0.27 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.27 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["5.7"]="${MYSQL_SERVER_VERSIONS["5.7"]}-${IMAGE_VERSION}" From 59ce5f140fd82810d410333506d662b1d28eba77 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 20 Oct 2021 04:21:52 +0000 Subject: [PATCH 233/386] Release version 1.2.5-server * Bump versions for 8.0.27 release cycle * WL#14703 Ignore timezone during initialization of Docker container --- mysql-server/5.7/Dockerfile | 4 ++-- mysql-server/5.7/docker-entrypoint.sh | 4 ++-- mysql-server/5.7/inspec/control.rb | 4 ++-- mysql-server/8.0/Dockerfile | 4 ++-- mysql-server/8.0/docker-entrypoint.sh | 4 ++-- mysql-server/8.0/inspec/control.rb | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/mysql-server/5.7/Dockerfile b/mysql-server/5.7/Dockerfile index 0f5a0b103..2ab3fe7a1 100644 --- a/mysql-server/5.7/Dockerfile +++ b/mysql-server/5.7/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.35 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.26 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.36 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.27 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ diff --git a/mysql-server/5.7/docker-entrypoint.sh b/mysql-server/5.7/docker-entrypoint.sh index 664774cd0..beedc3a71 100755 --- a/mysql-server/5.7/docker-entrypoint.sh +++ b/mysql-server/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.35-1.2.4-server" +echo "[Entrypoint] MySQL Docker Image 5.7.36-1.2.5-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 5.7.35-1.2.4-server" + echo "[Entrypoint] Starting MySQL 5.7.36-1.2.5-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/5.7/inspec/control.rb b/mysql-server/5.7/inspec/control.rb index 7116147a0..fe3c823fa 100644 --- a/mysql-server/5.7/inspec/control.rb +++ b/mysql-server/5.7/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '5.7.35.*' } + its ('version') { should match '5.7.36.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.26.*' } + its ('version') { should match '8.0.27.*' } end end diff --git a/mysql-server/8.0/Dockerfile b/mysql-server/8.0/Dockerfile index 5250b7671..9a7709197 100644 --- a/mysql-server/8.0/Dockerfile +++ b/mysql-server/8.0/Dockerfile @@ -15,8 +15,8 @@ FROM oraclelinux:8-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.26 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.26 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.27 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.27 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-community-minimal-release-el8.rpm \ diff --git a/mysql-server/8.0/docker-entrypoint.sh b/mysql-server/8.0/docker-entrypoint.sh index 8ebd1eb2d..143d5344a 100755 --- a/mysql-server/8.0/docker-entrypoint.sh +++ b/mysql-server/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.26-1.2.4-server" +echo "[Entrypoint] MySQL Docker Image 8.0.27-1.2.5-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.26-1.2.4-server" + echo "[Entrypoint] Starting MySQL 8.0.27-1.2.5-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/8.0/inspec/control.rb b/mysql-server/8.0/inspec/control.rb index 8be0bfba7..539e8b842 100644 --- a/mysql-server/8.0/inspec/control.rb +++ b/mysql-server/8.0/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.26.*' } + its ('version') { should match '8.0.27.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.26.*' } + its ('version') { should match '8.0.27.*' } end end From 798b6ce072f27dd4d55f6066f69f600dedef738c Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 20 Oct 2021 06:18:52 +0000 Subject: [PATCH 234/386] Release version 1.2.5-cluster * Bump versions for 8.0.27 release cycle --- mysql-cluster/7.5/Dockerfile | 4 ++-- mysql-cluster/7.5/docker-entrypoint.sh | 4 ++-- mysql-cluster/7.5/inspec/control.rb | 4 ++-- mysql-cluster/7.6/Dockerfile | 4 ++-- mysql-cluster/7.6/docker-entrypoint.sh | 4 ++-- mysql-cluster/7.6/inspec/control.rb | 4 ++-- mysql-cluster/8.0/Dockerfile | 4 ++-- mysql-cluster/8.0/docker-entrypoint.sh | 4 ++-- mysql-cluster/8.0/inspec/control.rb | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/mysql-cluster/7.5/Dockerfile b/mysql-cluster/7.5/Dockerfile index 34e1abce1..44b7724fb 100644 --- a/mysql-cluster/7.5/Dockerfile +++ b/mysql-cluster/7.5/Dockerfile @@ -15,8 +15,8 @@ FROM oraclelinux:7-slim -ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.5.23 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.26 +ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.5.24 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.27 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el7.rpm \ diff --git a/mysql-cluster/7.5/docker-entrypoint.sh b/mysql-cluster/7.5/docker-entrypoint.sh index 5b9270611..238f6dc0e 100755 --- a/mysql-cluster/7.5/docker-entrypoint.sh +++ b/mysql-cluster/7.5/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 7.5.23-1.2.4-cluster" +echo "[Entrypoint] MySQL Docker Image 7.5.24-1.2.5-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -219,7 +219,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 7.5.23-1.2.4-cluster" + echo "[Entrypoint] Starting MySQL 7.5.24-1.2.5-cluster" fi exec "$@" --user=$MYSQLD_USER else diff --git a/mysql-cluster/7.5/inspec/control.rb b/mysql-cluster/7.5/inspec/control.rb index 6f7721408..35027588c 100644 --- a/mysql-cluster/7.5/inspec/control.rb +++ b/mysql-cluster/7.5/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '7.5.23.*' } + its ('version') { should match '7.5.24.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.26.*' } + its ('version') { should match '8.0.27.*' } end end diff --git a/mysql-cluster/7.6/Dockerfile b/mysql-cluster/7.6/Dockerfile index ed269c156..ebecbf1c9 100644 --- a/mysql-cluster/7.6/Dockerfile +++ b/mysql-cluster/7.6/Dockerfile @@ -15,8 +15,8 @@ FROM oraclelinux:7-slim -ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.6.19 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.26 +ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.6.20 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.27 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el7.rpm \ diff --git a/mysql-cluster/7.6/docker-entrypoint.sh b/mysql-cluster/7.6/docker-entrypoint.sh index 994b1d5fb..378704ea7 100755 --- a/mysql-cluster/7.6/docker-entrypoint.sh +++ b/mysql-cluster/7.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 7.6.19-1.2.4-cluster" +echo "[Entrypoint] MySQL Docker Image 7.6.20-1.2.5-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -219,7 +219,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 7.6.19-1.2.4-cluster" + echo "[Entrypoint] Starting MySQL 7.6.20-1.2.5-cluster" fi exec "$@" --user=$MYSQLD_USER else diff --git a/mysql-cluster/7.6/inspec/control.rb b/mysql-cluster/7.6/inspec/control.rb index a2b910d51..41b85aabe 100644 --- a/mysql-cluster/7.6/inspec/control.rb +++ b/mysql-cluster/7.6/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '7.6.19.*' } + its ('version') { should match '7.6.20.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.26.*' } + its ('version') { should match '8.0.27.*' } end end diff --git a/mysql-cluster/8.0/Dockerfile b/mysql-cluster/8.0/Dockerfile index c919c820f..d15affd88 100644 --- a/mysql-cluster/8.0/Dockerfile +++ b/mysql-cluster/8.0/Dockerfile @@ -15,8 +15,8 @@ FROM oraclelinux:8-slim -ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-8.0.26 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.26 +ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-8.0.27 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.27 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el8.rpm \ diff --git a/mysql-cluster/8.0/docker-entrypoint.sh b/mysql-cluster/8.0/docker-entrypoint.sh index 7401f397c..fca18e2db 100755 --- a/mysql-cluster/8.0/docker-entrypoint.sh +++ b/mysql-cluster/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.26-1.2.4-cluster" +echo "[Entrypoint] MySQL Docker Image 8.0.27-1.2.5-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -219,7 +219,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.26-1.2.4-cluster" + echo "[Entrypoint] Starting MySQL 8.0.27-1.2.5-cluster" fi export MYSQLD_PARENT_PID=$$ ; exec "$@" --user= else diff --git a/mysql-cluster/8.0/inspec/control.rb b/mysql-cluster/8.0/inspec/control.rb index 7f261198b..cac8c9eab 100644 --- a/mysql-cluster/8.0/inspec/control.rb +++ b/mysql-cluster/8.0/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.26.*' } + its ('version') { should match '8.0.27.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.26.*' } + its ('version') { should match '8.0.27.*' } end end From b560577f1e21665c9617a16332116d0552f302a7 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 20 Oct 2021 06:41:05 +0000 Subject: [PATCH 235/386] Release version 1.0.5-router * Bump versions for 8.0.27 release cycle --- mysql-router/8.0/Dockerfile | 4 ++-- mysql-router/8.0/inspec/control.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-router/8.0/Dockerfile b/mysql-router/8.0/Dockerfile index b68befe79..222edc2bc 100644 --- a/mysql-router/8.0/Dockerfile +++ b/mysql-router/8.0/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:8-slim -ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.26 -ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.26 +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.27 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.27 RUN rpm -U https://repo.mysql.com/mysql80-community-release-el8.rpm \ && microdnf install -y --disablerepo=ol8_appstream \ diff --git a/mysql-router/8.0/inspec/control.rb b/mysql-router/8.0/inspec/control.rb index 6ab824dbb..a87e349c8 100644 --- a/mysql-router/8.0/inspec/control.rb +++ b/mysql-router/8.0/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-community-client') do it { should be_installed } - its ('version') { should match '8.0.26.*' } + its ('version') { should match '8.0.27.*' } end describe package('mysql-router-community') do it { should be_installed } - its ('version') { should match '8.0.26.*' } + its ('version') { should match '8.0.27.*' } end end From 0d24c59937b7b0880f8410b235c25bac8e204d4d Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Wed, 3 Nov 2021 08:58:59 +0100 Subject: [PATCH 236/386] Remove python36 package from server image The package is erroneously included as a dependency for MySQL Shell, and triggers CVE warnings in certain scanners. Change-Id: Icea30afa108aee7e0cd2a6cd9db56594d02609f4 --- mysql-server/template/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-server/template/Dockerfile b/mysql-server/template/Dockerfile index e1612a911..08370d4a3 100644 --- a/mysql-server/template/Dockerfile +++ b/mysql-server/template/Dockerfile @@ -27,6 +27,7 @@ RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ && microdnf install -y $MYSQL_SHELL_PACKAGE \ && microdnf install -y --disablerepo=ol8_appstream \ --enablerepo=mysql%%REPO_VERSION%%-server-minimal $MYSQL_SERVER_PACKAGE \ + && rpm --nodeps -e python36 \ && microdnf clean all \ && mkdir /docker-entrypoint-initdb.d From e2dcdf0d0f3a6ed920a040546f54e8b7b0787aed Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Mon, 8 Nov 2021 07:56:53 +0100 Subject: [PATCH 237/386] Bump image version for extra release Change-Id: I35f7482d18deb099cfe82993457bc4fbcc0b1188 --- mysql-cluster/VERSION | 2 +- mysql-router/VERSION | 2 +- mysql-server/VERSION | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mysql-cluster/VERSION b/mysql-cluster/VERSION index 8a5fa0ef0..2291887f6 100644 --- a/mysql-cluster/VERSION +++ b/mysql-cluster/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.2.5-cluster +IMAGE_VERSION=1.2.6-cluster declare -A MYSQL_CLUSTER_VERSIONS MYSQL_CLUSTER_VERSIONS["7.5"]=7.5.24 diff --git a/mysql-router/VERSION b/mysql-router/VERSION index e42626df6..aa8c3da3b 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.0.5-router +IMAGE_VERSION=1.0.6-router declare -A MYSQL_ROUTER_VERSIONS MYSQL_ROUTER_VERSIONS["8.0"]=8.0.27 declare -A MYSQL_SERVER_VERSIONS diff --git a/mysql-server/VERSION b/mysql-server/VERSION index 95868a515..cf00ff88d 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.2.5-server +IMAGE_VERSION=1.2.6-server declare -A MYSQL_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["5.7"]=5.7.36 From 220f24b3037230af3330a51770710680365c74f7 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Thu, 11 Nov 2021 07:05:10 +0000 Subject: [PATCH 238/386] Release version 1.2.6-server * Bump image version for extra release * Remove python36 package from server image --- mysql-server/5.7/docker-entrypoint.sh | 4 ++-- mysql-server/8.0/Dockerfile | 1 + mysql-server/8.0/docker-entrypoint.sh | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mysql-server/5.7/docker-entrypoint.sh b/mysql-server/5.7/docker-entrypoint.sh index beedc3a71..89a0496a6 100755 --- a/mysql-server/5.7/docker-entrypoint.sh +++ b/mysql-server/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.36-1.2.5-server" +echo "[Entrypoint] MySQL Docker Image 5.7.36-1.2.6-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 5.7.36-1.2.5-server" + echo "[Entrypoint] Starting MySQL 5.7.36-1.2.6-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/8.0/Dockerfile b/mysql-server/8.0/Dockerfile index 9a7709197..19b7f79ba 100644 --- a/mysql-server/8.0/Dockerfile +++ b/mysql-server/8.0/Dockerfile @@ -27,6 +27,7 @@ RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ && microdnf install -y $MYSQL_SHELL_PACKAGE \ && microdnf install -y --disablerepo=ol8_appstream \ --enablerepo=mysql80-server-minimal $MYSQL_SERVER_PACKAGE \ + && rpm --nodeps -e python36 \ && microdnf clean all \ && mkdir /docker-entrypoint-initdb.d diff --git a/mysql-server/8.0/docker-entrypoint.sh b/mysql-server/8.0/docker-entrypoint.sh index 143d5344a..07caf2928 100755 --- a/mysql-server/8.0/docker-entrypoint.sh +++ b/mysql-server/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.27-1.2.5-server" +echo "[Entrypoint] MySQL Docker Image 8.0.27-1.2.6-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.27-1.2.5-server" + echo "[Entrypoint] Starting MySQL 8.0.27-1.2.6-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) From 5b7728cd75ff1e1af327de1cf87d088b0183f812 Mon Sep 17 00:00:00 2001 From: Karen Langford Date: Fri, 3 Dec 2021 06:53:22 +0100 Subject: [PATCH 239/386] Bump versions for 8.0.28 release Change-Id: I11398237d00bb85ad6864b64195fbc42470ffc46 --- mysql-cluster/VERSION | 14 +++++++------- mysql-router/VERSION | 6 +++--- mysql-server/VERSION | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/mysql-cluster/VERSION b/mysql-cluster/VERSION index 2291887f6..e834957bc 100644 --- a/mysql-cluster/VERSION +++ b/mysql-cluster/VERSION @@ -1,14 +1,14 @@ -IMAGE_VERSION=1.2.6-cluster +IMAGE_VERSION=1.2.7-cluster declare -A MYSQL_CLUSTER_VERSIONS -MYSQL_CLUSTER_VERSIONS["7.5"]=7.5.24 -MYSQL_CLUSTER_VERSIONS["7.6"]=7.6.20 -MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.27 +MYSQL_CLUSTER_VERSIONS["7.5"]=7.5.25 +MYSQL_CLUSTER_VERSIONS["7.6"]=7.6.21 +MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.28 declare -A MYSQL_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["7.5"]=8.0.27 -MYSQL_SHELL_VERSIONS["7.6"]=8.0.27 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.27 +MYSQL_SHELL_VERSIONS["7.5"]=8.0.28 +MYSQL_SHELL_VERSIONS["7.6"]=8.0.28 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.28 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["7.5"]="${MYSQL_CLUSTER_VERSIONS["7.5"]}-${IMAGE_VERSION}" diff --git a/mysql-router/VERSION b/mysql-router/VERSION index aa8c3da3b..724bcd494 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -1,8 +1,8 @@ -IMAGE_VERSION=1.0.6-router +IMAGE_VERSION=1.0.7-router declare -A MYSQL_ROUTER_VERSIONS -MYSQL_ROUTER_VERSIONS["8.0"]=8.0.27 +MYSQL_ROUTER_VERSIONS["8.0"]=8.0.28 declare -A MYSQL_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["8.0"]=8.0.27 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.28 declare -A FULL_ROUTER_VERSIONS FULL_ROUTER_VERSIONS["8.0"]="${MYSQL_ROUTER_VERSIONS["8.0"]}-${IMAGE_VERSION}" diff --git a/mysql-server/VERSION b/mysql-server/VERSION index cf00ff88d..66844ea37 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,12 +1,12 @@ -IMAGE_VERSION=1.2.6-server +IMAGE_VERSION=1.2.7-server declare -A MYSQL_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["5.7"]=5.7.36 -MYSQL_SERVER_VERSIONS["8.0"]=8.0.27 +MYSQL_SERVER_VERSIONS["5.7"]=5.7.37 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.28 declare -A MYSQL_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["5.7"]=8.0.27 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.27 +MYSQL_SHELL_VERSIONS["5.7"]=8.0.28 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.28 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["5.7"]="${MYSQL_SERVER_VERSIONS["5.7"]}-${IMAGE_VERSION}" From 9a97a8187f8c4bc20a2f4b9ddb67ba869b2520e6 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Fri, 3 Dec 2021 08:22:20 +0100 Subject: [PATCH 240/386] Revert "Remove python36 package from server image" This workaround is no longer needed. This reverts commit 0d24c59937b7b0880f8410b235c25bac8e204d4d. Change-Id: Idb4edd21e5c58af5059a278141407a3c4bd77c12 --- mysql-server/template/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/mysql-server/template/Dockerfile b/mysql-server/template/Dockerfile index 08370d4a3..e1612a911 100644 --- a/mysql-server/template/Dockerfile +++ b/mysql-server/template/Dockerfile @@ -27,7 +27,6 @@ RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ && microdnf install -y $MYSQL_SHELL_PACKAGE \ && microdnf install -y --disablerepo=ol8_appstream \ --enablerepo=mysql%%REPO_VERSION%%-server-minimal $MYSQL_SERVER_PACKAGE \ - && rpm --nodeps -e python36 \ && microdnf clean all \ && mkdir /docker-entrypoint-initdb.d From a6cea818f12f3f630d41d0cd4e5a2703a68b5456 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Schl=C3=BCter?= Date: Wed, 22 Dec 2021 17:24:24 +0100 Subject: [PATCH 241/386] Fix 33659682 Adding a new environment option MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS and add docuemntation on adding runtime options. Also run as mysqlrouter by default. Change-Id: Ia8e794f78afa96a0dda6a8e8e5b38b8032b02809 --- mysql-router/8.0/Dockerfile | 10 +++++++--- mysql-router/8.0/README.md | 17 +++++++++++++---- mysql-router/8.0/inspec/control.rb | 4 ++-- mysql-router/8.0/run.sh | 11 ++++++++--- mysql-router/README.md | 17 +++++++++++++---- mysql-router/template/Dockerfile | 6 +++++- mysql-router/template/run.sh | 11 ++++++++--- 7 files changed, 56 insertions(+), 20 deletions(-) diff --git a/mysql-router/8.0/Dockerfile b/mysql-router/8.0/Dockerfile index 222edc2bc..3145f467d 100644 --- a/mysql-router/8.0/Dockerfile +++ b/mysql-router/8.0/Dockerfile @@ -14,10 +14,13 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:8-slim -ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.27 -ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.27 +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.28 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.28 -RUN rpm -U https://repo.mysql.com/mysql80-community-release-el8.rpm \ +RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ + && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ + -c "MySQL Router" mysqlrouter \ + && rpm -U https://repo.mysql.com/mysql80-community-release-el8.rpm \ && microdnf install -y --disablerepo=ol8_appstream \ $MYSQL_CLIENT_PACKAGE $MYSQL_ROUTER_PACKAGE \ && microdnf clean all @@ -26,5 +29,6 @@ COPY run.sh /run.sh HEALTHCHECK \ CMD mysqladmin --port 6446 --protocol TCP ping 2>&1 | grep Access || exit 1 EXPOSE 6446 6447 6448 6449 8443 +USER 999:999 ENTRYPOINT ["/run.sh"] CMD ["mysqlrouter"] diff --git a/mysql-router/8.0/README.md b/mysql-router/8.0/README.md index 77a4c0237..0f2711ba5 100644 --- a/mysql-router/8.0/README.md +++ b/mysql-router/8.0/README.md @@ -30,10 +30,11 @@ Running in a container requires a working InnoDB cluster. The image uses the following optional variables: -| Variable | Description | -| ------------------------ | ------------------------------------------- | -| MYSQL_INNODB_CLUSTER_MEMBERS | Wait for at least this number of cluster instances to be ONLINE | -| MYSQL_CREATE_ROUTER_USER | Whether to create a new account for the Router to use when it's running. Defaults to 1, set to 0 to disable. | +| Variable | Description | +| ------------------------------------ | ------------------------------------------- | +| MYSQL_INNODB_CLUSTER_MEMBERS | Wait for at least this number of cluster instances to be ONLINE | +| MYSQL_CREATE_ROUTER_USER | Whether to create a new account for the Router to use when it's running. Defaults to 1, set to 0 to disable. | +| MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS | Additional command line options applied while bootstrapping If supplied the run script waits for the given mysql host to be up, the InnoDB cluster to have MYSQL_INNODB_CLUSTER_MEMBERS members and then uses the given server for its @@ -46,6 +47,12 @@ The image can be run via: docker run -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -e MYSQL_INNODB_CLUSTER_MEMBERS=3 -ti mysql/mysql-router ``` +Additional command line options for running MySQL Router after bootstrap can be passed a command options. For instance you can use a config file from your home directory like this: + +``` +docker run -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -ti -v $HOME/router-extra.conf:/tmp/router-extra.conf mysql/mysql-router mysqlrouter --extra-config=/tmp/router-extra.conf +``` + It can be verified by typing: ``` @@ -58,6 +65,8 @@ The following output should be displayed: 4954b1c80be1 mysql-router:8.0 "/run.sh mysqlrouter" About a minute ago Up About a minute (healthy) 6447/tcp, 6448/tcp, 0.0.0.0:6446->6446/tcp, 6449/tcp innodbcluster_mysql-router_1 ``` +By default the container will run as user 999:999 which maps to mysqlrouter:mysqlrouter inside the container. + # Exposed Ports The following TCP ports are exposed by the MySQL Router container: diff --git a/mysql-router/8.0/inspec/control.rb b/mysql-router/8.0/inspec/control.rb index a87e349c8..f514c7c65 100644 --- a/mysql-router/8.0/inspec/control.rb +++ b/mysql-router/8.0/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-community-client') do it { should be_installed } - its ('version') { should match '8.0.27.*' } + its ('version') { should match '8.0.28.*' } end describe package('mysql-router-community') do it { should be_installed } - its ('version') { should match '8.0.27.*' } + its ('version') { should match '8.0.28.*' } end end diff --git a/mysql-router/8.0/run.sh b/mysql-router/8.0/run.sh index 9d1e78bfb..f806c1afe 100755 --- a/mysql-router/8.0/run.sh +++ b/mysql-router/8.0/run.sh @@ -22,7 +22,12 @@ if [ "$1" = 'mysqlrouter' ]; then echo " MYSQL_PORT" echo " MYSQL_USER" echo " MYSQL_PASSWORD" - echo "to be set. Exiting." + echo "to be set." + echo "In addition you can set" + echo " MYSQL_INNODB_CLUSTER_MEMBERS " + echo " MYSQL_CREATE_ROUTER_USER" + echo " MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS" + echo "Exiting." exit 1 fi @@ -78,10 +83,10 @@ EOF fi if [ "$MYSQL_CREATE_ROUTER_USER" = "0" ]; then echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap reusing account \"$MYSQL_USER\"." - mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force --account-create=never --account=$MYSQL_USER $opt_user < "$PASSFILE" || exit 1 + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force --account-create=never --account=$MYSQL_USER $opt_user $MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS < "$PASSFILE" || exit 1 else echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap." - mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force $opt_user < "$PASSFILE" || exit 1 + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force $opt_user $MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS < "$PASSFILE" || exit 1 fi sed -i -e 's/logging_folder=.*$/logging_folder=/' /tmp/mysqlrouter/mysqlrouter.conf diff --git a/mysql-router/README.md b/mysql-router/README.md index 77a4c0237..0f2711ba5 100644 --- a/mysql-router/README.md +++ b/mysql-router/README.md @@ -30,10 +30,11 @@ Running in a container requires a working InnoDB cluster. The image uses the following optional variables: -| Variable | Description | -| ------------------------ | ------------------------------------------- | -| MYSQL_INNODB_CLUSTER_MEMBERS | Wait for at least this number of cluster instances to be ONLINE | -| MYSQL_CREATE_ROUTER_USER | Whether to create a new account for the Router to use when it's running. Defaults to 1, set to 0 to disable. | +| Variable | Description | +| ------------------------------------ | ------------------------------------------- | +| MYSQL_INNODB_CLUSTER_MEMBERS | Wait for at least this number of cluster instances to be ONLINE | +| MYSQL_CREATE_ROUTER_USER | Whether to create a new account for the Router to use when it's running. Defaults to 1, set to 0 to disable. | +| MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS | Additional command line options applied while bootstrapping If supplied the run script waits for the given mysql host to be up, the InnoDB cluster to have MYSQL_INNODB_CLUSTER_MEMBERS members and then uses the given server for its @@ -46,6 +47,12 @@ The image can be run via: docker run -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -e MYSQL_INNODB_CLUSTER_MEMBERS=3 -ti mysql/mysql-router ``` +Additional command line options for running MySQL Router after bootstrap can be passed a command options. For instance you can use a config file from your home directory like this: + +``` +docker run -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -ti -v $HOME/router-extra.conf:/tmp/router-extra.conf mysql/mysql-router mysqlrouter --extra-config=/tmp/router-extra.conf +``` + It can be verified by typing: ``` @@ -58,6 +65,8 @@ The following output should be displayed: 4954b1c80be1 mysql-router:8.0 "/run.sh mysqlrouter" About a minute ago Up About a minute (healthy) 6447/tcp, 6448/tcp, 0.0.0.0:6446->6446/tcp, 6449/tcp innodbcluster_mysql-router_1 ``` +By default the container will run as user 999:999 which maps to mysqlrouter:mysqlrouter inside the container. + # Exposed Ports The following TCP ports are exposed by the MySQL Router container: diff --git a/mysql-router/template/Dockerfile b/mysql-router/template/Dockerfile index 8bfd82d72..6fa59ef1d 100644 --- a/mysql-router/template/Dockerfile +++ b/mysql-router/template/Dockerfile @@ -17,7 +17,10 @@ FROM oraclelinux:8-slim ARG MYSQL_CLIENT_PACKAGE=%%MYSQL_CLIENT_PACKAGE%% ARG MYSQL_ROUTER_PACKAGE=%%MYSQL_ROUTER_PACKAGE%% -RUN rpm -U %%REPO%%/mysql%%REPO_VERSION%%-community-release-el8.rpm \ +RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ + && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ + -c "MySQL Router" mysqlrouter \ + && rpm -U %%REPO%%/mysql%%REPO_VERSION%%-community-release-el8.rpm \ && microdnf install -y --disablerepo=ol8_appstream \ $MYSQL_CLIENT_PACKAGE $MYSQL_ROUTER_PACKAGE \ && microdnf clean all @@ -26,5 +29,6 @@ COPY run.sh /run.sh HEALTHCHECK \ CMD mysqladmin --port 6446 --protocol TCP ping 2>&1 | grep Access || exit 1 EXPOSE 6446 6447 6448 6449 8443 +USER 999:999 ENTRYPOINT ["/run.sh"] CMD ["mysqlrouter"] diff --git a/mysql-router/template/run.sh b/mysql-router/template/run.sh index 9d1e78bfb..f806c1afe 100755 --- a/mysql-router/template/run.sh +++ b/mysql-router/template/run.sh @@ -22,7 +22,12 @@ if [ "$1" = 'mysqlrouter' ]; then echo " MYSQL_PORT" echo " MYSQL_USER" echo " MYSQL_PASSWORD" - echo "to be set. Exiting." + echo "to be set." + echo "In addition you can set" + echo " MYSQL_INNODB_CLUSTER_MEMBERS " + echo " MYSQL_CREATE_ROUTER_USER" + echo " MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS" + echo "Exiting." exit 1 fi @@ -78,10 +83,10 @@ EOF fi if [ "$MYSQL_CREATE_ROUTER_USER" = "0" ]; then echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap reusing account \"$MYSQL_USER\"." - mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force --account-create=never --account=$MYSQL_USER $opt_user < "$PASSFILE" || exit 1 + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force --account-create=never --account=$MYSQL_USER $opt_user $MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS < "$PASSFILE" || exit 1 else echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap." - mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force $opt_user < "$PASSFILE" || exit 1 + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force $opt_user $MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS < "$PASSFILE" || exit 1 fi sed -i -e 's/logging_folder=.*$/logging_folder=/' /tmp/mysqlrouter/mysqlrouter.conf From 93b72871f3ebbf6ae8ab7ad2bf34360942c4689c Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 19 Jan 2022 02:30:17 +0000 Subject: [PATCH 242/386] Release version 1.2.7-server * Revert "Remove python36 package from server image" * Bump versions for 8.0.28 release --- mysql-server/5.7/Dockerfile | 4 ++-- mysql-server/5.7/docker-entrypoint.sh | 4 ++-- mysql-server/5.7/inspec/control.rb | 4 ++-- mysql-server/8.0/Dockerfile | 5 ++--- mysql-server/8.0/docker-entrypoint.sh | 4 ++-- mysql-server/8.0/inspec/control.rb | 4 ++-- 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/mysql-server/5.7/Dockerfile b/mysql-server/5.7/Dockerfile index 2ab3fe7a1..8ee535644 100644 --- a/mysql-server/5.7/Dockerfile +++ b/mysql-server/5.7/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.36 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.27 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.37 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.28 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ diff --git a/mysql-server/5.7/docker-entrypoint.sh b/mysql-server/5.7/docker-entrypoint.sh index 89a0496a6..7fb891560 100755 --- a/mysql-server/5.7/docker-entrypoint.sh +++ b/mysql-server/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.36-1.2.6-server" +echo "[Entrypoint] MySQL Docker Image 5.7.37-1.2.7-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 5.7.36-1.2.6-server" + echo "[Entrypoint] Starting MySQL 5.7.37-1.2.7-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/5.7/inspec/control.rb b/mysql-server/5.7/inspec/control.rb index fe3c823fa..eb2ce387e 100644 --- a/mysql-server/5.7/inspec/control.rb +++ b/mysql-server/5.7/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '5.7.36.*' } + its ('version') { should match '5.7.37.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.27.*' } + its ('version') { should match '8.0.28.*' } end end diff --git a/mysql-server/8.0/Dockerfile b/mysql-server/8.0/Dockerfile index 19b7f79ba..ecb8819b4 100644 --- a/mysql-server/8.0/Dockerfile +++ b/mysql-server/8.0/Dockerfile @@ -15,8 +15,8 @@ FROM oraclelinux:8-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.27 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.27 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.28 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.28 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-community-minimal-release-el8.rpm \ @@ -27,7 +27,6 @@ RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ && microdnf install -y $MYSQL_SHELL_PACKAGE \ && microdnf install -y --disablerepo=ol8_appstream \ --enablerepo=mysql80-server-minimal $MYSQL_SERVER_PACKAGE \ - && rpm --nodeps -e python36 \ && microdnf clean all \ && mkdir /docker-entrypoint-initdb.d diff --git a/mysql-server/8.0/docker-entrypoint.sh b/mysql-server/8.0/docker-entrypoint.sh index 07caf2928..3418b45a3 100755 --- a/mysql-server/8.0/docker-entrypoint.sh +++ b/mysql-server/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.27-1.2.6-server" +echo "[Entrypoint] MySQL Docker Image 8.0.28-1.2.7-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.27-1.2.6-server" + echo "[Entrypoint] Starting MySQL 8.0.28-1.2.7-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/8.0/inspec/control.rb b/mysql-server/8.0/inspec/control.rb index 539e8b842..cff23a06b 100644 --- a/mysql-server/8.0/inspec/control.rb +++ b/mysql-server/8.0/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.27.*' } + its ('version') { should match '8.0.28.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.27.*' } + its ('version') { should match '8.0.28.*' } end end From a017d432f3e619d9812c803103174ccb78e6508a Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 19 Jan 2022 02:35:08 +0000 Subject: [PATCH 243/386] Release version 1.0.7-router * Fix 33659682 * Bump versions for 8.0.28 release * Bump image version for extra release From 1bc29fbe22d1afc8475b378068b59a6fb48732e7 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 19 Jan 2022 13:57:39 +0000 Subject: [PATCH 244/386] Release version 1.2.7-cluster * Bump versions for 8.0.28 release * Bump image version for extra release --- mysql-cluster/7.5/Dockerfile | 4 ++-- mysql-cluster/7.5/docker-entrypoint.sh | 4 ++-- mysql-cluster/7.5/inspec/control.rb | 4 ++-- mysql-cluster/7.6/Dockerfile | 4 ++-- mysql-cluster/7.6/docker-entrypoint.sh | 4 ++-- mysql-cluster/7.6/inspec/control.rb | 4 ++-- mysql-cluster/8.0/Dockerfile | 4 ++-- mysql-cluster/8.0/docker-entrypoint.sh | 4 ++-- mysql-cluster/8.0/inspec/control.rb | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/mysql-cluster/7.5/Dockerfile b/mysql-cluster/7.5/Dockerfile index 44b7724fb..06e4931fa 100644 --- a/mysql-cluster/7.5/Dockerfile +++ b/mysql-cluster/7.5/Dockerfile @@ -15,8 +15,8 @@ FROM oraclelinux:7-slim -ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.5.24 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.27 +ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.5.25 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.28 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el7.rpm \ diff --git a/mysql-cluster/7.5/docker-entrypoint.sh b/mysql-cluster/7.5/docker-entrypoint.sh index 238f6dc0e..e4957690e 100755 --- a/mysql-cluster/7.5/docker-entrypoint.sh +++ b/mysql-cluster/7.5/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 7.5.24-1.2.5-cluster" +echo "[Entrypoint] MySQL Docker Image 7.5.25-1.2.7-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -219,7 +219,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 7.5.24-1.2.5-cluster" + echo "[Entrypoint] Starting MySQL 7.5.25-1.2.7-cluster" fi exec "$@" --user=$MYSQLD_USER else diff --git a/mysql-cluster/7.5/inspec/control.rb b/mysql-cluster/7.5/inspec/control.rb index 35027588c..9c48fcb2a 100644 --- a/mysql-cluster/7.5/inspec/control.rb +++ b/mysql-cluster/7.5/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '7.5.24.*' } + its ('version') { should match '7.5.25.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.27.*' } + its ('version') { should match '8.0.28.*' } end end diff --git a/mysql-cluster/7.6/Dockerfile b/mysql-cluster/7.6/Dockerfile index ebecbf1c9..4834ba9d8 100644 --- a/mysql-cluster/7.6/Dockerfile +++ b/mysql-cluster/7.6/Dockerfile @@ -15,8 +15,8 @@ FROM oraclelinux:7-slim -ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.6.20 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.27 +ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.6.21 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.28 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el7.rpm \ diff --git a/mysql-cluster/7.6/docker-entrypoint.sh b/mysql-cluster/7.6/docker-entrypoint.sh index 378704ea7..976b469d6 100755 --- a/mysql-cluster/7.6/docker-entrypoint.sh +++ b/mysql-cluster/7.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 7.6.20-1.2.5-cluster" +echo "[Entrypoint] MySQL Docker Image 7.6.21-1.2.7-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -219,7 +219,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 7.6.20-1.2.5-cluster" + echo "[Entrypoint] Starting MySQL 7.6.21-1.2.7-cluster" fi exec "$@" --user=$MYSQLD_USER else diff --git a/mysql-cluster/7.6/inspec/control.rb b/mysql-cluster/7.6/inspec/control.rb index 41b85aabe..568a210cd 100644 --- a/mysql-cluster/7.6/inspec/control.rb +++ b/mysql-cluster/7.6/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '7.6.20.*' } + its ('version') { should match '7.6.21.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.27.*' } + its ('version') { should match '8.0.28.*' } end end diff --git a/mysql-cluster/8.0/Dockerfile b/mysql-cluster/8.0/Dockerfile index d15affd88..fe53f352a 100644 --- a/mysql-cluster/8.0/Dockerfile +++ b/mysql-cluster/8.0/Dockerfile @@ -15,8 +15,8 @@ FROM oraclelinux:8-slim -ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-8.0.27 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.27 +ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-8.0.28 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.28 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el8.rpm \ diff --git a/mysql-cluster/8.0/docker-entrypoint.sh b/mysql-cluster/8.0/docker-entrypoint.sh index fca18e2db..ce2e22ba8 100755 --- a/mysql-cluster/8.0/docker-entrypoint.sh +++ b/mysql-cluster/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.27-1.2.5-cluster" +echo "[Entrypoint] MySQL Docker Image 8.0.28-1.2.7-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -219,7 +219,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.27-1.2.5-cluster" + echo "[Entrypoint] Starting MySQL 8.0.28-1.2.7-cluster" fi export MYSQLD_PARENT_PID=$$ ; exec "$@" --user= else diff --git a/mysql-cluster/8.0/inspec/control.rb b/mysql-cluster/8.0/inspec/control.rb index cac8c9eab..aed5fe563 100644 --- a/mysql-cluster/8.0/inspec/control.rb +++ b/mysql-cluster/8.0/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.27.*' } + its ('version') { should match '8.0.28.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.27.*' } + its ('version') { should match '8.0.28.*' } end end From e36c79c9151f0b07765da2a6d64c09009030ff08 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 19 Jan 2022 14:10:35 +0000 Subject: [PATCH 245/386] Release version 1.0.7-router From efc780b66e8a6471cfecf6d80cb13c09dbb40ffd Mon Sep 17 00:00:00 2001 From: Karen Langford Date: Tue, 15 Mar 2022 08:01:50 +0100 Subject: [PATCH 246/386] Bump versions for 8.0.29 release Change-Id: Ida0ca406bee1dd4ede37eafe3989aec3517c6cb7 --- mysql-cluster/VERSION | 14 +++++++------- mysql-router/VERSION | 6 +++--- mysql-server/VERSION | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/mysql-cluster/VERSION b/mysql-cluster/VERSION index e834957bc..a62593569 100644 --- a/mysql-cluster/VERSION +++ b/mysql-cluster/VERSION @@ -1,14 +1,14 @@ -IMAGE_VERSION=1.2.7-cluster +IMAGE_VERSION=1.2.8-cluster declare -A MYSQL_CLUSTER_VERSIONS -MYSQL_CLUSTER_VERSIONS["7.5"]=7.5.25 -MYSQL_CLUSTER_VERSIONS["7.6"]=7.6.21 -MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.28 +MYSQL_CLUSTER_VERSIONS["7.5"]=7.5.26 +MYSQL_CLUSTER_VERSIONS["7.6"]=7.6.22 +MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.29 declare -A MYSQL_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["7.5"]=8.0.28 -MYSQL_SHELL_VERSIONS["7.6"]=8.0.28 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.28 +MYSQL_SHELL_VERSIONS["7.5"]=8.0.29 +MYSQL_SHELL_VERSIONS["7.6"]=8.0.29 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.29 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["7.5"]="${MYSQL_CLUSTER_VERSIONS["7.5"]}-${IMAGE_VERSION}" diff --git a/mysql-router/VERSION b/mysql-router/VERSION index 724bcd494..207f225f7 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -1,8 +1,8 @@ -IMAGE_VERSION=1.0.7-router +IMAGE_VERSION=1.0.8-router declare -A MYSQL_ROUTER_VERSIONS -MYSQL_ROUTER_VERSIONS["8.0"]=8.0.28 +MYSQL_ROUTER_VERSIONS["8.0"]=8.0.29 declare -A MYSQL_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["8.0"]=8.0.28 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.29 declare -A FULL_ROUTER_VERSIONS FULL_ROUTER_VERSIONS["8.0"]="${MYSQL_ROUTER_VERSIONS["8.0"]}-${IMAGE_VERSION}" diff --git a/mysql-server/VERSION b/mysql-server/VERSION index 66844ea37..bf93fe5a0 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,12 +1,12 @@ -IMAGE_VERSION=1.2.7-server +IMAGE_VERSION=1.2.8-server declare -A MYSQL_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["5.7"]=5.7.37 -MYSQL_SERVER_VERSIONS["8.0"]=8.0.28 +MYSQL_SERVER_VERSIONS["5.7"]=5.7.38 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.29 declare -A MYSQL_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["5.7"]=8.0.28 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.28 +MYSQL_SHELL_VERSIONS["5.7"]=8.0.29 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.29 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["5.7"]="${MYSQL_SERVER_VERSIONS["5.7"]}-${IMAGE_VERSION}" From 0e74be63231bf43103d83bbac7c78ff7ce83b459 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 27 Apr 2022 03:14:21 +0000 Subject: [PATCH 247/386] Release version 1.2.8-server * Bump versions for 8.0.29 release --- mysql-server/5.7/Dockerfile | 4 ++-- mysql-server/5.7/docker-entrypoint.sh | 4 ++-- mysql-server/5.7/inspec/control.rb | 4 ++-- mysql-server/8.0/Dockerfile | 4 ++-- mysql-server/8.0/docker-entrypoint.sh | 4 ++-- mysql-server/8.0/inspec/control.rb | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/mysql-server/5.7/Dockerfile b/mysql-server/5.7/Dockerfile index 8ee535644..3385086fc 100644 --- a/mysql-server/5.7/Dockerfile +++ b/mysql-server/5.7/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.37 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.28 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.38 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.29 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ diff --git a/mysql-server/5.7/docker-entrypoint.sh b/mysql-server/5.7/docker-entrypoint.sh index 7fb891560..0189f68d0 100755 --- a/mysql-server/5.7/docker-entrypoint.sh +++ b/mysql-server/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.37-1.2.7-server" +echo "[Entrypoint] MySQL Docker Image 5.7.38-1.2.8-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 5.7.37-1.2.7-server" + echo "[Entrypoint] Starting MySQL 5.7.38-1.2.8-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/5.7/inspec/control.rb b/mysql-server/5.7/inspec/control.rb index eb2ce387e..2358125fb 100644 --- a/mysql-server/5.7/inspec/control.rb +++ b/mysql-server/5.7/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '5.7.37.*' } + its ('version') { should match '5.7.38.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.28.*' } + its ('version') { should match '8.0.29.*' } end end diff --git a/mysql-server/8.0/Dockerfile b/mysql-server/8.0/Dockerfile index ecb8819b4..51ddcd5f5 100644 --- a/mysql-server/8.0/Dockerfile +++ b/mysql-server/8.0/Dockerfile @@ -15,8 +15,8 @@ FROM oraclelinux:8-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.28 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.28 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.29 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.29 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-community-minimal-release-el8.rpm \ diff --git a/mysql-server/8.0/docker-entrypoint.sh b/mysql-server/8.0/docker-entrypoint.sh index 3418b45a3..48161caed 100755 --- a/mysql-server/8.0/docker-entrypoint.sh +++ b/mysql-server/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.28-1.2.7-server" +echo "[Entrypoint] MySQL Docker Image 8.0.29-1.2.8-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.28-1.2.7-server" + echo "[Entrypoint] Starting MySQL 8.0.29-1.2.8-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/8.0/inspec/control.rb b/mysql-server/8.0/inspec/control.rb index cff23a06b..3358ed0bf 100644 --- a/mysql-server/8.0/inspec/control.rb +++ b/mysql-server/8.0/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.28.*' } + its ('version') { should match '8.0.29.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.28.*' } + its ('version') { should match '8.0.29.*' } end end From 5126236f7e999c89f3ba455aa8cfe1706ed5643c Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 27 Apr 2022 04:55:40 +0000 Subject: [PATCH 248/386] Release version 1.2.8-cluster * Bump versions for 8.0.29 release --- mysql-cluster/7.5/Dockerfile | 4 ++-- mysql-cluster/7.5/docker-entrypoint.sh | 4 ++-- mysql-cluster/7.5/inspec/control.rb | 4 ++-- mysql-cluster/7.6/Dockerfile | 4 ++-- mysql-cluster/7.6/docker-entrypoint.sh | 4 ++-- mysql-cluster/7.6/inspec/control.rb | 4 ++-- mysql-cluster/8.0/Dockerfile | 4 ++-- mysql-cluster/8.0/docker-entrypoint.sh | 4 ++-- mysql-cluster/8.0/inspec/control.rb | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/mysql-cluster/7.5/Dockerfile b/mysql-cluster/7.5/Dockerfile index 06e4931fa..a8cd4c90a 100644 --- a/mysql-cluster/7.5/Dockerfile +++ b/mysql-cluster/7.5/Dockerfile @@ -15,8 +15,8 @@ FROM oraclelinux:7-slim -ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.5.25 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.28 +ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.5.26 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.29 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el7.rpm \ diff --git a/mysql-cluster/7.5/docker-entrypoint.sh b/mysql-cluster/7.5/docker-entrypoint.sh index e4957690e..bd0833b19 100755 --- a/mysql-cluster/7.5/docker-entrypoint.sh +++ b/mysql-cluster/7.5/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 7.5.25-1.2.7-cluster" +echo "[Entrypoint] MySQL Docker Image 7.5.26-1.2.8-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -219,7 +219,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 7.5.25-1.2.7-cluster" + echo "[Entrypoint] Starting MySQL 7.5.26-1.2.8-cluster" fi exec "$@" --user=$MYSQLD_USER else diff --git a/mysql-cluster/7.5/inspec/control.rb b/mysql-cluster/7.5/inspec/control.rb index 9c48fcb2a..264c51557 100644 --- a/mysql-cluster/7.5/inspec/control.rb +++ b/mysql-cluster/7.5/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '7.5.25.*' } + its ('version') { should match '7.5.26.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.28.*' } + its ('version') { should match '8.0.29.*' } end end diff --git a/mysql-cluster/7.6/Dockerfile b/mysql-cluster/7.6/Dockerfile index 4834ba9d8..fe66130ac 100644 --- a/mysql-cluster/7.6/Dockerfile +++ b/mysql-cluster/7.6/Dockerfile @@ -15,8 +15,8 @@ FROM oraclelinux:7-slim -ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.6.21 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.28 +ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.6.22 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.29 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el7.rpm \ diff --git a/mysql-cluster/7.6/docker-entrypoint.sh b/mysql-cluster/7.6/docker-entrypoint.sh index 976b469d6..12412f45c 100755 --- a/mysql-cluster/7.6/docker-entrypoint.sh +++ b/mysql-cluster/7.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 7.6.21-1.2.7-cluster" +echo "[Entrypoint] MySQL Docker Image 7.6.22-1.2.8-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -219,7 +219,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 7.6.21-1.2.7-cluster" + echo "[Entrypoint] Starting MySQL 7.6.22-1.2.8-cluster" fi exec "$@" --user=$MYSQLD_USER else diff --git a/mysql-cluster/7.6/inspec/control.rb b/mysql-cluster/7.6/inspec/control.rb index 568a210cd..d609a03c2 100644 --- a/mysql-cluster/7.6/inspec/control.rb +++ b/mysql-cluster/7.6/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '7.6.21.*' } + its ('version') { should match '7.6.22.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.28.*' } + its ('version') { should match '8.0.29.*' } end end diff --git a/mysql-cluster/8.0/Dockerfile b/mysql-cluster/8.0/Dockerfile index fe53f352a..0de479eeb 100644 --- a/mysql-cluster/8.0/Dockerfile +++ b/mysql-cluster/8.0/Dockerfile @@ -15,8 +15,8 @@ FROM oraclelinux:8-slim -ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-8.0.28 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.28 +ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-8.0.29 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.29 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el8.rpm \ diff --git a/mysql-cluster/8.0/docker-entrypoint.sh b/mysql-cluster/8.0/docker-entrypoint.sh index ce2e22ba8..b82a3633c 100755 --- a/mysql-cluster/8.0/docker-entrypoint.sh +++ b/mysql-cluster/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.28-1.2.7-cluster" +echo "[Entrypoint] MySQL Docker Image 8.0.29-1.2.8-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -219,7 +219,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.28-1.2.7-cluster" + echo "[Entrypoint] Starting MySQL 8.0.29-1.2.8-cluster" fi export MYSQLD_PARENT_PID=$$ ; exec "$@" --user= else diff --git a/mysql-cluster/8.0/inspec/control.rb b/mysql-cluster/8.0/inspec/control.rb index aed5fe563..a884c6cfc 100644 --- a/mysql-cluster/8.0/inspec/control.rb +++ b/mysql-cluster/8.0/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.28.*' } + its ('version') { should match '8.0.29.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.28.*' } + its ('version') { should match '8.0.29.*' } end end From ecb074852bbfbaf5172821bf94752f9eda5b384d Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 27 Apr 2022 05:09:21 +0000 Subject: [PATCH 249/386] Release version 1.0.8-router * Bump versions for 8.0.29 release --- mysql-router/8.0/Dockerfile | 4 ++-- mysql-router/8.0/inspec/control.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-router/8.0/Dockerfile b/mysql-router/8.0/Dockerfile index 3145f467d..4f4d1009e 100644 --- a/mysql-router/8.0/Dockerfile +++ b/mysql-router/8.0/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:8-slim -ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.28 -ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.28 +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.29 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.29 RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ diff --git a/mysql-router/8.0/inspec/control.rb b/mysql-router/8.0/inspec/control.rb index f514c7c65..fbc06b7c2 100644 --- a/mysql-router/8.0/inspec/control.rb +++ b/mysql-router/8.0/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-community-client') do it { should be_installed } - its ('version') { should match '8.0.28.*' } + its ('version') { should match '8.0.29.*' } end describe package('mysql-router-community') do it { should be_installed } - its ('version') { should match '8.0.28.*' } + its ('version') { should match '8.0.29.*' } end end From eaf0cbc62a9c3abe5c7b7184c8463e4e241319f9 Mon Sep 17 00:00:00 2001 From: Karen Langford Date: Tue, 14 Jun 2022 06:44:28 +0200 Subject: [PATCH 250/386] ET#74955: Bump versions for 8.0.30 community Docker releases Change-Id: I28a8d2a97d7ca9488fce3e28b591b0237bc7b244 --- mysql-cluster/VERSION | 14 +++++++------- mysql-router/VERSION | 6 +++--- mysql-server/VERSION | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/mysql-cluster/VERSION b/mysql-cluster/VERSION index a62593569..1d4462af0 100644 --- a/mysql-cluster/VERSION +++ b/mysql-cluster/VERSION @@ -1,14 +1,14 @@ -IMAGE_VERSION=1.2.8-cluster +IMAGE_VERSION=1.2.9-cluster declare -A MYSQL_CLUSTER_VERSIONS -MYSQL_CLUSTER_VERSIONS["7.5"]=7.5.26 -MYSQL_CLUSTER_VERSIONS["7.6"]=7.6.22 -MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.29 +MYSQL_CLUSTER_VERSIONS["7.5"]=7.5.27 +MYSQL_CLUSTER_VERSIONS["7.6"]=7.6.23 +MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.30 declare -A MYSQL_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["7.5"]=8.0.29 -MYSQL_SHELL_VERSIONS["7.6"]=8.0.29 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.29 +MYSQL_SHELL_VERSIONS["7.5"]=8.0.30 +MYSQL_SHELL_VERSIONS["7.6"]=8.0.30 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.30 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["7.5"]="${MYSQL_CLUSTER_VERSIONS["7.5"]}-${IMAGE_VERSION}" diff --git a/mysql-router/VERSION b/mysql-router/VERSION index 207f225f7..c1f15d8d5 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -1,8 +1,8 @@ -IMAGE_VERSION=1.0.8-router +IMAGE_VERSION=1.0.9-router declare -A MYSQL_ROUTER_VERSIONS -MYSQL_ROUTER_VERSIONS["8.0"]=8.0.29 +MYSQL_ROUTER_VERSIONS["8.0"]=8.0.30 declare -A MYSQL_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["8.0"]=8.0.29 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.30 declare -A FULL_ROUTER_VERSIONS FULL_ROUTER_VERSIONS["8.0"]="${MYSQL_ROUTER_VERSIONS["8.0"]}-${IMAGE_VERSION}" diff --git a/mysql-server/VERSION b/mysql-server/VERSION index bf93fe5a0..33ef45185 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,12 +1,12 @@ -IMAGE_VERSION=1.2.8-server +IMAGE_VERSION=1.2.9-server declare -A MYSQL_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["5.7"]=5.7.38 -MYSQL_SERVER_VERSIONS["8.0"]=8.0.29 +MYSQL_SERVER_VERSIONS["5.7"]=5.7.39 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.30 declare -A MYSQL_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["5.7"]=8.0.29 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.29 +MYSQL_SHELL_VERSIONS["5.7"]=8.0.30 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.30 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["5.7"]="${MYSQL_SERVER_VERSIONS["5.7"]}-${IMAGE_VERSION}" From 201a66c82a3aec267c0e1a848e29d23a91638711 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 27 Jul 2022 05:32:03 +0000 Subject: [PATCH 251/386] Release version 1.2.9-server * ET#74955: Bump versions for 8.0.30 community Docker releases --- mysql-server/5.7/Dockerfile | 4 ++-- mysql-server/5.7/docker-entrypoint.sh | 4 ++-- mysql-server/5.7/inspec/control.rb | 4 ++-- mysql-server/8.0/Dockerfile | 4 ++-- mysql-server/8.0/docker-entrypoint.sh | 4 ++-- mysql-server/8.0/inspec/control.rb | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/mysql-server/5.7/Dockerfile b/mysql-server/5.7/Dockerfile index 3385086fc..e343def2d 100644 --- a/mysql-server/5.7/Dockerfile +++ b/mysql-server/5.7/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.38 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.29 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.39 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.30 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ diff --git a/mysql-server/5.7/docker-entrypoint.sh b/mysql-server/5.7/docker-entrypoint.sh index 0189f68d0..8be997ac4 100755 --- a/mysql-server/5.7/docker-entrypoint.sh +++ b/mysql-server/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.38-1.2.8-server" +echo "[Entrypoint] MySQL Docker Image 5.7.39-1.2.9-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 5.7.38-1.2.8-server" + echo "[Entrypoint] Starting MySQL 5.7.39-1.2.9-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/5.7/inspec/control.rb b/mysql-server/5.7/inspec/control.rb index 2358125fb..c6b1c04cf 100644 --- a/mysql-server/5.7/inspec/control.rb +++ b/mysql-server/5.7/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '5.7.38.*' } + its ('version') { should match '5.7.39.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.29.*' } + its ('version') { should match '8.0.30.*' } end end diff --git a/mysql-server/8.0/Dockerfile b/mysql-server/8.0/Dockerfile index 51ddcd5f5..ff6032749 100644 --- a/mysql-server/8.0/Dockerfile +++ b/mysql-server/8.0/Dockerfile @@ -15,8 +15,8 @@ FROM oraclelinux:8-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.29 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.29 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.30 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.30 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-community-minimal-release-el8.rpm \ diff --git a/mysql-server/8.0/docker-entrypoint.sh b/mysql-server/8.0/docker-entrypoint.sh index 48161caed..f361f06fe 100755 --- a/mysql-server/8.0/docker-entrypoint.sh +++ b/mysql-server/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.29-1.2.8-server" +echo "[Entrypoint] MySQL Docker Image 8.0.30-1.2.9-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.29-1.2.8-server" + echo "[Entrypoint] Starting MySQL 8.0.30-1.2.9-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/8.0/inspec/control.rb b/mysql-server/8.0/inspec/control.rb index 3358ed0bf..605ff4ac6 100644 --- a/mysql-server/8.0/inspec/control.rb +++ b/mysql-server/8.0/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.29.*' } + its ('version') { should match '8.0.30.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.29.*' } + its ('version') { should match '8.0.30.*' } end end From 177e38b60ce58b42fe23b721e2d1ee7f39182b1c Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 27 Jul 2022 05:47:13 +0000 Subject: [PATCH 252/386] Release version 1.2.9-cluster * ET#74955: Bump versions for 8.0.30 community Docker releases --- mysql-cluster/7.5/Dockerfile | 4 ++-- mysql-cluster/7.5/docker-entrypoint.sh | 4 ++-- mysql-cluster/7.5/inspec/control.rb | 4 ++-- mysql-cluster/7.6/Dockerfile | 4 ++-- mysql-cluster/7.6/docker-entrypoint.sh | 4 ++-- mysql-cluster/7.6/inspec/control.rb | 4 ++-- mysql-cluster/8.0/Dockerfile | 4 ++-- mysql-cluster/8.0/docker-entrypoint.sh | 4 ++-- mysql-cluster/8.0/inspec/control.rb | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/mysql-cluster/7.5/Dockerfile b/mysql-cluster/7.5/Dockerfile index a8cd4c90a..bfaa70440 100644 --- a/mysql-cluster/7.5/Dockerfile +++ b/mysql-cluster/7.5/Dockerfile @@ -15,8 +15,8 @@ FROM oraclelinux:7-slim -ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.5.26 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.29 +ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.5.27 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.30 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el7.rpm \ diff --git a/mysql-cluster/7.5/docker-entrypoint.sh b/mysql-cluster/7.5/docker-entrypoint.sh index bd0833b19..4e9475874 100755 --- a/mysql-cluster/7.5/docker-entrypoint.sh +++ b/mysql-cluster/7.5/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 7.5.26-1.2.8-cluster" +echo "[Entrypoint] MySQL Docker Image 7.5.27-1.2.9-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -219,7 +219,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 7.5.26-1.2.8-cluster" + echo "[Entrypoint] Starting MySQL 7.5.27-1.2.9-cluster" fi exec "$@" --user=$MYSQLD_USER else diff --git a/mysql-cluster/7.5/inspec/control.rb b/mysql-cluster/7.5/inspec/control.rb index 264c51557..f6477baab 100644 --- a/mysql-cluster/7.5/inspec/control.rb +++ b/mysql-cluster/7.5/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '7.5.26.*' } + its ('version') { should match '7.5.27.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.29.*' } + its ('version') { should match '8.0.30.*' } end end diff --git a/mysql-cluster/7.6/Dockerfile b/mysql-cluster/7.6/Dockerfile index fe66130ac..c5682b29f 100644 --- a/mysql-cluster/7.6/Dockerfile +++ b/mysql-cluster/7.6/Dockerfile @@ -15,8 +15,8 @@ FROM oraclelinux:7-slim -ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.6.22 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.29 +ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.6.23 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.30 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el7.rpm \ diff --git a/mysql-cluster/7.6/docker-entrypoint.sh b/mysql-cluster/7.6/docker-entrypoint.sh index 12412f45c..c090c1a1c 100755 --- a/mysql-cluster/7.6/docker-entrypoint.sh +++ b/mysql-cluster/7.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 7.6.22-1.2.8-cluster" +echo "[Entrypoint] MySQL Docker Image 7.6.23-1.2.9-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -219,7 +219,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 7.6.22-1.2.8-cluster" + echo "[Entrypoint] Starting MySQL 7.6.23-1.2.9-cluster" fi exec "$@" --user=$MYSQLD_USER else diff --git a/mysql-cluster/7.6/inspec/control.rb b/mysql-cluster/7.6/inspec/control.rb index d609a03c2..a88af4109 100644 --- a/mysql-cluster/7.6/inspec/control.rb +++ b/mysql-cluster/7.6/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '7.6.22.*' } + its ('version') { should match '7.6.23.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.29.*' } + its ('version') { should match '8.0.30.*' } end end diff --git a/mysql-cluster/8.0/Dockerfile b/mysql-cluster/8.0/Dockerfile index 0de479eeb..d6f9ac4b7 100644 --- a/mysql-cluster/8.0/Dockerfile +++ b/mysql-cluster/8.0/Dockerfile @@ -15,8 +15,8 @@ FROM oraclelinux:8-slim -ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-8.0.29 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.29 +ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-8.0.30 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.30 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el8.rpm \ diff --git a/mysql-cluster/8.0/docker-entrypoint.sh b/mysql-cluster/8.0/docker-entrypoint.sh index b82a3633c..37840a828 100755 --- a/mysql-cluster/8.0/docker-entrypoint.sh +++ b/mysql-cluster/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.29-1.2.8-cluster" +echo "[Entrypoint] MySQL Docker Image 8.0.30-1.2.9-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -219,7 +219,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.29-1.2.8-cluster" + echo "[Entrypoint] Starting MySQL 8.0.30-1.2.9-cluster" fi export MYSQLD_PARENT_PID=$$ ; exec "$@" --user= else diff --git a/mysql-cluster/8.0/inspec/control.rb b/mysql-cluster/8.0/inspec/control.rb index a884c6cfc..1b9ad9e2f 100644 --- a/mysql-cluster/8.0/inspec/control.rb +++ b/mysql-cluster/8.0/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.29.*' } + its ('version') { should match '8.0.30.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.29.*' } + its ('version') { should match '8.0.30.*' } end end From c883a708fb86086d421d68f7c8cc02ff87859f8d Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 27 Jul 2022 10:47:03 +0000 Subject: [PATCH 253/386] Release version 1.0.9-router * ET#74955: Bump versions for 8.0.30 community Docker releases --- mysql-router/8.0/Dockerfile | 4 ++-- mysql-router/8.0/inspec/control.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-router/8.0/Dockerfile b/mysql-router/8.0/Dockerfile index 4f4d1009e..a2a78b5f0 100644 --- a/mysql-router/8.0/Dockerfile +++ b/mysql-router/8.0/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:8-slim -ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.29 -ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.29 +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.30 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.30 RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ diff --git a/mysql-router/8.0/inspec/control.rb b/mysql-router/8.0/inspec/control.rb index fbc06b7c2..02f5ad8b4 100644 --- a/mysql-router/8.0/inspec/control.rb +++ b/mysql-router/8.0/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-community-client') do it { should be_installed } - its ('version') { should match '8.0.29.*' } + its ('version') { should match '8.0.30.*' } end describe package('mysql-router-community') do it { should be_installed } - its ('version') { should match '8.0.29.*' } + its ('version') { should match '8.0.30.*' } end end From 34f5cf60097cc5298c6707d9c16109952b001850 Mon Sep 17 00:00:00 2001 From: Karen Langford Date: Fri, 2 Sep 2022 04:29:20 +0200 Subject: [PATCH 254/386] ET#75728: Bump versions for 8.0.31 community Docker releases Change-Id: I3d1dd4bbd3ff28dfc140451f24984837bd397fd2 --- mysql-cluster/VERSION | 14 +++++++------- mysql-router/VERSION | 6 +++--- mysql-server/VERSION | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/mysql-cluster/VERSION b/mysql-cluster/VERSION index 1d4462af0..980e4deb0 100644 --- a/mysql-cluster/VERSION +++ b/mysql-cluster/VERSION @@ -1,14 +1,14 @@ -IMAGE_VERSION=1.2.9-cluster +IMAGE_VERSION=1.2.10-cluster declare -A MYSQL_CLUSTER_VERSIONS -MYSQL_CLUSTER_VERSIONS["7.5"]=7.5.27 -MYSQL_CLUSTER_VERSIONS["7.6"]=7.6.23 -MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.30 +MYSQL_CLUSTER_VERSIONS["7.5"]=7.5.28 +MYSQL_CLUSTER_VERSIONS["7.6"]=7.6.24 +MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.31 declare -A MYSQL_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["7.5"]=8.0.30 -MYSQL_SHELL_VERSIONS["7.6"]=8.0.30 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.30 +MYSQL_SHELL_VERSIONS["7.5"]=8.0.31 +MYSQL_SHELL_VERSIONS["7.6"]=8.0.31 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.31 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["7.5"]="${MYSQL_CLUSTER_VERSIONS["7.5"]}-${IMAGE_VERSION}" diff --git a/mysql-router/VERSION b/mysql-router/VERSION index c1f15d8d5..36847c169 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -1,8 +1,8 @@ -IMAGE_VERSION=1.0.9-router +IMAGE_VERSION=1.0.10-router declare -A MYSQL_ROUTER_VERSIONS -MYSQL_ROUTER_VERSIONS["8.0"]=8.0.30 +MYSQL_ROUTER_VERSIONS["8.0"]=8.0.31 declare -A MYSQL_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["8.0"]=8.0.30 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.31 declare -A FULL_ROUTER_VERSIONS FULL_ROUTER_VERSIONS["8.0"]="${MYSQL_ROUTER_VERSIONS["8.0"]}-${IMAGE_VERSION}" diff --git a/mysql-server/VERSION b/mysql-server/VERSION index 33ef45185..93b4f011b 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,12 +1,12 @@ -IMAGE_VERSION=1.2.9-server +IMAGE_VERSION=1.2.10-server declare -A MYSQL_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["5.7"]=5.7.39 -MYSQL_SERVER_VERSIONS["8.0"]=8.0.30 +MYSQL_SERVER_VERSIONS["5.7"]=5.7.40 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.31 declare -A MYSQL_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["5.7"]=8.0.30 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.30 +MYSQL_SHELL_VERSIONS["5.7"]=8.0.31 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.31 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["5.7"]="${MYSQL_SERVER_VERSIONS["5.7"]}-${IMAGE_VERSION}" From eccf7a6ea484f94020d60ab1e8c76af542b44b65 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 12 Oct 2022 01:20:24 +0000 Subject: [PATCH 255/386] Release version 1.2.10-server * ET#75728: Bump versions for 8.0.31 community Docker releases --- mysql-server/5.7/Dockerfile | 4 ++-- mysql-server/5.7/docker-entrypoint.sh | 4 ++-- mysql-server/5.7/inspec/control.rb | 4 ++-- mysql-server/8.0/Dockerfile | 4 ++-- mysql-server/8.0/docker-entrypoint.sh | 4 ++-- mysql-server/8.0/inspec/control.rb | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/mysql-server/5.7/Dockerfile b/mysql-server/5.7/Dockerfile index e343def2d..c5d0df435 100644 --- a/mysql-server/5.7/Dockerfile +++ b/mysql-server/5.7/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.39 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.30 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.40 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.31 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ diff --git a/mysql-server/5.7/docker-entrypoint.sh b/mysql-server/5.7/docker-entrypoint.sh index 8be997ac4..eaaf989ac 100755 --- a/mysql-server/5.7/docker-entrypoint.sh +++ b/mysql-server/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.39-1.2.9-server" +echo "[Entrypoint] MySQL Docker Image 5.7.40-1.2.10-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 5.7.39-1.2.9-server" + echo "[Entrypoint] Starting MySQL 5.7.40-1.2.10-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/5.7/inspec/control.rb b/mysql-server/5.7/inspec/control.rb index c6b1c04cf..7f37eccb0 100644 --- a/mysql-server/5.7/inspec/control.rb +++ b/mysql-server/5.7/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '5.7.39.*' } + its ('version') { should match '5.7.40.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.30.*' } + its ('version') { should match '8.0.31.*' } end end diff --git a/mysql-server/8.0/Dockerfile b/mysql-server/8.0/Dockerfile index ff6032749..5bf623f2a 100644 --- a/mysql-server/8.0/Dockerfile +++ b/mysql-server/8.0/Dockerfile @@ -15,8 +15,8 @@ FROM oraclelinux:8-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.30 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.30 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.31 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.31 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-community-minimal-release-el8.rpm \ diff --git a/mysql-server/8.0/docker-entrypoint.sh b/mysql-server/8.0/docker-entrypoint.sh index f361f06fe..abbbf9f34 100755 --- a/mysql-server/8.0/docker-entrypoint.sh +++ b/mysql-server/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.30-1.2.9-server" +echo "[Entrypoint] MySQL Docker Image 8.0.31-1.2.10-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.30-1.2.9-server" + echo "[Entrypoint] Starting MySQL 8.0.31-1.2.10-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/8.0/inspec/control.rb b/mysql-server/8.0/inspec/control.rb index 605ff4ac6..ad2077f4d 100644 --- a/mysql-server/8.0/inspec/control.rb +++ b/mysql-server/8.0/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.30.*' } + its ('version') { should match '8.0.31.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.30.*' } + its ('version') { should match '8.0.31.*' } end end From c3c68c4d21e526868ae7daa4d5bd4f64bdaeadec Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 12 Oct 2022 04:30:07 +0000 Subject: [PATCH 256/386] Release version 1.2.10-cluster * ET#75728: Bump versions for 8.0.31 community Docker releases --- mysql-cluster/7.5/Dockerfile | 4 ++-- mysql-cluster/7.5/docker-entrypoint.sh | 4 ++-- mysql-cluster/7.5/inspec/control.rb | 4 ++-- mysql-cluster/7.6/Dockerfile | 4 ++-- mysql-cluster/7.6/docker-entrypoint.sh | 4 ++-- mysql-cluster/7.6/inspec/control.rb | 4 ++-- mysql-cluster/8.0/Dockerfile | 4 ++-- mysql-cluster/8.0/docker-entrypoint.sh | 4 ++-- mysql-cluster/8.0/inspec/control.rb | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/mysql-cluster/7.5/Dockerfile b/mysql-cluster/7.5/Dockerfile index bfaa70440..cfe0a5a8c 100644 --- a/mysql-cluster/7.5/Dockerfile +++ b/mysql-cluster/7.5/Dockerfile @@ -15,8 +15,8 @@ FROM oraclelinux:7-slim -ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.5.27 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.30 +ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.5.28 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.31 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el7.rpm \ diff --git a/mysql-cluster/7.5/docker-entrypoint.sh b/mysql-cluster/7.5/docker-entrypoint.sh index 4e9475874..0166babe6 100755 --- a/mysql-cluster/7.5/docker-entrypoint.sh +++ b/mysql-cluster/7.5/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 7.5.27-1.2.9-cluster" +echo "[Entrypoint] MySQL Docker Image 7.5.28-1.2.10-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -219,7 +219,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 7.5.27-1.2.9-cluster" + echo "[Entrypoint] Starting MySQL 7.5.28-1.2.10-cluster" fi exec "$@" --user=$MYSQLD_USER else diff --git a/mysql-cluster/7.5/inspec/control.rb b/mysql-cluster/7.5/inspec/control.rb index f6477baab..504a01846 100644 --- a/mysql-cluster/7.5/inspec/control.rb +++ b/mysql-cluster/7.5/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '7.5.27.*' } + its ('version') { should match '7.5.28.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.30.*' } + its ('version') { should match '8.0.31.*' } end end diff --git a/mysql-cluster/7.6/Dockerfile b/mysql-cluster/7.6/Dockerfile index c5682b29f..3c578377c 100644 --- a/mysql-cluster/7.6/Dockerfile +++ b/mysql-cluster/7.6/Dockerfile @@ -15,8 +15,8 @@ FROM oraclelinux:7-slim -ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.6.23 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.30 +ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.6.24 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.31 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el7.rpm \ diff --git a/mysql-cluster/7.6/docker-entrypoint.sh b/mysql-cluster/7.6/docker-entrypoint.sh index c090c1a1c..00195d7c0 100755 --- a/mysql-cluster/7.6/docker-entrypoint.sh +++ b/mysql-cluster/7.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 7.6.23-1.2.9-cluster" +echo "[Entrypoint] MySQL Docker Image 7.6.24-1.2.10-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -219,7 +219,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 7.6.23-1.2.9-cluster" + echo "[Entrypoint] Starting MySQL 7.6.24-1.2.10-cluster" fi exec "$@" --user=$MYSQLD_USER else diff --git a/mysql-cluster/7.6/inspec/control.rb b/mysql-cluster/7.6/inspec/control.rb index a88af4109..0ce2e2b15 100644 --- a/mysql-cluster/7.6/inspec/control.rb +++ b/mysql-cluster/7.6/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '7.6.23.*' } + its ('version') { should match '7.6.24.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.30.*' } + its ('version') { should match '8.0.31.*' } end end diff --git a/mysql-cluster/8.0/Dockerfile b/mysql-cluster/8.0/Dockerfile index d6f9ac4b7..1a267f04b 100644 --- a/mysql-cluster/8.0/Dockerfile +++ b/mysql-cluster/8.0/Dockerfile @@ -15,8 +15,8 @@ FROM oraclelinux:8-slim -ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-8.0.30 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.30 +ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-8.0.31 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.31 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el8.rpm \ diff --git a/mysql-cluster/8.0/docker-entrypoint.sh b/mysql-cluster/8.0/docker-entrypoint.sh index 37840a828..aa427c292 100755 --- a/mysql-cluster/8.0/docker-entrypoint.sh +++ b/mysql-cluster/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.30-1.2.9-cluster" +echo "[Entrypoint] MySQL Docker Image 8.0.31-1.2.10-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -219,7 +219,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.30-1.2.9-cluster" + echo "[Entrypoint] Starting MySQL 8.0.31-1.2.10-cluster" fi export MYSQLD_PARENT_PID=$$ ; exec "$@" --user= else diff --git a/mysql-cluster/8.0/inspec/control.rb b/mysql-cluster/8.0/inspec/control.rb index 1b9ad9e2f..677abcd7e 100644 --- a/mysql-cluster/8.0/inspec/control.rb +++ b/mysql-cluster/8.0/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.30.*' } + its ('version') { should match '8.0.31.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.30.*' } + its ('version') { should match '8.0.31.*' } end end From 044356f9958bbeb9409265495035431a0e3ab8bb Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 12 Oct 2022 04:41:17 +0000 Subject: [PATCH 257/386] Release version 1.0.10-router * ET#75728: Bump versions for 8.0.31 community Docker releases --- mysql-router/8.0/Dockerfile | 4 ++-- mysql-router/8.0/inspec/control.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-router/8.0/Dockerfile b/mysql-router/8.0/Dockerfile index a2a78b5f0..0088b430b 100644 --- a/mysql-router/8.0/Dockerfile +++ b/mysql-router/8.0/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:8-slim -ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.30 -ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.30 +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.31 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.31 RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ diff --git a/mysql-router/8.0/inspec/control.rb b/mysql-router/8.0/inspec/control.rb index 02f5ad8b4..5d0f8a0ae 100644 --- a/mysql-router/8.0/inspec/control.rb +++ b/mysql-router/8.0/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-community-client') do it { should be_installed } - its ('version') { should match '8.0.30.*' } + its ('version') { should match '8.0.31.*' } end describe package('mysql-router-community') do it { should be_installed } - its ('version') { should match '8.0.30.*' } + its ('version') { should match '8.0.31.*' } end end From 9fc941b1bcd1b20a0c0008c583c5c783da069bff Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 25 Oct 2022 11:47:33 +0200 Subject: [PATCH 258/386] Make build files more template friendly Add parameters for config packages, repo and package names Change-Id: Icf638bfe230714a26370c0c15c1d9e6ce79019b6 --- mysql-server/gen_dockerfiles.sh | 26 ++++++++++++++++++++++++-- mysql-server/template/Dockerfile | 8 ++++---- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/mysql-server/gen_dockerfiles.sh b/mysql-server/gen_dockerfiles.sh index a338d4112..4ccb4b9cc 100755 --- a/mysql-server/gen_dockerfiles.sh +++ b/mysql-server/gen_dockerfiles.sh @@ -22,7 +22,14 @@ set -e source ./VERSION REPO=https://repo.mysql.com; [ -n "$1" ] && REPO=$1 +CONFIG_PACKAGE_NAME=mysql80-community-release-el8.rpm; [ -n "$2" ] && CONFIG_PACKAGE_NAME=$2 +CONFIG_PACKAGE_NAME_MINIMAL=mysql-community-minimal-release-el8.rpm; [ -n "$3" ] && CONFIG_PACKAGE_NAME_MINIMAL=$3 +REPO_NAME_SERVER=mysql80-community-minimal; [ -n "$4" ] && REPO_NAME_SERVER=$4 +REPO_NAME_TOOLS=mysql-tools-community; [ -n "$5" ] && REPO_NAME_TOOLS=$5 + +MYSQL_SERVER_PACKAGE_OVERRIDE=""; [ -n "$6" ] && MYSQL_SERVER_PACKAGE_OVERRIDE=$6 +MYSQL_SHELL_PACKAGE_OVERRIDE=""; [ -n "$7" ] && MYSQL_SHELL_PACKAGE_OVERRIDE=$7 # 33060 is the default port for the mysqlx plugin, new to 5.7 declare -A PORTS PORTS["5.7"]="3306 33060" @@ -45,19 +52,34 @@ PRECREATE_DIRS["8.0"]="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyrin for VERSION in "${!MYSQL_SERVER_VERSIONS[@]}" do + if [ -z "${MYSQL_SERVER_PACKAGE_OVERRIDE}" ]; then + MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-${MYSQL_SERVER_VERSIONS[${VERSION}]} + else + MYSQL_SERVER_PACKAGE=${MYSQL_SERVER_PACKAGE_OVERRIDE} + fi + if [ -z "${MYSQL_SHELL_PACKAGE_OVERRIDE}" ]; then + MYSQL_SHELL_PACKAGE=mysql-shell-${MYSQL_SHELL_VERSIONS[${VERSION}]} + else + MYSQL_SHELL_PACKAGE=${MYSQL_SHELL_PACKAGE_OVERRIDE} + fi # Dockerfiles MYSQL_SERVER_REPOPATH=yum/mysql-$VERSION-community/docker/x86_64 DOCKERFILE_TEMPLATE=template/Dockerfile if [ "${VERSION}" != "8.0" ]; then DOCKERFILE_TEMPLATE=template/Dockerfile-pre8 fi - sed 's#%%MYSQL_SERVER_PACKAGE%%#'"mysql-community-server-minimal-${MYSQL_SERVER_VERSIONS[${VERSION}]}"'#g' $DOCKERFILE_TEMPLATE > tmpfile + sed 's#%%MYSQL_SERVER_PACKAGE%%#'"${MYSQL_SERVER_PACKAGE}"'#g' $DOCKERFILE_TEMPLATE > tmpfile sed -i 's#%%REPO%%#'"${REPO}"'#g' tmpfile REPO_VERSION=${VERSION//\./} sed -i 's#%%REPO_VERSION%%#'"${REPO_VERSION}"'#g' tmpfile + sed -i 's#%%CONFIG_PACKAGE_NAME%%#'"${CONFIG_PACKAGE_NAME}"'#g' tmpfile + sed -i 's#%%CONFIG_PACKAGE_NAME_MINIMAL%%#'"${CONFIG_PACKAGE_NAME_MINIMAL}"'#g' tmpfile + sed -i 's#%%REPO_NAME_SERVER%%#'"${REPO_NAME_SERVER}"'#g' tmpfile + sed -i 's#%%REPO_NAME_TOOLS%%#'"${REPO_NAME_TOOLS}"'#g' tmpfile + if [[ ! -z ${MYSQL_SHELL_VERSIONS[${VERSION}]} ]]; then - sed -i 's#%%MYSQL_SHELL_PACKAGE%%#'"mysql-shell-${MYSQL_SHELL_VERSIONS[${VERSION}]}"'#g' tmpfile + sed -i 's#%%MYSQL_SHELL_PACKAGE%%#'"${MYSQL_SHELL_PACKAGE}"'#g' tmpfile else sed -i 's#%%MYSQL_SHELL_PACKAGE%%#'""'#g' tmpfile fi diff --git a/mysql-server/template/Dockerfile b/mysql-server/template/Dockerfile index e1612a911..7d337bcfb 100644 --- a/mysql-server/template/Dockerfile +++ b/mysql-server/template/Dockerfile @@ -19,14 +19,14 @@ ARG MYSQL_SERVER_PACKAGE=%%MYSQL_SERVER_PACKAGE%% ARG MYSQL_SHELL_PACKAGE=%%MYSQL_SHELL_PACKAGE%% # Setup repositories for minimal packages (all versions) -RUN rpm -U %%REPO%%/mysql-community-minimal-release-el8.rpm \ - && rpm -U %%REPO%%/mysql80-community-release-el8.rpm +RUN rpm -U %%REPO%%/%%CONFIG_PACKAGE_NAME_MINIMAL%% \ + && rpm -U %%REPO%%/%%CONFIG_PACKAGE_NAME%% # Install server and shell 8.0 RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ - && microdnf install -y $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --enablerepo=%%REPO_NAME_TOOLS%% $MYSQL_SHELL_PACKAGE \ && microdnf install -y --disablerepo=ol8_appstream \ - --enablerepo=mysql%%REPO_VERSION%%-server-minimal $MYSQL_SERVER_PACKAGE \ + --enablerepo=%%REPO_NAME_SERVER%% $MYSQL_SERVER_PACKAGE \ && microdnf clean all \ && mkdir /docker-entrypoint-initdb.d From 28f260584ceff725f1f9b144207183a5d1a8c84e Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Fri, 28 Oct 2022 10:25:46 +0200 Subject: [PATCH 259/386] Separate package name and version in templating Allows us to use different server packages and versions with the same template Change-Id: I83a7e62da067f67d9185d146459b977073f13130 --- mysql-server/gen_dockerfiles.sh | 23 +++++++++++++---------- mysql-server/template/control.rb | 16 ++++++++++++---- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/mysql-server/gen_dockerfiles.sh b/mysql-server/gen_dockerfiles.sh index 4ccb4b9cc..f093e9c1c 100755 --- a/mysql-server/gen_dockerfiles.sh +++ b/mysql-server/gen_dockerfiles.sh @@ -28,8 +28,9 @@ CONFIG_PACKAGE_NAME_MINIMAL=mysql-community-minimal-release-el8.rpm; [ -n "$3" ] REPO_NAME_SERVER=mysql80-community-minimal; [ -n "$4" ] && REPO_NAME_SERVER=$4 REPO_NAME_TOOLS=mysql-tools-community; [ -n "$5" ] && REPO_NAME_TOOLS=$5 -MYSQL_SERVER_PACKAGE_OVERRIDE=""; [ -n "$6" ] && MYSQL_SERVER_PACKAGE_OVERRIDE=$6 -MYSQL_SHELL_PACKAGE_OVERRIDE=""; [ -n "$7" ] && MYSQL_SHELL_PACKAGE_OVERRIDE=$7 +MYSQL_SERVER_PACKAGE_NAME="mysql-community-server-minimal"; [ -n "$6" ] && MYSQL_SERVER_PACKAGE_NAME=$6 +MYSQL_SHELL_PACKAGE_NAME="mysql-shell"; [ -n "$7" ] && MYSQL_SHELL_PACKAGE_NAME=$7 +MYSQL_VERSION=""; [ -n "$8" ] && MYSQL_VERSION=$8 # 33060 is the default port for the mysqlx plugin, new to 5.7 declare -A PORTS PORTS["5.7"]="3306 33060" @@ -52,15 +53,14 @@ PRECREATE_DIRS["8.0"]="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyrin for VERSION in "${!MYSQL_SERVER_VERSIONS[@]}" do - if [ -z "${MYSQL_SERVER_PACKAGE_OVERRIDE}" ]; then - MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-${MYSQL_SERVER_VERSIONS[${VERSION}]} + if [ -n "${MYSQL_VERSION}" ]; then + MYSQL_SERVER_PACKAGE=${MYSQL_SERVER_PACKAGE_NAME}-${MYSQL_VERSION} + MYSQL_SHELL_PACKAGE=${MYSQL_SHELL_PACKAGE_NAME}-${MYSQL_VERSION} + TEST_VERSION="true" else - MYSQL_SERVER_PACKAGE=${MYSQL_SERVER_PACKAGE_OVERRIDE} - fi - if [ -z "${MYSQL_SHELL_PACKAGE_OVERRIDE}" ]; then - MYSQL_SHELL_PACKAGE=mysql-shell-${MYSQL_SHELL_VERSIONS[${VERSION}]} - else - MYSQL_SHELL_PACKAGE=${MYSQL_SHELL_PACKAGE_OVERRIDE} + MYSQL_SERVER_PACKAGE=${MYSQL_SERVER_PACKAGE_NAME} + MYSQL_SHELL_PACKAGE=${MYSQL_SHELL_PACKAGE_NAME} + TEST_VERSION="false" fi # Dockerfiles MYSQL_SERVER_REPOPATH=yum/mysql-$VERSION-community/docker/x86_64 @@ -93,6 +93,9 @@ do fi sed 's#%%MYSQL_SERVER_VERSION%%#'"${MYSQL_SERVER_VERSIONS[${VERSION}]}"'#g' template/control.rb > tmpFile sed -i 's#%%MYSQL_SHELL_VERSION%%#'"${MYSQL_SHELL_VERSIONS[${VERSION}]}"'#g' tmpFile + sed -i 's#%%MYSQL_SERVER_PACKAGE_NAME%%#'"${MYSQL_SERVER_PACKAGE_NAME}"'#g' tmpFile + sed -i 's#%%MYSQL_SHELL_PACKAGE_NAME%%#'"${MYSQL_SHELL_PACKAGE_NAME}"'#g' tmpFile + sed -i 's#%%TEST_VERSION%%#'"${TEST_VERSION}"'#g' tmpFile sed -i 's#%%MAJOR_VERSION%%#'"${VERSION}"'#g' tmpFile if [ "${VERSION}" == "5.7" ]; then sed -i 's#%%PORTS%%#'"3306/tcp, 33060/tcp"'#g' tmpFile diff --git a/mysql-server/template/control.rb b/mysql-server/template/control.rb index e881f6eee..1dd835796 100644 --- a/mysql-server/template/control.rb +++ b/mysql-server/template/control.rb @@ -8,14 +8,22 @@ its('command') { should match '/entrypoint.sh mysqld' } end end -control 'packages' do +control 'packages installed' do impact 0.5 - describe package('mysql-community-server-minimal') do + describe package('%%MYSQL_SERVER_PACKAGE_NAME%%') do it { should be_installed } - its ('version') { should match '%%MYSQL_SERVER_VERSION%%.*' } end - describe package('mysql-shell') do + describe package('%%MYSQL_SHELL_PACKAGE_NAME%%') do it { should be_installed } + end +end +control 'packages correct version' do + impact 0.5 + describe package('%%MYSQL_SERVER_PACKAGE_NAME%%') do + its ('version') { should match '%%MYSQL_SERVER_VERSION%%.*' } + end + describe package('%%MYSQL_SHELL_PACKAGE_NAME%%') do its ('version') { should match '%%MYSQL_SHELL_VERSION%%.*' } end + only_if {%%TEST_VERSION%%} end From ff10d8dffdf20d82e42954c37891edb8791d2337 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Fri, 28 Oct 2022 11:23:31 +0200 Subject: [PATCH 260/386] Use specified version directly when testing If version isn't specified (is empty), the test will simply match all versions. Change-Id: I73ac9e9974bcfcaa327bdc2737234bab4c9a5153 --- mysql-server/gen_dockerfiles.sh | 6 +----- mysql-server/template/control.rb | 14 +++----------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/mysql-server/gen_dockerfiles.sh b/mysql-server/gen_dockerfiles.sh index f093e9c1c..dcb2af0fc 100755 --- a/mysql-server/gen_dockerfiles.sh +++ b/mysql-server/gen_dockerfiles.sh @@ -56,11 +56,9 @@ do if [ -n "${MYSQL_VERSION}" ]; then MYSQL_SERVER_PACKAGE=${MYSQL_SERVER_PACKAGE_NAME}-${MYSQL_VERSION} MYSQL_SHELL_PACKAGE=${MYSQL_SHELL_PACKAGE_NAME}-${MYSQL_VERSION} - TEST_VERSION="true" else MYSQL_SERVER_PACKAGE=${MYSQL_SERVER_PACKAGE_NAME} MYSQL_SHELL_PACKAGE=${MYSQL_SHELL_PACKAGE_NAME} - TEST_VERSION="false" fi # Dockerfiles MYSQL_SERVER_REPOPATH=yum/mysql-$VERSION-community/docker/x86_64 @@ -91,11 +89,9 @@ do if [ ! -d "${VERSION}/inspec" ]; then mkdir "${VERSION}/inspec" fi - sed 's#%%MYSQL_SERVER_VERSION%%#'"${MYSQL_SERVER_VERSIONS[${VERSION}]}"'#g' template/control.rb > tmpFile - sed -i 's#%%MYSQL_SHELL_VERSION%%#'"${MYSQL_SHELL_VERSIONS[${VERSION}]}"'#g' tmpFile + sed 's#%%MYSQL_VERSION%%#'"${MYSQL_VERSION}"'#g' template/control.rb > tmpFile sed -i 's#%%MYSQL_SERVER_PACKAGE_NAME%%#'"${MYSQL_SERVER_PACKAGE_NAME}"'#g' tmpFile sed -i 's#%%MYSQL_SHELL_PACKAGE_NAME%%#'"${MYSQL_SHELL_PACKAGE_NAME}"'#g' tmpFile - sed -i 's#%%TEST_VERSION%%#'"${TEST_VERSION}"'#g' tmpFile sed -i 's#%%MAJOR_VERSION%%#'"${VERSION}"'#g' tmpFile if [ "${VERSION}" == "5.7" ]; then sed -i 's#%%PORTS%%#'"3306/tcp, 33060/tcp"'#g' tmpFile diff --git a/mysql-server/template/control.rb b/mysql-server/template/control.rb index 1dd835796..3cb042983 100644 --- a/mysql-server/template/control.rb +++ b/mysql-server/template/control.rb @@ -8,22 +8,14 @@ its('command') { should match '/entrypoint.sh mysqld' } end end -control 'packages installed' do +control 'packages' do impact 0.5 describe package('%%MYSQL_SERVER_PACKAGE_NAME%%') do it { should be_installed } + its ('version') { should match '%%MYSQL_VERSION%%.*' } end describe package('%%MYSQL_SHELL_PACKAGE_NAME%%') do it { should be_installed } + its ('version') { should match '%%MYSQL_VERSION%%.*' } end end -control 'packages correct version' do - impact 0.5 - describe package('%%MYSQL_SERVER_PACKAGE_NAME%%') do - its ('version') { should match '%%MYSQL_SERVER_VERSION%%.*' } - end - describe package('%%MYSQL_SHELL_PACKAGE_NAME%%') do - its ('version') { should match '%%MYSQL_SHELL_VERSION%%.*' } - end - only_if {%%TEST_VERSION%%} -end From 58763c4ed717ccafa2a1ebd17063414105b428bf Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 29 Nov 2022 09:58:47 +0100 Subject: [PATCH 261/386] Update mysql-cluster templating to be more generic This will allow us to more easily set up various builds such as community/commercial/pre-release, etc. from concourse. Change-Id: Icb6356291a486a0fe6c0284b7e4a165afac94d7b --- mysql-cluster/gen_dockerfiles.sh | 57 ++++++++++++++------- mysql-cluster/template/Dockerfile | 12 ++--- mysql-cluster/template/control.rb | 10 ++-- mysql-cluster/template/docker-entrypoint.sh | 15 ++++-- 4 files changed, 62 insertions(+), 32 deletions(-) diff --git a/mysql-cluster/gen_dockerfiles.sh b/mysql-cluster/gen_dockerfiles.sh index 24e328b4e..35416239b 100755 --- a/mysql-cluster/gen_dockerfiles.sh +++ b/mysql-cluster/gen_dockerfiles.sh @@ -22,7 +22,20 @@ set -e source ./VERSION REPO=https://repo.mysql.com; [ -n "$1" ] && REPO=$1 -REPO_NAME=mysql; [ -n "$2" ] && REPO_NAME=$2 +CONFIG_PACKAGE_NAME=mysql80-community-release-el8.rpm; [ -n "$2" ] && CONFIG_PACKAGE_NAME=$2 +CONFIG_PACKAGE_NAME_MINIMAL=mysql-cluster-community-minimal-release-el8.rpm; [ -n "$3" ] && CONFIG_PACKAGE_NAME_MINIMAL=$3 + +REPO_NAME_SERVER=mysql-cluster80-community-minimal; [ -n "$4" ] && REPO_NAME_SERVER=$4 +REPO_NAME_TOOLS=mysql-tools-community; [ -n "$5" ] && REPO_NAME_TOOLS=$5 + +MYSQL_SERVER_PACKAGE_NAME="mysql-cluster-community-server-minimal"; [ -n "$6" ] && MYSQL_SERVER_PACKAGE_NAME=$6 +MYSQL_SHELL_PACKAGE_NAME="mysql-shell"; [ -n "$7" ] && MYSQL_SHELL_PACKAGE_NAME=$7 +MYSQL_VERSION=""; [ -n "$8" ] && MYSQL_VERSION=$8 + +declare -A PORTS +PORTS["7.5"]="3306 33060 2202 1186" +PORTS["7.6"]="3306 33060 2202 1186" +PORTS["8.0"]="3306 33060-33061 2202 1186" declare -A PASSWORDSET PASSWORDSET["7.5"]="ALTER USER 'root'@'localhost' IDENTIFIED BY '\${MYSQL_ROOT_PASSWORD}';" @@ -34,18 +47,12 @@ DATABASE_INIT["7.5"]="\"\$@\" --user=\$MYSQLD_USER --initialize-insecure" DATABASE_INIT["7.6"]="\"\$@\" --user=\$MYSQLD_USER --initialize-insecure" DATABASE_INIT["8.0"]="\"\$@\" --user=\$MYSQLD_USER --initialize-insecure" -# 5.7+ has the --daemonize flag, which makes the process fork and then exit when -# the server is ready, removing the need for a fragile wait loop -declare -A INIT_STARTUP -INIT_STARTUP["7.5"]="\"\$@\" --user=\$MYSQLD_USER --daemonize --skip-networking --socket=\"\$SOCKET\"" -INIT_STARTUP["7.6"]="\"\$@\" --user=\$MYSQLD_USER --daemonize --skip-networking --socket=\"\$SOCKET\"" -INIT_STARTUP["8.0"]="\"\$@\" --user=\$MYSQLD_USER --daemonize --skip-networking --socket=\"\$SOCKET\"" - declare -A STARTUP STARTUP["7.5"]="exec \"\$@\" --user=\$MYSQLD_USER" STARTUP["7.6"]="exec \"\$@\" --user=\$MYSQLD_USER" STARTUP["8.0"]="export MYSQLD_PARENT_PID=\$\$ ; exec \"\$@\" --user=$MYSQLD_USER" + declare -A STARTUP_WAIT STARTUP_WAIT["7.5"]="\"\"" STARTUP_WAIT["7.6"]="\"\"" @@ -66,41 +73,55 @@ PRECREATE_DIRS["8.0"]="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyrin for VERSION in "${!MYSQL_CLUSTER_VERSIONS[@]}" do + if [ -n "${MYSQL_VERSION}" ]; then + MYSQL_SERVER_PACKAGE=${MYSQL_SERVER_PACKAGE_NAME}-${MYSQL_VERSION} + MYSQL_SHELL_PACKAGE=${MYSQL_SHELL_PACKAGE_NAME}-${MYSQL_VERSION} + else + MYSQL_SERVER_PACKAGE=${MYSQL_SERVER_PACKAGE_NAME} + MYSQL_SHELL_PACKAGE=${MYSQL_SHELL_PACKAGE_NAME} + fi # Dockerfiles - MYSQL_CLUSTER_REPOPATH=yum/mysql-$VERSION-community/docker/x86_64 + MYSQL_SERVER_REPOPATH=yum/mysql-$VERSION-community/docker/x86_64 DOCKERFILE_TEMPLATE=template/Dockerfile if [ "${VERSION}" != "8.0" ]; then DOCKERFILE_TEMPLATE=template/Dockerfile-pre8 fi - sed 's#%%MYSQL_CLUSTER_PACKAGE%%#'"mysql-cluster-community-server-minimal-${MYSQL_CLUSTER_VERSIONS[${VERSION}]}"'#g' $DOCKERFILE_TEMPLATE > tmpfile + sed 's#%%MYSQL_SERVER_PACKAGE%%#'"${MYSQL_SERVER_PACKAGE}"'#g' $DOCKERFILE_TEMPLATE > tmpfile sed -i 's#%%REPO%%#'"${REPO}"'#g' tmpfile - sed -i 's#%%REPO_NAME%%#'"${REPO_NAME}"'#g' tmpfile REPO_VERSION=${VERSION//\./} sed -i 's#%%REPO_VERSION%%#'"${REPO_VERSION}"'#g' tmpfile + sed -i 's#%%CONFIG_PACKAGE_NAME%%#'"${CONFIG_PACKAGE_NAME}"'#g' tmpfile + sed -i 's#%%CONFIG_PACKAGE_NAME_MINIMAL%%#'"${CONFIG_PACKAGE_NAME_MINIMAL}"'#g' tmpfile + sed -i 's#%%REPO_NAME_SERVER%%#'"${REPO_NAME_SERVER}"'#g' tmpfile + sed -i 's#%%REPO_NAME_TOOLS%%#'"${REPO_NAME_TOOLS}"'#g' tmpfile + if [[ ! -z ${MYSQL_SHELL_VERSIONS[${VERSION}]} ]]; then - sed -i 's#%%MYSQL_SHELL_PACKAGE%%#'"mysql-shell-${MYSQL_SHELL_VERSIONS[${VERSION}]}"'#g' tmpfile + sed -i 's#%%MYSQL_SHELL_PACKAGE%%#'"${MYSQL_SHELL_PACKAGE}"'#g' tmpfile else sed -i 's#%%MYSQL_SHELL_PACKAGE%%#'""'#g' tmpfile fi + sed -i 's/%%PORTS%%/'"${PORTS[${VERSION}]}"'/g' tmpfile mv tmpfile ${VERSION}/Dockerfile # Dockerfile_spec.rb if [ ! -d "${VERSION}/inspec" ]; then mkdir "${VERSION}/inspec" fi - sed 's#%%MYSQL_CLUSTER_VERSION%%#'"${MYSQL_CLUSTER_VERSIONS[${VERSION}]}"'#g' template/control.rb > tmpFile - sed -i 's#%%MYSQL_SHELL_VERSION%%#'"${MYSQL_SHELL_VERSIONS[${VERSION}]}"'#g' tmpFile + sed 's#%%MYSQL_VERSION%%#'"${MYSQL_VERSION}"'#g' template/control.rb > tmpFile + sed -i 's#%%MYSQL_SERVER_PACKAGE_NAME%%#'"${MYSQL_SERVER_PACKAGE_NAME}"'#g' tmpFile + sed -i 's#%%MYSQL_SHELL_PACKAGE_NAME%%#'"${MYSQL_SHELL_PACKAGE_NAME}"'#g' tmpFile sed -i 's#%%MAJOR_VERSION%%#'"${VERSION}"'#g' tmpFile + if [ "${VERSION}" == "8.0" ]; then + sed -i 's#%%PORTS%%#'"1186/tcp, 2202/tcp, 3306/tcp, 33060-33061/tcp"'#g' tmpFile + else + sed -i 's#%%PORTS%%#'"1186/tcp, 2202/tcp, 3306/tcp"'#g' tmpFile + fi mv tmpFile "${VERSION}/inspec/control.rb" # Entrypoint sed 's#%%PASSWORDSET%%#'"${PASSWORDSET[${VERSION}]}"'#g' template/docker-entrypoint.sh > tmpfile - sed -i 's#%%DATABASE_INIT%%#'"${DATABASE_INIT[${VERSION}]}"'#g' tmpfile - sed -i 's#%%INIT_STARTUP%%#'"${INIT_STARTUP[${VERSION}]}"'#g' tmpfile - sed -i 's#%%STARTUP%%#'"${STARTUP[${VERSION}]}"'#g' tmpfile - sed -i 's#%%STARTUP_WAIT%%#'"${STARTUP_WAIT[${VERSION}]}"'#g' tmpfile sed -i 's#%%FULL_SERVER_VERSION%%#'"${FULL_SERVER_VERSIONS[${VERSION}]}"'#g' tmpfile sed -i 's#%%VALIDATE_CONFIG%%#'"${VALIDATE_CONFIG[${VERSION}]}"'#g' tmpfile mv tmpfile ${VERSION}/docker-entrypoint.sh diff --git a/mysql-cluster/template/Dockerfile b/mysql-cluster/template/Dockerfile index 829d1b601..a0bca2493 100644 --- a/mysql-cluster/template/Dockerfile +++ b/mysql-cluster/template/Dockerfile @@ -15,18 +15,18 @@ FROM oraclelinux:8-slim -ARG MYSQL_CLUSTER_PACKAGE=%%MYSQL_CLUSTER_PACKAGE%% +ARG MYSQL_SERVER_PACKAGE=%%MYSQL_SERVER_PACKAGE%% ARG MYSQL_SHELL_PACKAGE=%%MYSQL_SHELL_PACKAGE%% # Setup repositories for minimal packages (all versions) -RUN rpm -U %%REPO%%/mysql-cluster-community-minimal-release-el8.rpm \ - && rpm -U %%REPO%%/mysql80-community-release-el8.rpm +RUN rpm -U %%REPO%%/%%CONFIG_PACKAGE_NAME_MINIMAL%% \ + && rpm -U %%REPO%%/%%CONFIG_PACKAGE_NAME%% # Install server and shell 8.0 RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ - && microdnf install -y $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --enablerepo=%%REPO_NAME_TOOLS%% $MYSQL_SHELL_PACKAGE \ && microdnf install -y --disablerepo=ol8_appstream \ - --enablerepo=%%REPO_NAME%%-cluster%%REPO_VERSION%%-minimal $MYSQL_CLUSTER_PACKAGE \ + --enablerepo=%%REPO_NAME_SERVER%% $MYSQL_SERVER_PACKAGE \ && microdnf clean all \ && mkdir /docker-entrypoint-initdb.d @@ -42,6 +42,6 @@ COPY cnf/mysql-cluster.cnf /etc/ ENTRYPOINT ["/entrypoint.sh"] HEALTHCHECK CMD /healthcheck.sh -EXPOSE 3306 33060 2202 1186 +EXPOSE %%PORTS%% CMD ["mysqld"] diff --git a/mysql-cluster/template/control.rb b/mysql-cluster/template/control.rb index 8e5d95df2..7b5ce76ad 100644 --- a/mysql-cluster/template/control.rb +++ b/mysql-cluster/template/control.rb @@ -4,18 +4,18 @@ it { should exist } it { should be_running } its('repo') { should eq 'mysql/mysql-cluster' } - its('ports') { should eq '1186/tcp, 2202/tcp, 3306/tcp, 33060/tcp' } + its('ports') { should eq '%%PORTS%%' } its('command') { should match '/entrypoint.sh.*' } end end control 'packages' do impact 0.5 - describe package('mysql-cluster-community-server-minimal') do + describe package('%%MYSQL_SERVER_PACKAGE_NAME%%') do it { should be_installed } - its ('version') { should match '%%MYSQL_CLUSTER_VERSION%%.*' } + its ('version') { should match '%%MYSQL_VERSION%%.*' } end - describe package('mysql-shell') do + describe package('%%MYSQL_SHELL_PACKAGE_NAME%%') do it { should be_installed } - its ('version') { should match '%%MYSQL_SHELL_VERSION%%.*' } + its ('version') { should match '%%MYSQL_VERSION%%.*' } end end diff --git a/mysql-cluster/template/docker-entrypoint.sh b/mysql-cluster/template/docker-entrypoint.sh index 8c0259c38..9ae1ead34 100644 --- a/mysql-cluster/template/docker-entrypoint.sh +++ b/mysql-cluster/template/docker-entrypoint.sh @@ -86,11 +86,20 @@ if [ "$1" = 'mysqld' ]; then chown mysql:mysql "$DATADIR" fi + + # The user can set a default_timezone either in a my.cnf file + # they mount into the container or on command line + # (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`) + # however the timezone tables will only be populated in a later + # stage of this script. By using +00:00 as timezone we override + # the user's choice during initialization. Later the server + # will be restarted using the user's option. + echo '[Entrypoint] Initializing database' - %%DATABASE_INIT%% - echo '[Entrypoint] Database initialized' + "$@" --user=$MYSQLD_USER --initialize-insecure --default-time-zone=+00:00 - %%INIT_STARTUP%% + echo '[Entrypoint] Database initialized' + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" --default-time-zone=+00:00 # To avoid using password on commandline, put it in a temporary file. # The file is only populated when and if the root password is set. From 51774108b9a8e78e9f0901481f333152d7519310 Mon Sep 17 00:00:00 2001 From: Karen Langford Date: Thu, 1 Dec 2022 09:20:55 +0100 Subject: [PATCH 262/386] ET#76622: Bump versions for 8.0.32 Docker releases Change-Id: Ie5d47fc7c86b59ed65aa744ebfd218cdfc5c63b1 --- mysql-cluster/VERSION | 14 +++++++------- mysql-router/VERSION | 6 +++--- mysql-server/VERSION | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/mysql-cluster/VERSION b/mysql-cluster/VERSION index 980e4deb0..1b6fcca48 100644 --- a/mysql-cluster/VERSION +++ b/mysql-cluster/VERSION @@ -1,14 +1,14 @@ -IMAGE_VERSION=1.2.10-cluster +IMAGE_VERSION=1.2.11-cluster declare -A MYSQL_CLUSTER_VERSIONS -MYSQL_CLUSTER_VERSIONS["7.5"]=7.5.28 -MYSQL_CLUSTER_VERSIONS["7.6"]=7.6.24 -MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.31 +MYSQL_CLUSTER_VERSIONS["7.5"]=7.5.29 +MYSQL_CLUSTER_VERSIONS["7.6"]=7.6.25 +MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.32 declare -A MYSQL_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["7.5"]=8.0.31 -MYSQL_SHELL_VERSIONS["7.6"]=8.0.31 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.31 +MYSQL_SHELL_VERSIONS["7.5"]=8.0.32 +MYSQL_SHELL_VERSIONS["7.6"]=8.0.32 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.32 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["7.5"]="${MYSQL_CLUSTER_VERSIONS["7.5"]}-${IMAGE_VERSION}" diff --git a/mysql-router/VERSION b/mysql-router/VERSION index 36847c169..59ed83807 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -1,8 +1,8 @@ -IMAGE_VERSION=1.0.10-router +IMAGE_VERSION=1.0.11-router declare -A MYSQL_ROUTER_VERSIONS -MYSQL_ROUTER_VERSIONS["8.0"]=8.0.31 +MYSQL_ROUTER_VERSIONS["8.0"]=8.0.32 declare -A MYSQL_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["8.0"]=8.0.31 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.32 declare -A FULL_ROUTER_VERSIONS FULL_ROUTER_VERSIONS["8.0"]="${MYSQL_ROUTER_VERSIONS["8.0"]}-${IMAGE_VERSION}" diff --git a/mysql-server/VERSION b/mysql-server/VERSION index 93b4f011b..f7d8b04de 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,12 +1,12 @@ -IMAGE_VERSION=1.2.10-server +IMAGE_VERSION=1.2.11-server declare -A MYSQL_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["5.7"]=5.7.40 -MYSQL_SERVER_VERSIONS["8.0"]=8.0.31 +MYSQL_SERVER_VERSIONS["5.7"]=5.7.41 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.32 declare -A MYSQL_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["5.7"]=8.0.31 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.31 +MYSQL_SHELL_VERSIONS["5.7"]=8.0.32 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.32 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["5.7"]="${MYSQL_SERVER_VERSIONS["5.7"]}-${IMAGE_VERSION}" From 9cf91bb9ca4ac069754c5488b4b1ec283909fa13 Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Fri, 2 Dec 2022 08:02:10 +0100 Subject: [PATCH 263/386] ET#76622 - Fix the repo name for Server 5.7.41 docker builds Change-Id: I407b47c0a3a772644fe0cd3f369a80ea7f945b6f --- mysql-server/template/Dockerfile-pre8 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-server/template/Dockerfile-pre8 b/mysql-server/template/Dockerfile-pre8 index be209fe18..eb8172bc7 100644 --- a/mysql-server/template/Dockerfile-pre8 +++ b/mysql-server/template/Dockerfile-pre8 @@ -1,4 +1,4 @@ -# Copyright (c) 2017, 2021, Oracle and/or its affiliates. +# Copyright (c) 2017, 2022, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -23,7 +23,7 @@ RUN rpm -U %%REPO%%/mysql-community-minimal-release-el7.rpm \ # Install server and shell 8.0 RUN yum install -y $MYSQL_SHELL_PACKAGE \ - && yum install -y $MYSQL_SERVER_PACKAGE --enablerepo=mysql57-server-minimal\ + && yum install -y $MYSQL_SERVER_PACKAGE --enablerepo=mysql57-community-minimal\ && yum clean all \ && mkdir /docker-entrypoint-initdb.d From c417fbcc59748d318dc89d25a3481f89338cc811 Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Mon, 5 Dec 2022 08:16:31 +0100 Subject: [PATCH 264/386] ET#76622 - Fix the Cluster 7.x community docker builds Change-Id: I5bb6750975cab1a5203794da5ddfff3076923443 --- mysql-cluster/template/Dockerfile-pre8 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-cluster/template/Dockerfile-pre8 b/mysql-cluster/template/Dockerfile-pre8 index 25afea460..4efab2902 100644 --- a/mysql-cluster/template/Dockerfile-pre8 +++ b/mysql-cluster/template/Dockerfile-pre8 @@ -15,7 +15,7 @@ FROM oraclelinux:7-slim -ARG MYSQL_CLUSTER_PACKAGE=%%MYSQL_CLUSTER_PACKAGE%% +ARG MYSQL_SERVER_PACKAGE=%%MYSQL_SERVER_PACKAGE%% ARG MYSQL_SHELL_PACKAGE=%%MYSQL_SHELL_PACKAGE%% # Setup repositories for minimal packages (all versions) @@ -24,7 +24,7 @@ RUN rpm -U %%REPO%%/mysql-cluster-community-minimal-release-el7.rpm \ # Install server and shell 8.0 RUN yum install -y $MYSQL_SHELL_PACKAGE \ - && yum install -y $MYSQL_CLUSTER_PACKAGE --enablerepo=%%REPO_NAME%%-cluster%%REPO_VERSION%%-minimal\ + && yum install -y $MYSQL_SERVER_PACKAGE --enablerepo=mysql-cluster%%REPO_VERSION%%-community-minimal\ && yum clean all \ && mkdir /docker-entrypoint-initdb.d From 1b50727af2d3582d9c77ccc89c1467ffe4040c29 Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Mon, 5 Dec 2022 08:45:52 +0100 Subject: [PATCH 265/386] Fix the ports for Cluster 7.x docker release Change-Id: I2a33312aad336d2e964398af758ac0f5da4549e3 --- mysql-cluster/template/Dockerfile-pre8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-cluster/template/Dockerfile-pre8 b/mysql-cluster/template/Dockerfile-pre8 index 4efab2902..4edc96cf2 100644 --- a/mysql-cluster/template/Dockerfile-pre8 +++ b/mysql-cluster/template/Dockerfile-pre8 @@ -40,6 +40,6 @@ COPY cnf/mysql-cluster.cnf /etc/ ENTRYPOINT ["/entrypoint.sh"] HEALTHCHECK CMD /healthcheck.sh -EXPOSE 3306 33060 2202 1186 +EXPOSE %%PORTS%% CMD ["mysqld"] From f1f30e3a43089774a3dfce1ae2eda7ad8c71c166 Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Mon, 5 Dec 2022 09:06:53 +0100 Subject: [PATCH 266/386] Follow-up fix: Update the ports for Cluster 7.x docker release Change-Id: I43f084e7197f5100bd145eb7aa9ca6082272e9b3 --- mysql-cluster/gen_dockerfiles.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-cluster/gen_dockerfiles.sh b/mysql-cluster/gen_dockerfiles.sh index 35416239b..78dec1594 100755 --- a/mysql-cluster/gen_dockerfiles.sh +++ b/mysql-cluster/gen_dockerfiles.sh @@ -116,7 +116,7 @@ do if [ "${VERSION}" == "8.0" ]; then sed -i 's#%%PORTS%%#'"1186/tcp, 2202/tcp, 3306/tcp, 33060-33061/tcp"'#g' tmpFile else - sed -i 's#%%PORTS%%#'"1186/tcp, 2202/tcp, 3306/tcp"'#g' tmpFile + sed -i 's#%%PORTS%%#'"1186/tcp, 2202/tcp, 3306/tcp, 33060/tcp"'#g' tmpFile fi mv tmpFile "${VERSION}/inspec/control.rb" From 804405054517567963d88abf94294454e48ec468 Mon Sep 17 00:00:00 2001 From: Robert Neumayer Date: Wed, 21 Dec 2022 08:10:29 +0100 Subject: [PATCH 267/386] Fix script generation for mysql-cluster We forgot to substitute a variable, this must've been lost in the last round of refactoring. The effect is a non-functioning entrypoint.sh script, for mysql-cluster. This fix is entirely based on the findings by karen.langford@oracle.com. Change-Id: I77aee42d7d9bdb187a6827ff4886cc95c00aa803 --- mysql-cluster/gen_dockerfiles.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-cluster/gen_dockerfiles.sh b/mysql-cluster/gen_dockerfiles.sh index 78dec1594..063821218 100755 --- a/mysql-cluster/gen_dockerfiles.sh +++ b/mysql-cluster/gen_dockerfiles.sh @@ -122,6 +122,7 @@ do # Entrypoint sed 's#%%PASSWORDSET%%#'"${PASSWORDSET[${VERSION}]}"'#g' template/docker-entrypoint.sh > tmpfile + sed -i 's#%%STARTUP%%#'"${STARTUP[${VERSION}]}"'#g' tmpfile sed -i 's#%%FULL_SERVER_VERSION%%#'"${FULL_SERVER_VERSIONS[${VERSION}]}"'#g' tmpfile sed -i 's#%%VALIDATE_CONFIG%%#'"${VALIDATE_CONFIG[${VERSION}]}"'#g' tmpfile mv tmpfile ${VERSION}/docker-entrypoint.sh From 99671ddb376cd3faf28fb194d6edfe0ab511c966 Mon Sep 17 00:00:00 2001 From: Robert Neumayer Date: Wed, 21 Dec 2022 08:15:38 +0100 Subject: [PATCH 268/386] Remove trailing whitespace Change-Id: I01f81f9f5d2c059b27644c0cc7f6d8d3fa15f786 --- mysql-cluster/template/docker-entrypoint.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/mysql-cluster/template/docker-entrypoint.sh b/mysql-cluster/template/docker-entrypoint.sh index 9ae1ead34..d8ecca687 100644 --- a/mysql-cluster/template/docker-entrypoint.sh +++ b/mysql-cluster/template/docker-entrypoint.sh @@ -86,7 +86,6 @@ if [ "$1" = 'mysqld' ]; then chown mysql:mysql "$DATADIR" fi - # The user can set a default_timezone either in a my.cnf file # they mount into the container or on command line # (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`) From b14ef619dc14fd96a4cfb18c6070d8ee31ed183f Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 18 Jan 2023 05:56:05 +0000 Subject: [PATCH 269/386] Release version 1.2.11-server * ET#76622 - Fix the repo name for Server 5.7.41 docker builds * ET#76622: Bump versions for 8.0.32 Docker releases * Use specified version directly when testing * Separate package name and version in templating * Make build files more template friendly --- mysql-server/5.7/Dockerfile | 8 ++++---- mysql-server/5.7/docker-entrypoint.sh | 4 ++-- mysql-server/5.7/inspec/control.rb | 4 ++-- mysql-server/8.0/Dockerfile | 8 ++++---- mysql-server/8.0/docker-entrypoint.sh | 4 ++-- mysql-server/8.0/inspec/control.rb | 4 ++-- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/mysql-server/5.7/Dockerfile b/mysql-server/5.7/Dockerfile index c5d0df435..58a41ff83 100644 --- a/mysql-server/5.7/Dockerfile +++ b/mysql-server/5.7/Dockerfile @@ -1,4 +1,4 @@ -# Copyright (c) 2017, 2021, Oracle and/or its affiliates. +# Copyright (c) 2017, 2022, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.40 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.31 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal +ARG MYSQL_SHELL_PACKAGE=mysql-shell # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ @@ -23,7 +23,7 @@ RUN rpm -U https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ # Install server and shell 8.0 RUN yum install -y $MYSQL_SHELL_PACKAGE \ - && yum install -y $MYSQL_SERVER_PACKAGE --enablerepo=mysql57-server-minimal\ + && yum install -y $MYSQL_SERVER_PACKAGE --enablerepo=mysql57-community-minimal\ && yum clean all \ && mkdir /docker-entrypoint-initdb.d diff --git a/mysql-server/5.7/docker-entrypoint.sh b/mysql-server/5.7/docker-entrypoint.sh index eaaf989ac..18f6ef0d3 100755 --- a/mysql-server/5.7/docker-entrypoint.sh +++ b/mysql-server/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.40-1.2.10-server" +echo "[Entrypoint] MySQL Docker Image 5.7.41-1.2.11-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 5.7.40-1.2.10-server" + echo "[Entrypoint] Starting MySQL 5.7.41-1.2.11-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/5.7/inspec/control.rb b/mysql-server/5.7/inspec/control.rb index 7f37eccb0..9abd2de48 100644 --- a/mysql-server/5.7/inspec/control.rb +++ b/mysql-server/5.7/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '5.7.40.*' } + its ('version') { should match '.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.31.*' } + its ('version') { should match '.*' } end end diff --git a/mysql-server/8.0/Dockerfile b/mysql-server/8.0/Dockerfile index 5bf623f2a..de45f4fb0 100644 --- a/mysql-server/8.0/Dockerfile +++ b/mysql-server/8.0/Dockerfile @@ -15,8 +15,8 @@ FROM oraclelinux:8-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.31 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.31 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal +ARG MYSQL_SHELL_PACKAGE=mysql-shell # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-community-minimal-release-el8.rpm \ @@ -24,9 +24,9 @@ RUN rpm -U https://repo.mysql.com/mysql-community-minimal-release-el8.rpm \ # Install server and shell 8.0 RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ - && microdnf install -y $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --enablerepo=mysql-tools-community $MYSQL_SHELL_PACKAGE \ && microdnf install -y --disablerepo=ol8_appstream \ - --enablerepo=mysql80-server-minimal $MYSQL_SERVER_PACKAGE \ + --enablerepo=mysql80-community-minimal $MYSQL_SERVER_PACKAGE \ && microdnf clean all \ && mkdir /docker-entrypoint-initdb.d diff --git a/mysql-server/8.0/docker-entrypoint.sh b/mysql-server/8.0/docker-entrypoint.sh index abbbf9f34..c98b02019 100755 --- a/mysql-server/8.0/docker-entrypoint.sh +++ b/mysql-server/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.31-1.2.10-server" +echo "[Entrypoint] MySQL Docker Image 8.0.32-1.2.11-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.31-1.2.10-server" + echo "[Entrypoint] Starting MySQL 8.0.32-1.2.11-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/8.0/inspec/control.rb b/mysql-server/8.0/inspec/control.rb index ad2077f4d..4cbf2ad12 100644 --- a/mysql-server/8.0/inspec/control.rb +++ b/mysql-server/8.0/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.31.*' } + its ('version') { should match '.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.31.*' } + its ('version') { should match '.*' } end end From cea502f79b54ece49c8999bbf9730fae5ed3eb55 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 18 Jan 2023 06:09:57 +0000 Subject: [PATCH 270/386] Release version 1.0.11-router * ET#76622: Bump versions for 8.0.32 Docker releases --- mysql-router/8.0/Dockerfile | 4 ++-- mysql-router/8.0/inspec/control.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-router/8.0/Dockerfile b/mysql-router/8.0/Dockerfile index 0088b430b..a59e3cbc6 100644 --- a/mysql-router/8.0/Dockerfile +++ b/mysql-router/8.0/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM oraclelinux:8-slim -ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.31 -ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.31 +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.32 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.32 RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ diff --git a/mysql-router/8.0/inspec/control.rb b/mysql-router/8.0/inspec/control.rb index 5d0f8a0ae..1b6579767 100644 --- a/mysql-router/8.0/inspec/control.rb +++ b/mysql-router/8.0/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-community-client') do it { should be_installed } - its ('version') { should match '8.0.31.*' } + its ('version') { should match '8.0.32.*' } end describe package('mysql-router-community') do it { should be_installed } - its ('version') { should match '8.0.31.*' } + its ('version') { should match '8.0.32.*' } end end From 8e03987f45ef98b343c4b428609c898fe6373dac Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 18 Jan 2023 07:17:47 +0000 Subject: [PATCH 271/386] Release version 1.2.11-cluster * Remove trailing whitespace * Fix script generation for mysql-cluster * Follow-up fix: Update the ports for Cluster 7.x docker release * Fix the ports for Cluster 7.x docker release * ET#76622 - Fix the Cluster 7.x community docker builds * ET#76622: Bump versions for 8.0.32 Docker releases * Update mysql-cluster templating to be more generic --- mysql-cluster/7.5/Dockerfile | 6 +++--- mysql-cluster/7.5/docker-entrypoint.sh | 20 ++++++++++++++------ mysql-cluster/7.5/inspec/control.rb | 4 ++-- mysql-cluster/7.6/Dockerfile | 6 +++--- mysql-cluster/7.6/docker-entrypoint.sh | 20 ++++++++++++++------ mysql-cluster/7.6/inspec/control.rb | 4 ++-- mysql-cluster/8.0/Dockerfile | 10 +++++----- mysql-cluster/8.0/docker-entrypoint.sh | 20 ++++++++++++++------ mysql-cluster/8.0/inspec/control.rb | 6 +++--- 9 files changed, 60 insertions(+), 36 deletions(-) diff --git a/mysql-cluster/7.5/Dockerfile b/mysql-cluster/7.5/Dockerfile index cfe0a5a8c..40a8703d5 100644 --- a/mysql-cluster/7.5/Dockerfile +++ b/mysql-cluster/7.5/Dockerfile @@ -15,8 +15,8 @@ FROM oraclelinux:7-slim -ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.5.28 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.31 +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal +ARG MYSQL_SHELL_PACKAGE=mysql-shell # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el7.rpm \ @@ -24,7 +24,7 @@ RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el7.rp # Install server and shell 8.0 RUN yum install -y $MYSQL_SHELL_PACKAGE \ - && yum install -y $MYSQL_CLUSTER_PACKAGE --enablerepo=mysql-cluster75-minimal\ + && yum install -y $MYSQL_SERVER_PACKAGE --enablerepo=mysql-cluster75-community-minimal\ && yum clean all \ && mkdir /docker-entrypoint-initdb.d diff --git a/mysql-cluster/7.5/docker-entrypoint.sh b/mysql-cluster/7.5/docker-entrypoint.sh index 0166babe6..f795eef00 100755 --- a/mysql-cluster/7.5/docker-entrypoint.sh +++ b/mysql-cluster/7.5/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 7.5.28-1.2.10-cluster" +echo "[Entrypoint] MySQL Docker Image 7.5.29-1.2.11-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -86,11 +86,19 @@ if [ "$1" = 'mysqld' ]; then chown mysql:mysql "$DATADIR" fi + # The user can set a default_timezone either in a my.cnf file + # they mount into the container or on command line + # (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`) + # however the timezone tables will only be populated in a later + # stage of this script. By using +00:00 as timezone we override + # the user's choice during initialization. Later the server + # will be restarted using the user's option. + echo '[Entrypoint] Initializing database' - "$@" --user=$MYSQLD_USER --initialize-insecure - echo '[Entrypoint] Database initialized' + "$@" --user=$MYSQLD_USER --initialize-insecure --default-time-zone=+00:00 - "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" + echo '[Entrypoint] Database initialized' + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" --default-time-zone=+00:00 # To avoid using password on commandline, put it in a temporary file. # The file is only populated when and if the root password is set. @@ -100,7 +108,7 @@ if [ "$1" = 'mysqld' ]; then # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") - if [ ! -z "" ]; + if [ ! -z %%STARTUP_WAIT%% ]; then for i in {30..0}; do if mysqladmin --socket="$SOCKET" ping &>/dev/null; then @@ -219,7 +227,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 7.5.28-1.2.10-cluster" + echo "[Entrypoint] Starting MySQL 7.5.29-1.2.11-cluster" fi exec "$@" --user=$MYSQLD_USER else diff --git a/mysql-cluster/7.5/inspec/control.rb b/mysql-cluster/7.5/inspec/control.rb index 504a01846..87a46af9e 100644 --- a/mysql-cluster/7.5/inspec/control.rb +++ b/mysql-cluster/7.5/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '7.5.28.*' } + its ('version') { should match '.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.31.*' } + its ('version') { should match '.*' } end end diff --git a/mysql-cluster/7.6/Dockerfile b/mysql-cluster/7.6/Dockerfile index 3c578377c..703791f8a 100644 --- a/mysql-cluster/7.6/Dockerfile +++ b/mysql-cluster/7.6/Dockerfile @@ -15,8 +15,8 @@ FROM oraclelinux:7-slim -ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-7.6.24 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.31 +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal +ARG MYSQL_SHELL_PACKAGE=mysql-shell # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el7.rpm \ @@ -24,7 +24,7 @@ RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el7.rp # Install server and shell 8.0 RUN yum install -y $MYSQL_SHELL_PACKAGE \ - && yum install -y $MYSQL_CLUSTER_PACKAGE --enablerepo=mysql-cluster76-minimal\ + && yum install -y $MYSQL_SERVER_PACKAGE --enablerepo=mysql-cluster76-community-minimal\ && yum clean all \ && mkdir /docker-entrypoint-initdb.d diff --git a/mysql-cluster/7.6/docker-entrypoint.sh b/mysql-cluster/7.6/docker-entrypoint.sh index 00195d7c0..4819facb4 100755 --- a/mysql-cluster/7.6/docker-entrypoint.sh +++ b/mysql-cluster/7.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 7.6.24-1.2.10-cluster" +echo "[Entrypoint] MySQL Docker Image 7.6.25-1.2.11-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -86,11 +86,19 @@ if [ "$1" = 'mysqld' ]; then chown mysql:mysql "$DATADIR" fi + # The user can set a default_timezone either in a my.cnf file + # they mount into the container or on command line + # (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`) + # however the timezone tables will only be populated in a later + # stage of this script. By using +00:00 as timezone we override + # the user's choice during initialization. Later the server + # will be restarted using the user's option. + echo '[Entrypoint] Initializing database' - "$@" --user=$MYSQLD_USER --initialize-insecure - echo '[Entrypoint] Database initialized' + "$@" --user=$MYSQLD_USER --initialize-insecure --default-time-zone=+00:00 - "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" + echo '[Entrypoint] Database initialized' + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" --default-time-zone=+00:00 # To avoid using password on commandline, put it in a temporary file. # The file is only populated when and if the root password is set. @@ -100,7 +108,7 @@ if [ "$1" = 'mysqld' ]; then # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") - if [ ! -z "" ]; + if [ ! -z %%STARTUP_WAIT%% ]; then for i in {30..0}; do if mysqladmin --socket="$SOCKET" ping &>/dev/null; then @@ -219,7 +227,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 7.6.24-1.2.10-cluster" + echo "[Entrypoint] Starting MySQL 7.6.25-1.2.11-cluster" fi exec "$@" --user=$MYSQLD_USER else diff --git a/mysql-cluster/7.6/inspec/control.rb b/mysql-cluster/7.6/inspec/control.rb index 0ce2e2b15..69cae5db1 100644 --- a/mysql-cluster/7.6/inspec/control.rb +++ b/mysql-cluster/7.6/inspec/control.rb @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '7.6.24.*' } + its ('version') { should match '.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.31.*' } + its ('version') { should match '.*' } end end diff --git a/mysql-cluster/8.0/Dockerfile b/mysql-cluster/8.0/Dockerfile index 1a267f04b..28eef4b81 100644 --- a/mysql-cluster/8.0/Dockerfile +++ b/mysql-cluster/8.0/Dockerfile @@ -15,8 +15,8 @@ FROM oraclelinux:8-slim -ARG MYSQL_CLUSTER_PACKAGE=mysql-cluster-community-server-minimal-8.0.31 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.31 +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal +ARG MYSQL_SHELL_PACKAGE=mysql-shell # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el8.rpm \ @@ -24,9 +24,9 @@ RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el8.rp # Install server and shell 8.0 RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ - && microdnf install -y $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --enablerepo=mysql-tools-community $MYSQL_SHELL_PACKAGE \ && microdnf install -y --disablerepo=ol8_appstream \ - --enablerepo=mysql-cluster80-minimal $MYSQL_CLUSTER_PACKAGE \ + --enablerepo=mysql-cluster80-community-minimal $MYSQL_SERVER_PACKAGE \ && microdnf clean all \ && mkdir /docker-entrypoint-initdb.d @@ -42,6 +42,6 @@ COPY cnf/mysql-cluster.cnf /etc/ ENTRYPOINT ["/entrypoint.sh"] HEALTHCHECK CMD /healthcheck.sh -EXPOSE 3306 33060 2202 1186 +EXPOSE 3306 33060-33061 2202 1186 CMD ["mysqld"] diff --git a/mysql-cluster/8.0/docker-entrypoint.sh b/mysql-cluster/8.0/docker-entrypoint.sh index aa427c292..1e60ea59f 100755 --- a/mysql-cluster/8.0/docker-entrypoint.sh +++ b/mysql-cluster/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.31-1.2.10-cluster" +echo "[Entrypoint] MySQL Docker Image 8.0.32-1.2.11-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -86,11 +86,19 @@ if [ "$1" = 'mysqld' ]; then chown mysql:mysql "$DATADIR" fi + # The user can set a default_timezone either in a my.cnf file + # they mount into the container or on command line + # (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`) + # however the timezone tables will only be populated in a later + # stage of this script. By using +00:00 as timezone we override + # the user's choice during initialization. Later the server + # will be restarted using the user's option. + echo '[Entrypoint] Initializing database' - "$@" --user=$MYSQLD_USER --initialize-insecure - echo '[Entrypoint] Database initialized' + "$@" --user=$MYSQLD_USER --initialize-insecure --default-time-zone=+00:00 - "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" + echo '[Entrypoint] Database initialized' + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" --default-time-zone=+00:00 # To avoid using password on commandline, put it in a temporary file. # The file is only populated when and if the root password is set. @@ -100,7 +108,7 @@ if [ "$1" = 'mysqld' ]; then # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") - if [ ! -z ]; + if [ ! -z %%STARTUP_WAIT%% ]; then for i in {30..0}; do if mysqladmin --socket="$SOCKET" ping &>/dev/null; then @@ -219,7 +227,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.31-1.2.10-cluster" + echo "[Entrypoint] Starting MySQL 8.0.32-1.2.11-cluster" fi export MYSQLD_PARENT_PID=$$ ; exec "$@" --user= else diff --git a/mysql-cluster/8.0/inspec/control.rb b/mysql-cluster/8.0/inspec/control.rb index 677abcd7e..0da0c0173 100644 --- a/mysql-cluster/8.0/inspec/control.rb +++ b/mysql-cluster/8.0/inspec/control.rb @@ -4,7 +4,7 @@ it { should exist } it { should be_running } its('repo') { should eq 'mysql/mysql-cluster' } - its('ports') { should eq '1186/tcp, 2202/tcp, 3306/tcp, 33060/tcp' } + its('ports') { should eq '1186/tcp, 2202/tcp, 3306/tcp, 33060-33061/tcp' } its('command') { should match '/entrypoint.sh.*' } end end @@ -12,10 +12,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.31.*' } + its ('version') { should match '.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.31.*' } + its ('version') { should match '.*' } end end From f01f4d5a4e81a1d4918aa9b12be8215ca8a421a2 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 18 Jan 2023 07:32:20 +0000 Subject: [PATCH 272/386] Release version 1.2.11-cluster * Release version 1.2.11-cluster * Remove trailing whitespace * Fix script generation for mysql-cluster * Follow-up fix: Update the ports for Cluster 7.x docker release * Fix the ports for Cluster 7.x docker release * ET#76622 - Fix the Cluster 7.x community docker builds * ET#76622: Bump versions for 8.0.32 Docker releases * Update mysql-cluster templating to be more generic From 54a5c11c2991298ee2bd595a77da087aaaa306c0 Mon Sep 17 00:00:00 2001 From: Nawaz Nazeer Ahamed Date: Thu, 2 Feb 2023 18:29:39 +0100 Subject: [PATCH 273/386] ET77115 - [Docker] Use OCR for fetching base images for docker builds Change-Id: I6ea9a87ef319d3b1ab1ebb28ac272a60079b8288 --- mysql-cluster/7.5/Dockerfile | 2 +- mysql-cluster/7.6/Dockerfile | 2 +- mysql-cluster/8.0/Dockerfile | 2 +- mysql-cluster/template/Dockerfile | 2 +- mysql-cluster/template/Dockerfile-pre8 | 2 +- mysql-router/8.0/Dockerfile | 2 +- mysql-router/template/Dockerfile | 2 +- mysql-server/5.7/Dockerfile | 2 +- mysql-server/8.0/Dockerfile | 2 +- mysql-server/template/Dockerfile | 2 +- mysql-server/template/Dockerfile-pre8 | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/mysql-cluster/7.5/Dockerfile b/mysql-cluster/7.5/Dockerfile index 40a8703d5..9663a947e 100644 --- a/mysql-cluster/7.5/Dockerfile +++ b/mysql-cluster/7.5/Dockerfile @@ -13,7 +13,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -FROM oraclelinux:7-slim +FROM container-registry.oracle.com/os/oraclelinux:7-slim ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal ARG MYSQL_SHELL_PACKAGE=mysql-shell diff --git a/mysql-cluster/7.6/Dockerfile b/mysql-cluster/7.6/Dockerfile index 703791f8a..260c09f31 100644 --- a/mysql-cluster/7.6/Dockerfile +++ b/mysql-cluster/7.6/Dockerfile @@ -13,7 +13,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -FROM oraclelinux:7-slim +FROM container-registry.oracle.com/os/oraclelinux:7-slim ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal ARG MYSQL_SHELL_PACKAGE=mysql-shell diff --git a/mysql-cluster/8.0/Dockerfile b/mysql-cluster/8.0/Dockerfile index 28eef4b81..ccf9d5798 100644 --- a/mysql-cluster/8.0/Dockerfile +++ b/mysql-cluster/8.0/Dockerfile @@ -13,7 +13,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -FROM oraclelinux:8-slim +FROM container-registry.oracle.com/os/oraclelinux:8-slim ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal ARG MYSQL_SHELL_PACKAGE=mysql-shell diff --git a/mysql-cluster/template/Dockerfile b/mysql-cluster/template/Dockerfile index a0bca2493..4d712e03c 100644 --- a/mysql-cluster/template/Dockerfile +++ b/mysql-cluster/template/Dockerfile @@ -13,7 +13,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -FROM oraclelinux:8-slim +FROM container-registry.oracle.com/os/oraclelinux:8-slim ARG MYSQL_SERVER_PACKAGE=%%MYSQL_SERVER_PACKAGE%% ARG MYSQL_SHELL_PACKAGE=%%MYSQL_SHELL_PACKAGE%% diff --git a/mysql-cluster/template/Dockerfile-pre8 b/mysql-cluster/template/Dockerfile-pre8 index 4edc96cf2..f8b54d957 100644 --- a/mysql-cluster/template/Dockerfile-pre8 +++ b/mysql-cluster/template/Dockerfile-pre8 @@ -13,7 +13,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -FROM oraclelinux:7-slim +FROM container-registry.oracle.com/os/oraclelinux:7-slim ARG MYSQL_SERVER_PACKAGE=%%MYSQL_SERVER_PACKAGE%% ARG MYSQL_SHELL_PACKAGE=%%MYSQL_SHELL_PACKAGE%% diff --git a/mysql-router/8.0/Dockerfile b/mysql-router/8.0/Dockerfile index a59e3cbc6..fe27abf84 100644 --- a/mysql-router/8.0/Dockerfile +++ b/mysql-router/8.0/Dockerfile @@ -12,7 +12,7 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -FROM oraclelinux:8-slim +FROM container-registry.oracle.com/os/oraclelinux:8-slim ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.32 ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.32 diff --git a/mysql-router/template/Dockerfile b/mysql-router/template/Dockerfile index 6fa59ef1d..83ee9668a 100644 --- a/mysql-router/template/Dockerfile +++ b/mysql-router/template/Dockerfile @@ -12,7 +12,7 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -FROM oraclelinux:8-slim +FROM container-registry.oracle.com/os/oraclelinux:8-slim ARG MYSQL_CLIENT_PACKAGE=%%MYSQL_CLIENT_PACKAGE%% ARG MYSQL_ROUTER_PACKAGE=%%MYSQL_ROUTER_PACKAGE%% diff --git a/mysql-server/5.7/Dockerfile b/mysql-server/5.7/Dockerfile index 58a41ff83..6eb3df278 100644 --- a/mysql-server/5.7/Dockerfile +++ b/mysql-server/5.7/Dockerfile @@ -12,7 +12,7 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -FROM oraclelinux:7-slim +FROM container-registry.oracle.com/os/oraclelinux:7-slim ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal ARG MYSQL_SHELL_PACKAGE=mysql-shell diff --git a/mysql-server/8.0/Dockerfile b/mysql-server/8.0/Dockerfile index de45f4fb0..b829578d6 100644 --- a/mysql-server/8.0/Dockerfile +++ b/mysql-server/8.0/Dockerfile @@ -13,7 +13,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -FROM oraclelinux:8-slim +FROM container-registry.oracle.com/os/oraclelinux:8-slim ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal ARG MYSQL_SHELL_PACKAGE=mysql-shell diff --git a/mysql-server/template/Dockerfile b/mysql-server/template/Dockerfile index 7d337bcfb..67a04c523 100644 --- a/mysql-server/template/Dockerfile +++ b/mysql-server/template/Dockerfile @@ -13,7 +13,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -FROM oraclelinux:8-slim +FROM container-registry.oracle.com/os/oraclelinux:8-slim ARG MYSQL_SERVER_PACKAGE=%%MYSQL_SERVER_PACKAGE%% ARG MYSQL_SHELL_PACKAGE=%%MYSQL_SHELL_PACKAGE%% diff --git a/mysql-server/template/Dockerfile-pre8 b/mysql-server/template/Dockerfile-pre8 index eb8172bc7..9fb4cdb00 100644 --- a/mysql-server/template/Dockerfile-pre8 +++ b/mysql-server/template/Dockerfile-pre8 @@ -12,7 +12,7 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -FROM oraclelinux:7-slim +FROM container-registry.oracle.com/os/oraclelinux:7-slim ARG MYSQL_SERVER_PACKAGE=%%MYSQL_SERVER_PACKAGE%% ARG MYSQL_SHELL_PACKAGE=%%MYSQL_SHELL_PACKAGE%% From c5fdb502d9c05f3dc04b2652202628ded04fd1d2 Mon Sep 17 00:00:00 2001 From: Nawaz Nazeer Ahamed Date: Mon, 6 Feb 2023 11:39:15 +0100 Subject: [PATCH 274/386] [Docker] Updating the copyright year in the header Change-Id: Ie978968a580191a020361573aea8fd938827b8fc --- mysql-cluster/template/Dockerfile | 2 +- mysql-router/template/Dockerfile | 2 +- mysql-server/template/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mysql-cluster/template/Dockerfile b/mysql-cluster/template/Dockerfile index 4d712e03c..0c71f0811 100644 --- a/mysql-cluster/template/Dockerfile +++ b/mysql-cluster/template/Dockerfile @@ -1,4 +1,4 @@ -# Copyright (c) 2017, 2021, Oracle and/or its affiliates. +# Copyright (c) 2017, 2023, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/mysql-router/template/Dockerfile b/mysql-router/template/Dockerfile index 83ee9668a..3b6b4eb51 100644 --- a/mysql-router/template/Dockerfile +++ b/mysql-router/template/Dockerfile @@ -1,4 +1,4 @@ -# Copyright (c) 2018, 2021, Oracle and/or its affiliates. +# Copyright (c) 2018, 2023, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/mysql-server/template/Dockerfile b/mysql-server/template/Dockerfile index 67a04c523..a623b390e 100644 --- a/mysql-server/template/Dockerfile +++ b/mysql-server/template/Dockerfile @@ -1,4 +1,4 @@ -# Copyright (c) 2017, 2021, Oracle and/or its affiliates. +# Copyright (c) 2017, 2023, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by From f2b5bed78fd20f1b6c62913c60f9ce85023f50b2 Mon Sep 17 00:00:00 2001 From: Nawaz Nazeer Ahamed Date: Wed, 8 Feb 2023 09:57:51 +0100 Subject: [PATCH 275/386] ET#77004 - [WIP] Create Docker ARM image for MySQL Router Change-Id: I6fc4c62633671641cfbac7fb2cecc278a5eade5e --- mysql-router/VERSION | 1 + mysql-router/build.sh | 7 +++++-- mysql-router/manifest.sh | 37 +++++++++++++++++++++++++++++++++++++ mysql-router/tag.sh | 19 ++++++++++++------- mysql-router/test.sh | 4 +++- 5 files changed, 58 insertions(+), 10 deletions(-) create mode 100644 mysql-router/manifest.sh diff --git a/mysql-router/VERSION b/mysql-router/VERSION index 59ed83807..2f262aa15 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -7,4 +7,5 @@ MYSQL_SERVER_VERSIONS["8.0"]=8.0.32 declare -A FULL_ROUTER_VERSIONS FULL_ROUTER_VERSIONS["8.0"]="${MYSQL_ROUTER_VERSIONS["8.0"]}-${IMAGE_VERSION}" +MULTIARCH_VERSIONS="8.0" LATEST="8.0" diff --git a/mysql-router/build.sh b/mysql-router/build.sh index 9f920b472..daad43e74 100755 --- a/mysql-router/build.sh +++ b/mysql-router/build.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2023 Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,6 +15,9 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e source ./VERSION + +ARCH=amd64; [ -n "$1" ] && ARCH=$1 + for MAJOR_VERSION in "${!MYSQL_ROUTER_VERSIONS[@]}"; do - docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$http_proxy --build-arg no_proxy=$no_proxy -t mysql/mysql-router:$MAJOR_VERSION $MAJOR_VERSION + docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$http_proxy --build-arg no_proxy=$no_proxy -t mysql/mysql-router:$MAJOR_VERSION-$ARCH $MAJOR_VERSION done diff --git a/mysql-router/manifest.sh b/mysql-router/manifest.sh new file mode 100644 index 000000000..3e804d73d --- /dev/null +++ b/mysql-router/manifest.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# Copyright (c) 2018, 2023 Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e +source ./VERSION + +if grep -q Microsoft /proc/version; then + echo "Running on Windows Subsystem for Linux" + # WSL doesn't have its own docker host, we have to use the one + # from Windows itself. + # https://medium.com/@sebagomez/installing-the-docker-client-on-ubuntus-windows-subsystem-for-linux-612b392a44c4 + export DOCKER_HOST=localhost:2375 +fi + +REPO=mysql/mysql-router; [ -n "$1" ] && REPO=$1 + +for MAJOR_VERSION in ${MULTIARCH_VERSIONS}; do + MANIFEST_VERSIONS=$(./tag.sh "" "$MAJOR_VERSION") + for MANIFEST_VERSION in $MANIFEST_VERSIONS; do + docker manifest create "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-aarch64" "$REPO:$MANIFEST_VERSION-amd64" + docker manifest annotate "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-aarch64" --os linux --arch arm64 + docker manifest annotate "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-amd64" --os linux --arch amd64 + docker manifest push "$REPO:$MANIFEST_VERSION" + done +done diff --git a/mysql-router/tag.sh b/mysql-router/tag.sh index 56ab52ca4..9f2a41615 100755 --- a/mysql-router/tag.sh +++ b/mysql-router/tag.sh @@ -1,15 +1,20 @@ #!/bin/bash -# Copyright (c) 2021, Oracle and/or its affiliates. +# Copyright (c) 2021, 2023 Oracle and/or its affiliates. # set -e source VERSION -MAJOR_VERSIONS=("${!MYSQL_ROUTER_VERSIONS[@]}"); [ -n "$1" ] && MAJOR_VERSIONS=("${@:1}") +SUFFIX='' [ -n "$1" ] && SUFFIX=$1 +MAJOR_VERSIONS=("${!MYSQL_ROUTER_VERSIONS[@]}"); [ -n "$2" ] && MAJOR_VERSIONS=("${@:2}") for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do - if [[ "$MAJOR_VERSION" == "$LATEST" ]]; then - echo "$MAJOR_VERSION ${MYSQL_ROUTER_VERSIONS["$MAJOR_VERSION"]} ${FULL_ROUTER_VERSIONS["$MAJOR_VERSION"]} latest" - else - echo "$MAJOR_VERSION ${MYSQL_ROUTER_VERSIONS["$MAJOR_VERSION"]} ${FULL_ROUTER_VERSIONS["$MAJOR_VERSION"]}" - fi + for MULTIARCH_VERSION in ${MULTIARCH_VERSIONS}; do + if [[ "$MULTIARCH_VERSION" == "$MAJOR_VERSION" ]]; then + if [[ "$MAJOR_VERSION" == "$LATEST" ]]; then + echo "$MAJOR_VERSION ${MYSQL_ROUTER_VERSIONS["$MAJOR_VERSION"]} ${FULL_ROUTER_VERSIONS["$MAJOR_VERSION"]} latest" + else + echo "$MAJOR_VERSION ${MYSQL_ROUTER_VERSIONS["$MAJOR_VERSION"]} ${FULL_ROUTER_VERSIONS["$MAJOR_VERSION"]}" + fi + fi + done done diff --git a/mysql-router/test.sh b/mysql-router/test.sh index 76d77042e..01e5a8976 100755 --- a/mysql-router/test.sh +++ b/mysql-router/test.sh @@ -20,9 +20,11 @@ set -e source ./VERSION +ARCH=amd64; [ -n "$1" ] && ARCH=$1 + for MAJOR_VERSION in "${!MYSQL_ROUTER_VERSIONS[@]}" do - docker run -d -e MYSQL_HOST=x -e MYSQL_PORT=9 -e MYSQL_USER=x -e MYSQL_PASSWORD=x -e MYSQL_INNODB_CLUSTER_MEMBERS=1 --name "mysql-router-$MAJOR_VERSION" mysql/mysql-router:$MAJOR_VERSION sleep 5000 + docker run -d -e MYSQL_HOST=x -e MYSQL_PORT=9 -e MYSQL_USER=x -e MYSQL_PASSWORD=x -e MYSQL_INNODB_CLUSTER_MEMBERS=1 --name "mysql-router-$MAJOR_VERSION" mysql/mysql-router:$MAJOR_VERSION-$ARCH sleep 5000 inspec exec $MAJOR_VERSION/inspec/control.rb --controls container inspec exec $MAJOR_VERSION/inspec/control.rb -t "docker://mysql-router-$MAJOR_VERSION" --controls packages docker stop "mysql-router-$MAJOR_VERSION" From 8d40ae4deebaea461d3867f62825186ea46ea877 Mon Sep 17 00:00:00 2001 From: Nawaz Nazeer Ahamed Date: Wed, 22 Feb 2023 12:58:18 +0530 Subject: [PATCH 276/386] ET#77004 - [WIP] Create Docker ARM image for MySQL Router - Follow up fix - updated permission for manifest file Change-Id: I811b538cf591796ef780f2cb3a08de80378758ae --- mysql-router/manifest.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 mysql-router/manifest.sh diff --git a/mysql-router/manifest.sh b/mysql-router/manifest.sh old mode 100644 new mode 100755 From 78983613dc75794abcc248d30c4a5ca0f498fd99 Mon Sep 17 00:00:00 2001 From: Nawaz Nazeer Ahamed Date: Mon, 6 Mar 2023 10:21:03 +0530 Subject: [PATCH 277/386] ET#77271 - [Docker] Restructure internal-enterprise - router pipeline * Merge commercial branch into main * Updated inspec control.rb files to handle both gpl/com tests Change-Id: Ic4b8d8758826cb19c8d8d53f378d45ebb52c64ee --- mysql-router/gen_dockerfiles.sh | 15 +++++++++++---- mysql-router/template/Dockerfile | 3 ++- mysql-router/template/control.rb | 4 ++-- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/mysql-router/gen_dockerfiles.sh b/mysql-router/gen_dockerfiles.sh index ce071a008..321a907ed 100755 --- a/mysql-router/gen_dockerfiles.sh +++ b/mysql-router/gen_dockerfiles.sh @@ -4,17 +4,24 @@ set -e source ./VERSION REPO=https://repo.mysql.com; [ -n "$1" ] && REPO=$1 - +CONFIG_PACKAGE_NAME=mysql80-community-release-el8.rpm; [ -n "$2" ] && CONFIG_PACKAGE_NAME=$2 +MYSQL_CLIENT_PACKAGE=mysql-community-client-${MYSQL_SERVER_VERSIONS[${MAJOR_VERSION}]}; [ -n "$3" ] && MYSQL_CLIENT_PACKAGE=$3 +MYSQL_ROUTER_PACKAGE=mysql-router-community-${MYSQL_ROUTER_VERSIONS[${MAJOR_VERSION}]}; [ -n "$4" ] && MYSQL_ROUTER_PACKAGE=$4 +MYSQL_CLIENT_PACKAGE_TEST=mysql-community-client; [ -n "$5" ] && MYSQL_CLIENT_PACKAGE_TEST=$5 +MYSQL_ROUTER_PACKAGE_TEST=mysql-router-community; [ -n "$6" ] && MYSQL_ROUTER_PACKAGE_TEST=$6 for MAJOR_VERSION in "${!MYSQL_ROUTER_VERSIONS[@]}"; do - sed 's#%%MYSQL_CLIENT_PACKAGE%%#'"mysql-community-client-${MYSQL_SERVER_VERSIONS[${MAJOR_VERSION}]}"'#g' template/Dockerfile > tmpFile - sed -i 's#%%MYSQL_ROUTER_PACKAGE%%#'"mysql-router-community-${MYSQL_ROUTER_VERSIONS[${MAJOR_VERSION}]}"'#g' tmpFile + sed 's#%%MYSQL_CLIENT_PACKAGE%%#'"${MYSQL_CLIENT_PACKAGE}"'#g' template/Dockerfile > tmpFile + sed -i 's#%%MYSQL_ROUTER_PACKAGE%%#'"${MYSQL_ROUTER_PACKAGE}"'#g' tmpFile + sed -i 's#%%CONFIG_PACKAGE_NAME%%#'"${CONFIG_PACKAGE_NAME}"'#g' tmpFile sed -i 's#%%REPO%%#'"${REPO}"'#g' tmpFile REPO_VERSION=${MAJOR_VERSION//\./} sed -i 's#%%REPO_VERSION%%#'"${REPO_VERSION}"'#g' tmpFile mv tmpFile $MAJOR_VERSION/Dockerfile # update test template - sed -e 's#%%MYSQL_CLIENT_PACKAGE_VERSION%%#'"${MYSQL_SERVER_VERSIONS[${MAJOR_VERSION}]}"'#g' template/control.rb > tmpFile + sed -e 's#%%MYSQL_CLIENT_PACKAGE_TEST%%#'"${MYSQL_CLIENT_PACKAGE_TEST}"'#g' template/control.rb > tmpFile + sed -i -e 's#%%MYSQL_CLIENT_PACKAGE_VERSION%%#'"${MYSQL_SERVER_VERSIONS[${MAJOR_VERSION}]}"'#g' tmpFile + sed -i -e 's#%%MYSQL_ROUTER_PACKAGE_TEST%%#'"${MYSQL_ROUTER_PACKAGE_TEST}"'#g' tmpFile sed -i -e 's#%%MYSQL_ROUTER_PACKAGE_VERSION%%#'"${MYSQL_ROUTER_VERSIONS[${MAJOR_VERSION}]}"'#g' tmpFile sed -i -e 's#%%MAJOR_VERSION%%#'"${MAJOR_VERSION}"'#g' tmpFile if [ ! -d "${MAJOR_VERSION}/inspec" ]; then diff --git a/mysql-router/template/Dockerfile b/mysql-router/template/Dockerfile index 3b6b4eb51..6769a63da 100644 --- a/mysql-router/template/Dockerfile +++ b/mysql-router/template/Dockerfile @@ -16,11 +16,12 @@ FROM container-registry.oracle.com/os/oraclelinux:8-slim ARG MYSQL_CLIENT_PACKAGE=%%MYSQL_CLIENT_PACKAGE%% ARG MYSQL_ROUTER_PACKAGE=%%MYSQL_ROUTER_PACKAGE%% +ARG CONFIG_PACKAGE_NAME=%%CONFIG_PACKAGE_NAME%% RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ -c "MySQL Router" mysqlrouter \ - && rpm -U %%REPO%%/mysql%%REPO_VERSION%%-community-release-el8.rpm \ + && rpm -U %%REPO%%/$CONFIG_PACKAGE_NAME \ && microdnf install -y --disablerepo=ol8_appstream \ $MYSQL_CLIENT_PACKAGE $MYSQL_ROUTER_PACKAGE \ && microdnf clean all diff --git a/mysql-router/template/control.rb b/mysql-router/template/control.rb index 11e17e56e..ff9a631ee 100644 --- a/mysql-router/template/control.rb +++ b/mysql-router/template/control.rb @@ -10,11 +10,11 @@ end control 'packages' do impact 0.5 - describe package('mysql-community-client') do + describe package('%%MYSQL_CLIENT_PACKAGE_TEST%%') do it { should be_installed } its ('version') { should match '%%MYSQL_CLIENT_PACKAGE_VERSION%%.*' } end - describe package('mysql-router-community') do + describe package('%%MYSQL_ROUTER_PACKAGE_TEST%%') do it { should be_installed } its ('version') { should match '%%MYSQL_ROUTER_PACKAGE_VERSION%%.*' } end From 8e2fef0c587fdbe02f28bf479925c3fa6f866520 Mon Sep 17 00:00:00 2001 From: Karen Langford Date: Fri, 10 Mar 2023 17:20:13 +0100 Subject: [PATCH 278/386] ET#77361: Bump versions for 8.0.33 Docker releases Change-Id: Icb7350f280fb2a2fd5649750aa1c417096e65b91 --- mysql-cluster/VERSION | 14 +++++++------- mysql-router/VERSION | 6 +++--- mysql-server/VERSION | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/mysql-cluster/VERSION b/mysql-cluster/VERSION index 1b6fcca48..84a6496c0 100644 --- a/mysql-cluster/VERSION +++ b/mysql-cluster/VERSION @@ -1,14 +1,14 @@ -IMAGE_VERSION=1.2.11-cluster +IMAGE_VERSION=1.2.12-cluster declare -A MYSQL_CLUSTER_VERSIONS -MYSQL_CLUSTER_VERSIONS["7.5"]=7.5.29 -MYSQL_CLUSTER_VERSIONS["7.6"]=7.6.25 -MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.32 +MYSQL_CLUSTER_VERSIONS["7.5"]=7.5.30 +MYSQL_CLUSTER_VERSIONS["7.6"]=7.6.26 +MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.33 declare -A MYSQL_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["7.5"]=8.0.32 -MYSQL_SHELL_VERSIONS["7.6"]=8.0.32 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.32 +MYSQL_SHELL_VERSIONS["7.5"]=8.0.33 +MYSQL_SHELL_VERSIONS["7.6"]=8.0.33 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.33 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["7.5"]="${MYSQL_CLUSTER_VERSIONS["7.5"]}-${IMAGE_VERSION}" diff --git a/mysql-router/VERSION b/mysql-router/VERSION index 2f262aa15..7512ed1db 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -1,8 +1,8 @@ -IMAGE_VERSION=1.0.11-router +IMAGE_VERSION=1.0.12-router declare -A MYSQL_ROUTER_VERSIONS -MYSQL_ROUTER_VERSIONS["8.0"]=8.0.32 +MYSQL_ROUTER_VERSIONS["8.0"]=8.0.33 declare -A MYSQL_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["8.0"]=8.0.32 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.33 declare -A FULL_ROUTER_VERSIONS FULL_ROUTER_VERSIONS["8.0"]="${MYSQL_ROUTER_VERSIONS["8.0"]}-${IMAGE_VERSION}" diff --git a/mysql-server/VERSION b/mysql-server/VERSION index f7d8b04de..543c1f20d 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,12 +1,12 @@ -IMAGE_VERSION=1.2.11-server +IMAGE_VERSION=1.2.12-server declare -A MYSQL_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["5.7"]=5.7.41 -MYSQL_SERVER_VERSIONS["8.0"]=8.0.32 +MYSQL_SERVER_VERSIONS["5.7"]=5.7.42 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.33 declare -A MYSQL_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["5.7"]=8.0.32 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.32 +MYSQL_SHELL_VERSIONS["5.7"]=8.0.33 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.33 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["5.7"]="${MYSQL_SERVER_VERSIONS["5.7"]}-${IMAGE_VERSION}" From 2afe42c54cf3528e4d408be265143504ad6c0f32 Mon Sep 17 00:00:00 2001 From: Robert Neumayer Date: Fri, 3 Mar 2023 18:53:20 +0100 Subject: [PATCH 279/386] Update image tests to work with podman With newer versions of cinc-auditor we can use the podman resource as well as some workaround for the missing docker socket file for the cinc-auditor runs aganist local docker containers. This is done for all of mysql-server, mysql-router, and mysql-cluster images. Change-Id: Ia9b05775e0d77cdd2cc90e59dc8fba1fd5b43e03 --- mysql-cluster/template/control.rb | 11 +++++------ mysql-cluster/test.sh | 10 +++++++--- mysql-router/template/control.rb | 11 +++++------ mysql-router/test.sh | 10 +++++++--- mysql-server/template/control.rb | 11 +++++------ mysql-server/test.sh | 13 +++++++++---- 6 files changed, 38 insertions(+), 28 deletions(-) diff --git a/mysql-cluster/template/control.rb b/mysql-cluster/template/control.rb index 7b5ce76ad..35e00062d 100644 --- a/mysql-cluster/template/control.rb +++ b/mysql-cluster/template/control.rb @@ -1,11 +1,10 @@ control 'container' do impact 0.5 - describe docker_container('mysql-cluster-%%MAJOR_VERSION%%') do - it { should exist } - it { should be_running } - its('repo') { should eq 'mysql/mysql-cluster' } - its('ports') { should eq '%%PORTS%%' } - its('command') { should match '/entrypoint.sh.*' } + describe podman.containers do + its('status') { should cmp /Up/ } + its('commands') { should cmp /entrypoint.sh/ } + its('images') { should cmp /mysql-cluster:%%MAJOR_VERSION%%/ } + its('names') { should include "mysql-cluster-%%MAJOR_VERSION%%" } end end control 'packages' do diff --git a/mysql-cluster/test.sh b/mysql-cluster/test.sh index da202821b..7dc4bd457 100755 --- a/mysql-cluster/test.sh +++ b/mysql-cluster/test.sh @@ -23,9 +23,13 @@ source VERSION MAJOR_VERSIONS=("${!MYSQL_CLUSTER_VERSIONS[@]}"); [ -n "$1" ] && MAJOR_VERSIONS=("${@:1}") for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do - docker run -d -e MYSQL_RANDOM_ROOT_PASSWORD=true --name "mysql-cluster-$MAJOR_VERSION" "mysql/mysql-cluster:$MAJOR_VERSION" --log-error + docker run -d --rm -e MYSQL_RANDOM_ROOT_PASSWORD=true --name "mysql-cluster-$MAJOR_VERSION" "mysql/mysql-cluster:$MAJOR_VERSION" --log-error + export DOCKER_HOST=unix:///tmp/podman.sock + podman system service --time=0 ${DOCKER_HOST} & DOCKER_SOCK_PID="$!" inspec exec --no-color $MAJOR_VERSION/inspec/control.rb --controls container inspec exec --no-color $MAJOR_VERSION/inspec/control.rb -t "docker://mysql-cluster-$MAJOR_VERSION" --controls packages - docker stop "mysql-cluster-$MAJOR_VERSION" - docker rm "mysql-cluster-$MAJOR_VERSION" + docker stop -i "mysql-cluster-$MAJOR_VERSION" + docker rm -i -f "mysql-cluster-$MAJOR_VERSION" + kill -TERM ${DOCKER_SOCK_PID} + rm -f /tmp/podman.sock done diff --git a/mysql-router/template/control.rb b/mysql-router/template/control.rb index ff9a631ee..cfcf5644c 100644 --- a/mysql-router/template/control.rb +++ b/mysql-router/template/control.rb @@ -1,11 +1,10 @@ control 'container' do impact 0.5 - describe docker_container('mysql-router-%%MAJOR_VERSION%%') do - it { should exist } - it { should be_running } - its('repo') { should eq 'mysql/mysql-router' } - its('ports') { should eq '6446-6449/tcp, 8443/tcp' } - its('command') { should match '/run.sh.*' } + describe podman.containers do + its('status') { should cmp /Up/ } + its('commands') { should cmp /run.sh/ } + its('images') { should cmp /mysql-router:%%MAJOR_VERSION%%/ } + its('names') { should include "mysql-router-%%MAJOR_VERSION%%" } end end control 'packages' do diff --git a/mysql-router/test.sh b/mysql-router/test.sh index 01e5a8976..d3f81738a 100755 --- a/mysql-router/test.sh +++ b/mysql-router/test.sh @@ -24,9 +24,13 @@ ARCH=amd64; [ -n "$1" ] && ARCH=$1 for MAJOR_VERSION in "${!MYSQL_ROUTER_VERSIONS[@]}" do - docker run -d -e MYSQL_HOST=x -e MYSQL_PORT=9 -e MYSQL_USER=x -e MYSQL_PASSWORD=x -e MYSQL_INNODB_CLUSTER_MEMBERS=1 --name "mysql-router-$MAJOR_VERSION" mysql/mysql-router:$MAJOR_VERSION-$ARCH sleep 5000 + docker run -d --rm -e MYSQL_HOST=x -e MYSQL_PORT=9 -e MYSQL_USER=x -e MYSQL_PASSWORD=x -e MYSQL_INNODB_CLUSTER_MEMBERS=1 --name "mysql-router-$MAJOR_VERSION" mysql/mysql-router:$MAJOR_VERSION-$ARCH sleep 5000 + export DOCKER_HOST=unix:///tmp/podman.sock + podman system service --time=0 ${DOCKER_HOST} & DOCKER_SOCK_PID="$!" inspec exec $MAJOR_VERSION/inspec/control.rb --controls container inspec exec $MAJOR_VERSION/inspec/control.rb -t "docker://mysql-router-$MAJOR_VERSION" --controls packages - docker stop "mysql-router-$MAJOR_VERSION" - docker rm "mysql-router-$MAJOR_VERSION" + docker stop -i "mysql-router-$MAJOR_VERSION" + docker rm -i -f "mysql-router-$MAJOR_VERSION" + kill -TERM ${DOCKER_SOCK_PID} + rm -f /tmp/podman.sock done diff --git a/mysql-server/template/control.rb b/mysql-server/template/control.rb index 3cb042983..2f3a3cd1a 100644 --- a/mysql-server/template/control.rb +++ b/mysql-server/template/control.rb @@ -1,11 +1,10 @@ control 'container' do impact 0.5 - describe docker_container('mysql-server-%%MAJOR_VERSION%%') do - it { should exist } - it { should be_running } - its('repo') { should eq 'mysql/mysql-server' } - its('ports') { should eq '%%PORTS%%' } - its('command') { should match '/entrypoint.sh mysqld' } + describe podman.containers do + its('status') { should cmp /Up/ } + its('commands') { should cmp /mysqld/ } + its('images') { should cmp /mysql-server:%%MAJOR_VERSION%%/ } + its('names') { should include "mysql-server-%%MAJOR_VERSION%%" } end end control 'packages' do diff --git a/mysql-server/test.sh b/mysql-server/test.sh index 13235ddae..f2cd5f7a2 100755 --- a/mysql-server/test.sh +++ b/mysql-server/test.sh @@ -35,15 +35,20 @@ MAJOR_VERSIONS=("${!MYSQL_SERVER_VERSIONS[@]}"); [ -n "$2" ] && MAJOR_VERSIONS=( for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do - ARCH_SUFFIX="" + ARCH_SUFFIX="" for MULTIARCH_VERSION in ${MULTIARCH_VERSIONS}; do if [[ "$MULTIARCH_VERSION" == "$MAJOR_VERSION" ]]; then ARCH_SUFFIX="-$ARCH" fi done - docker run -d --name "mysql-server-$MAJOR_VERSION" mysql/mysql-server:"$MAJOR_VERSION$ARCH_SUFFIX" + docker run -d --rm --name "mysql-server-$MAJOR_VERSION" mysql/mysql-server:"$MAJOR_VERSION$ARCH_SUFFIX" + export DOCKER_HOST=unix:///tmp/podman.sock + + podman system service --time=0 ${DOCKER_HOST} & DOCKER_SOCK_PID="$!" inspec exec --no-color "$MAJOR_VERSION/inspec/control.rb" --controls container inspec exec --no-color "$MAJOR_VERSION/inspec/control.rb" -t "docker://mysql-server-$MAJOR_VERSION" --controls packages - docker stop "mysql-server-$MAJOR_VERSION" - docker rm "mysql-server-$MAJOR_VERSION" + docker stop -i "mysql-server-$MAJOR_VERSION" + docker rm -i -f "mysql-server-$MAJOR_VERSION" + kill -TERM ${DOCKER_SOCK_PID} + rm -f /tmp/podman.sock done From e0292fb9ea329e20021c9392f3d7722b580d4c54 Mon Sep 17 00:00:00 2001 From: Robert Neumayer Date: Mon, 13 Mar 2023 13:01:26 +0100 Subject: [PATCH 280/386] Use amd64 and arm64 as architecture names Change-Id: I6c01255fac72990d02fad2ed5e797a9e0bd84049 --- mysql-server/manifest.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mysql-server/manifest.sh b/mysql-server/manifest.sh index e0392dfc9..0bb3dae93 100755 --- a/mysql-server/manifest.sh +++ b/mysql-server/manifest.sh @@ -18,7 +18,7 @@ source ./VERSION if grep -q Microsoft /proc/version; then echo "Running on Windows Subsystem for Linux" - # WSL doesn't have its own docker host, we have to use the one + # WSL doesn't have its own docker host, we have to use the one # from Windows itself. # https://medium.com/@sebagomez/installing-the-docker-client-on-ubuntus-windows-subsystem-for-linux-612b392a44c4 export DOCKER_HOST=localhost:2375 @@ -29,8 +29,8 @@ REPO=mysql/mysql-server; [ -n "$1" ] && REPO=$1 for MAJOR_VERSION in ${MULTIARCH_VERSIONS}; do MANIFEST_VERSIONS=$(./tag.sh "" "$MAJOR_VERSION") for MANIFEST_VERSION in $MANIFEST_VERSIONS; do - docker manifest create "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-aarch64" "$REPO:$MANIFEST_VERSION-amd64" - docker manifest annotate "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-aarch64" --os linux --arch arm64 + docker manifest create "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-arm64" "$REPO:$MANIFEST_VERSION-amd64" + docker manifest annotate "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-arm64" --os linux --arch arm64 docker manifest annotate "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-amd64" --os linux --arch amd64 docker manifest push "$REPO:$MANIFEST_VERSION" done From 2280db1a5b886689c4a64cabde98ea7969dd73ad Mon Sep 17 00:00:00 2001 From: Robert Neumayer Date: Mon, 13 Mar 2023 17:31:48 +0100 Subject: [PATCH 281/386] Fix manifest add and push syntax Change-Id: Ic95677824f408685fcfea630dd0c2a43742ee962 --- mysql-server/manifest.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mysql-server/manifest.sh b/mysql-server/manifest.sh index 0bb3dae93..d4ae5b459 100755 --- a/mysql-server/manifest.sh +++ b/mysql-server/manifest.sh @@ -29,9 +29,11 @@ REPO=mysql/mysql-server; [ -n "$1" ] && REPO=$1 for MAJOR_VERSION in ${MULTIARCH_VERSIONS}; do MANIFEST_VERSIONS=$(./tag.sh "" "$MAJOR_VERSION") for MANIFEST_VERSION in $MANIFEST_VERSIONS; do + docker pull "$REPO:$MANIFEST_VERSION-arm64" "$REPO:$MANIFEST_VERSION-amd64" docker manifest create "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-arm64" "$REPO:$MANIFEST_VERSION-amd64" - docker manifest annotate "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-arm64" --os linux --arch arm64 - docker manifest annotate "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-amd64" --os linux --arch amd64 - docker manifest push "$REPO:$MANIFEST_VERSION" + docker manifest add "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-arm64" --os linux --arch arm64 + docker manifest add "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-amd64" --os linux --arch amd64 + docker manifest push "$REPO:$MANIFEST_VERSION" "docker://$REPO:$MANIFEST_VERSION" + done done From d9927a691e2a0bac07183bc321b00e126fb1a95a Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 14 Mar 2023 08:42:44 +0100 Subject: [PATCH 282/386] Update tests for podman support Use podman commands instead of docker, and fix a command check for cluster containers. Change-Id: I0869598cc44e975c16d6d02b3e71a5d799701172 --- mysql-cluster/template/control.rb | 2 +- mysql-cluster/test.sh | 6 +++--- mysql-server/test.sh | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mysql-cluster/template/control.rb b/mysql-cluster/template/control.rb index 35e00062d..5f9d77675 100644 --- a/mysql-cluster/template/control.rb +++ b/mysql-cluster/template/control.rb @@ -2,7 +2,7 @@ impact 0.5 describe podman.containers do its('status') { should cmp /Up/ } - its('commands') { should cmp /entrypoint.sh/ } + its('commands') { should cmp /mysqld/ } its('images') { should cmp /mysql-cluster:%%MAJOR_VERSION%%/ } its('names') { should include "mysql-cluster-%%MAJOR_VERSION%%" } end diff --git a/mysql-cluster/test.sh b/mysql-cluster/test.sh index 7dc4bd457..827d62e8b 100755 --- a/mysql-cluster/test.sh +++ b/mysql-cluster/test.sh @@ -23,13 +23,13 @@ source VERSION MAJOR_VERSIONS=("${!MYSQL_CLUSTER_VERSIONS[@]}"); [ -n "$1" ] && MAJOR_VERSIONS=("${@:1}") for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do - docker run -d --rm -e MYSQL_RANDOM_ROOT_PASSWORD=true --name "mysql-cluster-$MAJOR_VERSION" "mysql/mysql-cluster:$MAJOR_VERSION" --log-error + podman run -d --rm --name "mysql-cluster-$MAJOR_VERSION" "mysql/mysql-cluster:$MAJOR_VERSION" export DOCKER_HOST=unix:///tmp/podman.sock podman system service --time=0 ${DOCKER_HOST} & DOCKER_SOCK_PID="$!" inspec exec --no-color $MAJOR_VERSION/inspec/control.rb --controls container inspec exec --no-color $MAJOR_VERSION/inspec/control.rb -t "docker://mysql-cluster-$MAJOR_VERSION" --controls packages - docker stop -i "mysql-cluster-$MAJOR_VERSION" - docker rm -i -f "mysql-cluster-$MAJOR_VERSION" + podman stop -i "mysql-cluster-$MAJOR_VERSION" + podman rm -i -f "mysql-cluster-$MAJOR_VERSION" kill -TERM ${DOCKER_SOCK_PID} rm -f /tmp/podman.sock done diff --git a/mysql-server/test.sh b/mysql-server/test.sh index f2cd5f7a2..cb644163d 100755 --- a/mysql-server/test.sh +++ b/mysql-server/test.sh @@ -41,14 +41,14 @@ for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do ARCH_SUFFIX="-$ARCH" fi done - docker run -d --rm --name "mysql-server-$MAJOR_VERSION" mysql/mysql-server:"$MAJOR_VERSION$ARCH_SUFFIX" + podman run -d --rm --name "mysql-server-$MAJOR_VERSION" mysql/mysql-server:"$MAJOR_VERSION$ARCH_SUFFIX" export DOCKER_HOST=unix:///tmp/podman.sock podman system service --time=0 ${DOCKER_HOST} & DOCKER_SOCK_PID="$!" inspec exec --no-color "$MAJOR_VERSION/inspec/control.rb" --controls container inspec exec --no-color "$MAJOR_VERSION/inspec/control.rb" -t "docker://mysql-server-$MAJOR_VERSION" --controls packages - docker stop -i "mysql-server-$MAJOR_VERSION" - docker rm -i -f "mysql-server-$MAJOR_VERSION" + podman stop -i "mysql-server-$MAJOR_VERSION" + podman rm -i -f "mysql-server-$MAJOR_VERSION" kill -TERM ${DOCKER_SOCK_PID} rm -f /tmp/podman.sock done From 1956e2dbb4c0322b8e840737823c3a7b19d4f91a Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 14 Mar 2023 14:07:53 +0100 Subject: [PATCH 283/386] Router: Update tests for podman - Use podman commands instead of docker - Fix command comparison Change-Id: I301bff99785cdb954cecd1194f5e43f9e7364a1a --- mysql-router/template/control.rb | 2 +- mysql-router/test.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-router/template/control.rb b/mysql-router/template/control.rb index cfcf5644c..e0b6f5e1b 100644 --- a/mysql-router/template/control.rb +++ b/mysql-router/template/control.rb @@ -2,7 +2,7 @@ impact 0.5 describe podman.containers do its('status') { should cmp /Up/ } - its('commands') { should cmp /run.sh/ } + its('commands') { should cmp /mysqlrouter/ } its('images') { should cmp /mysql-router:%%MAJOR_VERSION%%/ } its('names') { should include "mysql-router-%%MAJOR_VERSION%%" } end diff --git a/mysql-router/test.sh b/mysql-router/test.sh index d3f81738a..6d518ed35 100755 --- a/mysql-router/test.sh +++ b/mysql-router/test.sh @@ -24,13 +24,13 @@ ARCH=amd64; [ -n "$1" ] && ARCH=$1 for MAJOR_VERSION in "${!MYSQL_ROUTER_VERSIONS[@]}" do - docker run -d --rm -e MYSQL_HOST=x -e MYSQL_PORT=9 -e MYSQL_USER=x -e MYSQL_PASSWORD=x -e MYSQL_INNODB_CLUSTER_MEMBERS=1 --name "mysql-router-$MAJOR_VERSION" mysql/mysql-router:$MAJOR_VERSION-$ARCH sleep 5000 + podman run -d --rm -e MYSQL_HOST=x -e MYSQL_PORT=9 -e MYSQL_USER=x -e MYSQL_PASSWORD=x -e MYSQL_INNODB_CLUSTER_MEMBERS=1 --name "mysql-router-$MAJOR_VERSION" mysql/mysql-router:$MAJOR_VERSION-$ARCH sleep 5000 export DOCKER_HOST=unix:///tmp/podman.sock podman system service --time=0 ${DOCKER_HOST} & DOCKER_SOCK_PID="$!" inspec exec $MAJOR_VERSION/inspec/control.rb --controls container inspec exec $MAJOR_VERSION/inspec/control.rb -t "docker://mysql-router-$MAJOR_VERSION" --controls packages - docker stop -i "mysql-router-$MAJOR_VERSION" - docker rm -i -f "mysql-router-$MAJOR_VERSION" + podman stop -i "mysql-router-$MAJOR_VERSION" + podman rm -i -f "mysql-router-$MAJOR_VERSION" kill -TERM ${DOCKER_SOCK_PID} rm -f /tmp/podman.sock done From fd19b23b5be461f061e4d67d2658f3be9765d80e Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 14 Mar 2023 14:16:39 +0100 Subject: [PATCH 284/386] Switch to arm64 for arm tags This is needed for the current setup with podman Change-Id: I96f61579f7c8ff15dd31c350f1e0926e25e0407c Change-Id: Ia905dfaacb69896b93525c76e5126341583b3040 --- mysql-router/manifest.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-router/manifest.sh b/mysql-router/manifest.sh index 3e804d73d..51b09d1e9 100755 --- a/mysql-router/manifest.sh +++ b/mysql-router/manifest.sh @@ -29,8 +29,8 @@ REPO=mysql/mysql-router; [ -n "$1" ] && REPO=$1 for MAJOR_VERSION in ${MULTIARCH_VERSIONS}; do MANIFEST_VERSIONS=$(./tag.sh "" "$MAJOR_VERSION") for MANIFEST_VERSION in $MANIFEST_VERSIONS; do - docker manifest create "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-aarch64" "$REPO:$MANIFEST_VERSION-amd64" - docker manifest annotate "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-aarch64" --os linux --arch arm64 + docker manifest create "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-arm64" "$REPO:$MANIFEST_VERSION-amd64" + docker manifest annotate "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-arm64" --os linux --arch arm64 docker manifest annotate "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-amd64" --os linux --arch amd64 docker manifest push "$REPO:$MANIFEST_VERSION" done From 924340e887723e68274a3e23e018a25239f42857 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Tue, 14 Mar 2023 17:33:42 +0100 Subject: [PATCH 285/386] Router: Test for the correct command For the sanity checking of the image, we just run it with a sleep, as the test mainly checks that the packages are installed correctly. Change-Id: Icd7b2f76dc7b4a97fffc18414de1cea853bdd85f --- mysql-router/template/control.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-router/template/control.rb b/mysql-router/template/control.rb index e0b6f5e1b..3f6bb45b1 100644 --- a/mysql-router/template/control.rb +++ b/mysql-router/template/control.rb @@ -2,7 +2,7 @@ impact 0.5 describe podman.containers do its('status') { should cmp /Up/ } - its('commands') { should cmp /mysqlrouter/ } + its('commands') { should cmp /sleep/ } its('images') { should cmp /mysql-router:%%MAJOR_VERSION%%/ } its('names') { should include "mysql-router-%%MAJOR_VERSION%%" } end From a8ba004a99d51a519d907d27935860d59364c365 Mon Sep 17 00:00:00 2001 From: Prashant Tekriwal Date: Fri, 24 Mar 2023 06:06:23 +0100 Subject: [PATCH 286/386] ET#70570 - Use weekly yum repo for weekly server build Change-Id: Ie611692523267525b134bbeab11f196cb453f44c --- mysql-server/template/Dockerfile-pre8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-server/template/Dockerfile-pre8 b/mysql-server/template/Dockerfile-pre8 index 9fb4cdb00..9ce57dfc8 100644 --- a/mysql-server/template/Dockerfile-pre8 +++ b/mysql-server/template/Dockerfile-pre8 @@ -23,7 +23,7 @@ RUN rpm -U %%REPO%%/mysql-community-minimal-release-el7.rpm \ # Install server and shell 8.0 RUN yum install -y $MYSQL_SHELL_PACKAGE \ - && yum install -y $MYSQL_SERVER_PACKAGE --enablerepo=mysql57-community-minimal\ + && yum install -y $MYSQL_SERVER_PACKAGE --enablerepo=%%REPO_NAME_SERVER%% \ && yum clean all \ && mkdir /docker-entrypoint-initdb.d From 6ad276546ae78f2e449fe5762053341fad4a09be Mon Sep 17 00:00:00 2001 From: Prashant Tekriwal Date: Fri, 24 Mar 2023 07:10:59 +0100 Subject: [PATCH 287/386] ET#70570 - Use weekly-tools-community for shell Change-Id: I7eea067dfedede6b75b5775db1874241feab9b85 --- mysql-server/template/Dockerfile-pre8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-server/template/Dockerfile-pre8 b/mysql-server/template/Dockerfile-pre8 index 9ce57dfc8..13c652a92 100644 --- a/mysql-server/template/Dockerfile-pre8 +++ b/mysql-server/template/Dockerfile-pre8 @@ -22,7 +22,7 @@ RUN rpm -U %%REPO%%/mysql-community-minimal-release-el7.rpm \ && rpm -U %%REPO%%/mysql80-community-release-el7.rpm # Install server and shell 8.0 -RUN yum install -y $MYSQL_SHELL_PACKAGE \ +RUN yum install -y $MYSQL_SHELL_PACKAGE --enablerepo=%%REPO_NAME_TOOLS%% \ && yum install -y $MYSQL_SERVER_PACKAGE --enablerepo=%%REPO_NAME_SERVER%% \ && yum clean all \ && mkdir /docker-entrypoint-initdb.d From dc2dc8e1ea75eaac7c44c248e216c99c1828220d Mon Sep 17 00:00:00 2001 From: Prashant Tekriwal Date: Tue, 4 Apr 2023 15:00:41 +0200 Subject: [PATCH 288/386] ET#70570 - [docker] setup weekly router docker image builds Change-Id: I82c48a9ea12bd0c957bd679cca8b544f79af25e5 --- mysql-router/gen_dockerfiles.sh | 6 ++++-- mysql-router/template/Dockerfile | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/mysql-router/gen_dockerfiles.sh b/mysql-router/gen_dockerfiles.sh index 321a907ed..6ae6d87c0 100755 --- a/mysql-router/gen_dockerfiles.sh +++ b/mysql-router/gen_dockerfiles.sh @@ -9,13 +9,15 @@ MYSQL_CLIENT_PACKAGE=mysql-community-client-${MYSQL_SERVER_VERSIONS[${MAJOR_VERS MYSQL_ROUTER_PACKAGE=mysql-router-community-${MYSQL_ROUTER_VERSIONS[${MAJOR_VERSION}]}; [ -n "$4" ] && MYSQL_ROUTER_PACKAGE=$4 MYSQL_CLIENT_PACKAGE_TEST=mysql-community-client; [ -n "$5" ] && MYSQL_CLIENT_PACKAGE_TEST=$5 MYSQL_ROUTER_PACKAGE_TEST=mysql-router-community; [ -n "$6" ] && MYSQL_ROUTER_PACKAGE_TEST=$6 +REPO_NAME_SERVER=mysql80-community; [ -n "$7" ] && REPO_NAME_SERVER=$7 +REPO_NAME_TOOLS=mysql-tools-community; [ -n "$8" ] && REPO_NAME_TOOLS=$8 for MAJOR_VERSION in "${!MYSQL_ROUTER_VERSIONS[@]}"; do sed 's#%%MYSQL_CLIENT_PACKAGE%%#'"${MYSQL_CLIENT_PACKAGE}"'#g' template/Dockerfile > tmpFile sed -i 's#%%MYSQL_ROUTER_PACKAGE%%#'"${MYSQL_ROUTER_PACKAGE}"'#g' tmpFile sed -i 's#%%CONFIG_PACKAGE_NAME%%#'"${CONFIG_PACKAGE_NAME}"'#g' tmpFile sed -i 's#%%REPO%%#'"${REPO}"'#g' tmpFile - REPO_VERSION=${MAJOR_VERSION//\./} - sed -i 's#%%REPO_VERSION%%#'"${REPO_VERSION}"'#g' tmpFile + sed -i 's#%%REPO_NAME_SERVER%%#'"${REPO_NAME_SERVER}"'#g' tmpFile + sed -i 's#%%REPO_NAME_TOOLS%%#'"${REPO_NAME_TOOLS}"'#g' tmpFile mv tmpFile $MAJOR_VERSION/Dockerfile # update test template diff --git a/mysql-router/template/Dockerfile b/mysql-router/template/Dockerfile index 6769a63da..71c7aa23a 100644 --- a/mysql-router/template/Dockerfile +++ b/mysql-router/template/Dockerfile @@ -17,13 +17,17 @@ FROM container-registry.oracle.com/os/oraclelinux:8-slim ARG MYSQL_CLIENT_PACKAGE=%%MYSQL_CLIENT_PACKAGE%% ARG MYSQL_ROUTER_PACKAGE=%%MYSQL_ROUTER_PACKAGE%% ARG CONFIG_PACKAGE_NAME=%%CONFIG_PACKAGE_NAME%% +ARG REPO_NAME_SERVER=%%REPO_NAME_SERVER%% +ARG REPO_NAME_TOOLS=%%REPO_NAME_TOOLS%% RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ -c "MySQL Router" mysqlrouter \ && rpm -U %%REPO%%/$CONFIG_PACKAGE_NAME \ - && microdnf install -y --disablerepo=ol8_appstream \ - $MYSQL_CLIENT_PACKAGE $MYSQL_ROUTER_PACKAGE \ + && microdnf install -y --disablerepo=\* \ + --enablerepo=%%REPO_NAME_SERVER%% $MYSQL_CLIENT_PACKAGE \ + && microdnf install -y --disablerepo=\* \ + --enablerepo=%%REPO_NAME_TOOLS%% $MYSQL_ROUTER_PACKAGE \ && microdnf clean all COPY run.sh /run.sh From 72cb7d7bbc45d4f6d2bce363c58fc16e8fc4dab3 Mon Sep 17 00:00:00 2001 From: Prashant Tekriwal Date: Fri, 7 Apr 2023 15:01:14 +0200 Subject: [PATCH 289/386] Fix for ET#77620, 77619, 77611, 70570 * ET#77620 - server 57 main docker build using server 8.0 pkg * ET#77619 - weekly80 enterprise server docker build is using wrong docker branch * ET#77611 - wrong tags assigned to weekly docker images * ET#70570 - Use proper versions for testing weekly and non-8.0 docker builds Change-Id: I30ff94473dc58eb92375e23e26b577fed7082e16 --- mysql-router/VERSION | 10 +-- mysql-router/gen_dockerfiles.sh | 56 ++++++------- mysql-router/tag.sh | 13 +++- mysql-router/template/control.rb | 8 +- mysql-server/VERSION | 12 +-- mysql-server/gen_dockerfiles.sh | 130 +++++++++++++++---------------- mysql-server/tag.sh | 18 ++++- mysql-server/template/control.rb | 4 +- 8 files changed, 136 insertions(+), 115 deletions(-) diff --git a/mysql-router/VERSION b/mysql-router/VERSION index 7512ed1db..e4f327024 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -1,11 +1,11 @@ IMAGE_VERSION=1.0.12-router -declare -A MYSQL_ROUTER_VERSIONS +declare -A MYSQL_ROUTER_VERSIONS WEEKLY_ROUTER_VERSIONS MYSQL_ROUTER_VERSIONS["8.0"]=8.0.33 -declare -A MYSQL_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["8.0"]=8.0.33 +WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.34 -declare -A FULL_ROUTER_VERSIONS -FULL_ROUTER_VERSIONS["8.0"]="${MYSQL_ROUTER_VERSIONS["8.0"]}-${IMAGE_VERSION}" +declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS +MYSQL_SERVER_VERSIONS["8.0"]=8.0.33 +WEEKLY_SERVER_VERSIONS["8.0"]=8.0.34 MULTIARCH_VERSIONS="8.0" LATEST="8.0" diff --git a/mysql-router/gen_dockerfiles.sh b/mysql-router/gen_dockerfiles.sh index 6ae6d87c0..d0a6521d2 100755 --- a/mysql-router/gen_dockerfiles.sh +++ b/mysql-router/gen_dockerfiles.sh @@ -5,36 +5,38 @@ source ./VERSION REPO=https://repo.mysql.com; [ -n "$1" ] && REPO=$1 CONFIG_PACKAGE_NAME=mysql80-community-release-el8.rpm; [ -n "$2" ] && CONFIG_PACKAGE_NAME=$2 -MYSQL_CLIENT_PACKAGE=mysql-community-client-${MYSQL_SERVER_VERSIONS[${MAJOR_VERSION}]}; [ -n "$3" ] && MYSQL_CLIENT_PACKAGE=$3 -MYSQL_ROUTER_PACKAGE=mysql-router-community-${MYSQL_ROUTER_VERSIONS[${MAJOR_VERSION}]}; [ -n "$4" ] && MYSQL_ROUTER_PACKAGE=$4 -MYSQL_CLIENT_PACKAGE_TEST=mysql-community-client; [ -n "$5" ] && MYSQL_CLIENT_PACKAGE_TEST=$5 -MYSQL_ROUTER_PACKAGE_TEST=mysql-router-community; [ -n "$6" ] && MYSQL_ROUTER_PACKAGE_TEST=$6 +MYSQL_CLIENT_PACKAGE_NAME=mysql-community-client; [ -n "$3" ] && MYSQL_CLIENT_PACKAGE_NAME=$3 +MYSQL_ROUTER_PACKAGE_NAME=mysql-router-community; [ -n "$4" ] && MYSQL_ROUTER_PACKAGE_NAME=$4 +MYSQL_CLIENT_VERSION=mysql-community-client; [ -n "$5" ] && MYSQL_CLIENT_VERSION=$5 +MYSQL_ROUTER_VERSION=mysql-router-community; [ -n "$6" ] && MYSQL_ROUTER_VERSION=$6 REPO_NAME_SERVER=mysql80-community; [ -n "$7" ] && REPO_NAME_SERVER=$7 REPO_NAME_TOOLS=mysql-tools-community; [ -n "$8" ] && REPO_NAME_TOOLS=$8 -for MAJOR_VERSION in "${!MYSQL_ROUTER_VERSIONS[@]}"; do - sed 's#%%MYSQL_CLIENT_PACKAGE%%#'"${MYSQL_CLIENT_PACKAGE}"'#g' template/Dockerfile > tmpFile - sed -i 's#%%MYSQL_ROUTER_PACKAGE%%#'"${MYSQL_ROUTER_PACKAGE}"'#g' tmpFile - sed -i 's#%%CONFIG_PACKAGE_NAME%%#'"${CONFIG_PACKAGE_NAME}"'#g' tmpFile - sed -i 's#%%REPO%%#'"${REPO}"'#g' tmpFile - sed -i 's#%%REPO_NAME_SERVER%%#'"${REPO_NAME_SERVER}"'#g' tmpFile - sed -i 's#%%REPO_NAME_TOOLS%%#'"${REPO_NAME_TOOLS}"'#g' tmpFile - mv tmpFile $MAJOR_VERSION/Dockerfile - # update test template - sed -e 's#%%MYSQL_CLIENT_PACKAGE_TEST%%#'"${MYSQL_CLIENT_PACKAGE_TEST}"'#g' template/control.rb > tmpFile - sed -i -e 's#%%MYSQL_CLIENT_PACKAGE_VERSION%%#'"${MYSQL_SERVER_VERSIONS[${MAJOR_VERSION}]}"'#g' tmpFile - sed -i -e 's#%%MYSQL_ROUTER_PACKAGE_TEST%%#'"${MYSQL_ROUTER_PACKAGE_TEST}"'#g' tmpFile - sed -i -e 's#%%MYSQL_ROUTER_PACKAGE_VERSION%%#'"${MYSQL_ROUTER_VERSIONS[${MAJOR_VERSION}]}"'#g' tmpFile - sed -i -e 's#%%MAJOR_VERSION%%#'"${MAJOR_VERSION}"'#g' tmpFile - if [ ! -d "${MAJOR_VERSION}/inspec" ]; then - mkdir "${MAJOR_VERSION}/inspec" - fi - mv tmpFile "${MAJOR_VERSION}/inspec/control.rb" +MAJOR_VERSION=$(echo $MYSQL_CLIENT_VERSION | cut -d'.' -f'1,2') +MYSQL_CLIENT_PACKAGE=$MYSQL_CLIENT_PACKAGE_NAME-$MYSQL_CLIENT_VERSION +MYSQL_ROUTER_PACKAGE=$MYSQL_ROUTER_PACKAGE_NAME-$MYSQL_ROUTER_VERSION - # copy entrypoint script - cp template/run.sh $MAJOR_VERSION/run.sh - chmod +x $MAJOR_VERSION/run.sh +sed 's#%%MYSQL_CLIENT_PACKAGE%%#'"${MYSQL_CLIENT_PACKAGE}"'#g' template/Dockerfile > tmpFile +sed -i 's#%%MYSQL_ROUTER_PACKAGE%%#'"${MYSQL_ROUTER_PACKAGE}"'#g' tmpFile +sed -i 's#%%CONFIG_PACKAGE_NAME%%#'"${CONFIG_PACKAGE_NAME}"'#g' tmpFile +sed -i 's#%%REPO%%#'"${REPO}"'#g' tmpFile +sed -i 's#%%REPO_NAME_SERVER%%#'"${REPO_NAME_SERVER}"'#g' tmpFile +sed -i 's#%%REPO_NAME_TOOLS%%#'"${REPO_NAME_TOOLS}"'#g' tmpFile +mv tmpFile $MAJOR_VERSION/Dockerfile - cp README.md $MAJOR_VERSION/ -done +# update test template +sed -e 's#%%MYSQL_CLIENT_PACKAGE_NAME%%#'"${MYSQL_CLIENT_PACKAGE_NAME}"'#g' template/control.rb > tmpFile +sed -i -e 's#%%MYSQL_CLIENT_VERSION%%#'"${MYSQL_CLIENT_VERSION}"'#g' tmpFile +sed -i -e 's#%%MYSQL_ROUTER_PACKAGE_NAME%%#'"${MYSQL_ROUTER_PACKAGE_NAME}"'#g' tmpFile +sed -i -e 's#%%MYSQL_ROUTER_VERSION%%#'"${MYSQL_ROUTER_VERSION}"'#g' tmpFile +sed -i -e 's#%%MAJOR_VERSION%%#'"${MAJOR_VERSION}"'#g' tmpFile +if [ ! -d "${MAJOR_VERSION}/inspec" ]; then + mkdir "${MAJOR_VERSION}/inspec" +fi +mv tmpFile "${MAJOR_VERSION}/inspec/control.rb" +# copy entrypoint script +cp template/run.sh $MAJOR_VERSION/run.sh +chmod +x $MAJOR_VERSION/run.sh + +cp README.md $MAJOR_VERSION/ diff --git a/mysql-router/tag.sh b/mysql-router/tag.sh index 9f2a41615..7c5c0869b 100755 --- a/mysql-router/tag.sh +++ b/mysql-router/tag.sh @@ -6,15 +6,22 @@ source VERSION SUFFIX='' [ -n "$1" ] && SUFFIX=$1 MAJOR_VERSIONS=("${!MYSQL_ROUTER_VERSIONS[@]}"); [ -n "$2" ] && MAJOR_VERSIONS=("${@:2}") +WEEKLY='' [ -n "$3" ] && WEEKLY=$3 for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do for MULTIARCH_VERSION in ${MULTIARCH_VERSIONS}; do if [[ "$MULTIARCH_VERSION" == "$MAJOR_VERSION" ]]; then - if [[ "$MAJOR_VERSION" == "$LATEST" ]]; then - echo "$MAJOR_VERSION ${MYSQL_ROUTER_VERSIONS["$MAJOR_VERSION"]} ${FULL_ROUTER_VERSIONS["$MAJOR_VERSION"]} latest" + if [ "$WEEKLY" == "1" ]; then + ROUTER_VERSION=${WEEKLY_ROUTER_VERSIONS["${MAJOR_VERSION}"]} else - echo "$MAJOR_VERSION ${MYSQL_ROUTER_VERSIONS["$MAJOR_VERSION"]} ${FULL_ROUTER_VERSIONS["$MAJOR_VERSION"]}" + ROUTER_VERSION=${MYSQL_ROUTER_VERSIONS["${MAJOR_VERSION}"]} + fi + FULL_ROUTER_VERSION="${ROUTER_VERSION}-${IMAGE_VERSION}" + TAGS="${ROUTER_VERSION}${SUFFIX} ${FULL_ROUTER_VERSION}${SUFFIX}" + if [[ "$MAJOR_VERSION" == "$LATEST" ]]; then + TAGS="$TAGS latest${SUFFIX}" fi + echo $TAGS fi done done diff --git a/mysql-router/template/control.rb b/mysql-router/template/control.rb index 3f6bb45b1..5491164a4 100644 --- a/mysql-router/template/control.rb +++ b/mysql-router/template/control.rb @@ -9,12 +9,12 @@ end control 'packages' do impact 0.5 - describe package('%%MYSQL_CLIENT_PACKAGE_TEST%%') do + describe package('%%MYSQL_CLIENT_PACKAGE_NAME%%') do it { should be_installed } - its ('version') { should match '%%MYSQL_CLIENT_PACKAGE_VERSION%%.*' } + its ('version') { should match '%%MYSQL_CLIENT_VERSION%%.*' } end - describe package('%%MYSQL_ROUTER_PACKAGE_TEST%%') do + describe package('%%MYSQL_ROUTER_PACKAGE_NAME%%') do it { should be_installed } - its ('version') { should match '%%MYSQL_ROUTER_PACKAGE_VERSION%%.*' } + its ('version') { should match '%%MYSQL_ROUTER_VERSION%%.*' } end end diff --git a/mysql-server/VERSION b/mysql-server/VERSION index 543c1f20d..26ac3b60d 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,16 +1,18 @@ IMAGE_VERSION=1.2.12-server -declare -A MYSQL_SERVER_VERSIONS +declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["5.7"]=5.7.42 MYSQL_SERVER_VERSIONS["8.0"]=8.0.33 -declare -A MYSQL_SHELL_VERSIONS +WEEKLY_SERVER_VERSIONS["5.7"]=5.7.43 +WEEKLY_SERVER_VERSIONS["8.0"]=8.0.34 + +declare -A MYSQL_SHELL_VERSIONS WEEKLY_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["5.7"]=8.0.33 MYSQL_SHELL_VERSIONS["8.0"]=8.0.33 -declare -A FULL_SERVER_VERSIONS -FULL_SERVER_VERSIONS["5.7"]="${MYSQL_SERVER_VERSIONS["5.7"]}-${IMAGE_VERSION}" -FULL_SERVER_VERSIONS["8.0"]="${MYSQL_SERVER_VERSIONS["8.0"]}-${IMAGE_VERSION}" +WEEKLY_SHELL_VERSIONS["5.7"]=8.0.34 +WEEKLY_SHELL_VERSIONS["8.0"]=8.0.34 MULTIARCH_VERSIONS="8.0" SINGLEARCH_VERSIONS="5.7" diff --git a/mysql-server/gen_dockerfiles.sh b/mysql-server/gen_dockerfiles.sh index dcb2af0fc..9620a004d 100755 --- a/mysql-server/gen_dockerfiles.sh +++ b/mysql-server/gen_dockerfiles.sh @@ -31,6 +31,8 @@ REPO_NAME_TOOLS=mysql-tools-community; [ -n "$5" ] && REPO_NAME_TOOLS=$5 MYSQL_SERVER_PACKAGE_NAME="mysql-community-server-minimal"; [ -n "$6" ] && MYSQL_SERVER_PACKAGE_NAME=$6 MYSQL_SHELL_PACKAGE_NAME="mysql-shell"; [ -n "$7" ] && MYSQL_SHELL_PACKAGE_NAME=$7 MYSQL_VERSION=""; [ -n "$8" ] && MYSQL_VERSION=$8 +SHELL_VERSION=""; [ -n "$9" ] && SHELL_VERSION=$9 + # 33060 is the default port for the mysqlx plugin, new to 5.7 declare -A PORTS PORTS["5.7"]="3306 33060" @@ -51,68 +53,66 @@ declare -A PRECREATE_DIRS PRECREATE_DIRS["5.7"]="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" PRECREATE_DIRS["8.0"]="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" -for VERSION in "${!MYSQL_SERVER_VERSIONS[@]}" -do - if [ -n "${MYSQL_VERSION}" ]; then - MYSQL_SERVER_PACKAGE=${MYSQL_SERVER_PACKAGE_NAME}-${MYSQL_VERSION} - MYSQL_SHELL_PACKAGE=${MYSQL_SHELL_PACKAGE_NAME}-${MYSQL_VERSION} - else - MYSQL_SERVER_PACKAGE=${MYSQL_SERVER_PACKAGE_NAME} - MYSQL_SHELL_PACKAGE=${MYSQL_SHELL_PACKAGE_NAME} - fi - # Dockerfiles - MYSQL_SERVER_REPOPATH=yum/mysql-$VERSION-community/docker/x86_64 - DOCKERFILE_TEMPLATE=template/Dockerfile - if [ "${VERSION}" != "8.0" ]; then - DOCKERFILE_TEMPLATE=template/Dockerfile-pre8 - fi - sed 's#%%MYSQL_SERVER_PACKAGE%%#'"${MYSQL_SERVER_PACKAGE}"'#g' $DOCKERFILE_TEMPLATE > tmpfile - sed -i 's#%%REPO%%#'"${REPO}"'#g' tmpfile - REPO_VERSION=${VERSION//\./} - sed -i 's#%%REPO_VERSION%%#'"${REPO_VERSION}"'#g' tmpfile - - sed -i 's#%%CONFIG_PACKAGE_NAME%%#'"${CONFIG_PACKAGE_NAME}"'#g' tmpfile - sed -i 's#%%CONFIG_PACKAGE_NAME_MINIMAL%%#'"${CONFIG_PACKAGE_NAME_MINIMAL}"'#g' tmpfile - sed -i 's#%%REPO_NAME_SERVER%%#'"${REPO_NAME_SERVER}"'#g' tmpfile - sed -i 's#%%REPO_NAME_TOOLS%%#'"${REPO_NAME_TOOLS}"'#g' tmpfile - - if [[ ! -z ${MYSQL_SHELL_VERSIONS[${VERSION}]} ]]; then - sed -i 's#%%MYSQL_SHELL_PACKAGE%%#'"${MYSQL_SHELL_PACKAGE}"'#g' tmpfile - else - sed -i 's#%%MYSQL_SHELL_PACKAGE%%#'""'#g' tmpfile - fi - - sed -i 's/%%PORTS%%/'"${PORTS[${VERSION}]}"'/g' tmpfile - mv tmpfile ${VERSION}/Dockerfile - - # Dockerfile_spec.rb - if [ ! -d "${VERSION}/inspec" ]; then - mkdir "${VERSION}/inspec" - fi - sed 's#%%MYSQL_VERSION%%#'"${MYSQL_VERSION}"'#g' template/control.rb > tmpFile - sed -i 's#%%MYSQL_SERVER_PACKAGE_NAME%%#'"${MYSQL_SERVER_PACKAGE_NAME}"'#g' tmpFile - sed -i 's#%%MYSQL_SHELL_PACKAGE_NAME%%#'"${MYSQL_SHELL_PACKAGE_NAME}"'#g' tmpFile - sed -i 's#%%MAJOR_VERSION%%#'"${VERSION}"'#g' tmpFile - if [ "${VERSION}" == "5.7" ]; then - sed -i 's#%%PORTS%%#'"3306/tcp, 33060/tcp"'#g' tmpFile - else - sed -i 's#%%PORTS%%#'"3306/tcp, 33060-33061/tcp"'#g' tmpFile - fi - mv tmpFile "${VERSION}/inspec/control.rb" - - # Entrypoint - sed 's#%%PASSWORDSET%%#'"${PASSWORDSET[${VERSION}]}"'#g' template/docker-entrypoint.sh > tmpfile - sed -i 's#%%FULL_SERVER_VERSION%%#'"${FULL_SERVER_VERSIONS[${VERSION}]}"'#g' tmpfile - sed -i 's#%%VALIDATE_CONFIG%%#'"${VALIDATE_CONFIG[${VERSION}]}"'#g' tmpfile - mv tmpfile ${VERSION}/docker-entrypoint.sh - chmod +x ${VERSION}/docker-entrypoint.sh - - # Healthcheck - cp template/healthcheck.sh ${VERSION}/ - chmod +x ${VERSION}/healthcheck.sh - - # Build-time preparation script - sed 's#%%PRECREATE_DIRS%%#'"${PRECREATE_DIRS[${VERSION}]}"'#g' template/prepare-image.sh > tmpfile - mv tmpfile ${VERSION}/prepare-image.sh - chmod +x ${VERSION}/prepare-image.sh -done +declare -A DOCKERFILE_TEMPLATES +DOCKERFILE_TEMPLATES["5.7"]="template/Dockerfile-pre8" +DOCKERFILE_TEMPLATES["8.0"]="template/Dockerfile" + +declare -A SPEC_PORTS +SPEC_PORTS["5.7"]="3306/tcp, 33060/tcp" +SPEC_PORTS["8.0"]="3306/tcp, 33060-33061/tcp" + +# Get the Major Version +VERSION=$(echo $MYSQL_VERSION | cut -d'.' -f'1,2') + +MYSQL_SERVER_PACKAGE=${MYSQL_SERVER_PACKAGE_NAME}-${MYSQL_VERSION} +MYSQL_SHELL_PACKAGE=${MYSQL_SHELL_PACKAGE_NAME}-${SHELL_VERSION} + +# Dockerfiles +MYSQL_SERVER_REPOPATH=yum/mysql-$VERSION-community/docker/x86_64 + +sed 's#%%MYSQL_SERVER_PACKAGE%%#'"${MYSQL_SERVER_PACKAGE}"'#g' ${DOCKERFILE_TEMPLATES[${VERSION}]} > tmpfile +sed -i 's#%%REPO%%#'"${REPO}"'#g' tmpfile + +REPO_VERSION=${VERSION//\./} +sed -i 's#%%REPO_VERSION%%#'"${REPO_VERSION}"'#g' tmpfile + +sed -i 's#%%CONFIG_PACKAGE_NAME%%#'"${CONFIG_PACKAGE_NAME}"'#g' tmpfile +sed -i 's#%%CONFIG_PACKAGE_NAME_MINIMAL%%#'"${CONFIG_PACKAGE_NAME_MINIMAL}"'#g' tmpfile +sed -i 's#%%REPO_NAME_SERVER%%#'"${REPO_NAME_SERVER}"'#g' tmpfile +sed -i 's#%%REPO_NAME_TOOLS%%#'"${REPO_NAME_TOOLS}"'#g' tmpfile + +sed -i 's#%%MYSQL_SHELL_PACKAGE%%#'"${MYSQL_SHELL_PACKAGE}"'#g' tmpfile + +sed -i 's/%%PORTS%%/'"${PORTS[${VERSION}]}"'/g' tmpfile +mv tmpfile ${VERSION}/Dockerfile + +# Dockerfile_spec.rb +if [ ! -d "${VERSION}/inspec" ]; then + mkdir "${VERSION}/inspec" +fi + +sed 's#%%MYSQL_SERVER_VERSION%%#'"${MYSQL_VERSION}"'#g' template/control.rb > tmpFile +sed -i 's#%%MYSQL_SHELL_VERSION%%#'"${SHELL_VERSION}"'#g' tmpFile +sed -i 's#%%MYSQL_SERVER_PACKAGE_NAME%%#'"${MYSQL_SERVER_PACKAGE_NAME}"'#g' tmpFile +sed -i 's#%%MYSQL_SHELL_PACKAGE_NAME%%#'"${MYSQL_SHELL_PACKAGE_NAME}"'#g' tmpFile +sed -i 's#%%MAJOR_VERSION%%#'"${VERSION}"'#g' tmpFile + +sed -i 's#%%PORTS%%#'"${SPEC_PORTS[${VERSION}]}"'#g' tmpFile +mv tmpFile "${VERSION}/inspec/control.rb" + +# Entrypoint +FULL_SERVER_VERSION="$MYSQL_VERSION-${IMAGE_VERSION}" +sed 's#%%PASSWORDSET%%#'"${PASSWORDSET[${VERSION}]}"'#g' template/docker-entrypoint.sh > tmpfile +sed -i 's#%%FULL_SERVER_VERSION%%#'"${FULL_SERVER_VERSION}"'#g' tmpfile +sed -i 's#%%VALIDATE_CONFIG%%#'"${VALIDATE_CONFIG[${VERSION}]}"'#g' tmpfile +mv tmpfile ${VERSION}/docker-entrypoint.sh +chmod +x ${VERSION}/docker-entrypoint.sh + +# Healthcheck +cp template/healthcheck.sh ${VERSION}/ +chmod +x ${VERSION}/healthcheck.sh + +# Build-time preparation script +sed 's#%%PRECREATE_DIRS%%#'"${PRECREATE_DIRS[${VERSION}]}"'#g' template/prepare-image.sh > tmpfile +mv tmpfile ${VERSION}/prepare-image.sh +chmod +x ${VERSION}/prepare-image.sh diff --git a/mysql-server/tag.sh b/mysql-server/tag.sh index f061b84a8..311377f2d 100755 --- a/mysql-server/tag.sh +++ b/mysql-server/tag.sh @@ -18,20 +18,30 @@ source VERSION SUFFIX='' [ -n "$1" ] && SUFFIX=$1 MAJOR_VERSIONS=("${!MYSQL_SERVER_VERSIONS[@]}"); [ -n "$2" ] && MAJOR_VERSIONS=("${@:2}") +WEEKLY='' [ -n "$3" ] && WEEKLY=$3 + for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do for MULTIARCH_VERSION in ${MULTIARCH_VERSIONS}; do + if [ "$WEEKLY" == "1" ]; then + SERVER_VERSION=${WEEKLY_SERVER_VERSIONS["${MAJOR_VERSION}"]} + else + SERVER_VERSION=${MYSQL_SERVER_VERSIONS["${MAJOR_VERSION}"]} + fi + FULL_SERVER_VERSION="${SERVER_VERSION}-${IMAGE_VERSION}" if [[ "$MULTIARCH_VERSION" == "$MAJOR_VERSION" ]]; then + TAGS="${SERVER_VERSION}${SUFFIX} ${FULL_SERVER_VERSION}${SUFFIX}" if [[ "$MAJOR_VERSION" == "$LATEST" ]]; then - echo "$MAJOR_VERSION$SUFFIX ${MYSQL_SERVER_VERSIONS["$MAJOR_VERSION"]}$SUFFIX ${FULL_SERVER_VERSIONS["$MAJOR_VERSION"]}$SUFFIX latest$SUFFIX" - else - echo "$MAJOR_VERSION$SUFFIX ${MYSQL_SERVER_VERSIONS["$MAJOR_VERSION"]}$SUFFIX ${FULL_SERVER_VERSIONS["$MAJOR_VERSION"]}$SUFFIX" + TAGS="$TAGS latest${SUFFIX}" fi + echo $TAGS fi done + for SINGLEARCH_VERSION in $SINGLEARCH_VERSIONS; do if [[ "$SINGLEARCH_VERSION" == "$MAJOR_VERSION" ]]; then - echo "$MAJOR_VERSION ${MYSQL_SERVER_VERSIONS["$MAJOR_VERSION"]} ${FULL_SERVER_VERSIONS["$MAJOR_VERSION"]}" + TAGS="${SERVER_VERSION} ${FULL_SERVER_VERSION}" + echo $TAGS fi done done diff --git a/mysql-server/template/control.rb b/mysql-server/template/control.rb index 2f3a3cd1a..33e3cfb61 100644 --- a/mysql-server/template/control.rb +++ b/mysql-server/template/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('%%MYSQL_SERVER_PACKAGE_NAME%%') do it { should be_installed } - its ('version') { should match '%%MYSQL_VERSION%%.*' } + its ('version') { should match '%%MYSQL_SERVER_VERSION%%.*' } end describe package('%%MYSQL_SHELL_PACKAGE_NAME%%') do it { should be_installed } - its ('version') { should match '%%MYSQL_VERSION%%.*' } + its ('version') { should match '%%MYSQL_SHELL_VERSION%%.*' } end end From 8cc988a2b9851cf9199eafb64f17d90ae9a53e4f Mon Sep 17 00:00:00 2001 From: Prashant Tekriwal Date: Wed, 12 Apr 2023 11:01:14 +0200 Subject: [PATCH 290/386] Revert "Fix for ET#77620, 77619, 77611, 70570" This is to make sure we don't disrupt on going release cycle. Will re-submit change after the release is over. This reverts commit 72cb7d7bbc45d4f6d2bce363c58fc16e8fc4dab3. Change-Id: I26cbb275e9b575261fcb8ab3527e38f870c8631d --- mysql-router/VERSION | 10 +-- mysql-router/gen_dockerfiles.sh | 56 +++++++------ mysql-router/tag.sh | 13 +--- mysql-router/template/control.rb | 8 +- mysql-server/VERSION | 12 ++- mysql-server/gen_dockerfiles.sh | 130 +++++++++++++++---------------- mysql-server/tag.sh | 18 +---- mysql-server/template/control.rb | 4 +- 8 files changed, 115 insertions(+), 136 deletions(-) diff --git a/mysql-router/VERSION b/mysql-router/VERSION index e4f327024..7512ed1db 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -1,11 +1,11 @@ IMAGE_VERSION=1.0.12-router -declare -A MYSQL_ROUTER_VERSIONS WEEKLY_ROUTER_VERSIONS +declare -A MYSQL_ROUTER_VERSIONS MYSQL_ROUTER_VERSIONS["8.0"]=8.0.33 -WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.34 - -declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS +declare -A MYSQL_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["8.0"]=8.0.33 -WEEKLY_SERVER_VERSIONS["8.0"]=8.0.34 + +declare -A FULL_ROUTER_VERSIONS +FULL_ROUTER_VERSIONS["8.0"]="${MYSQL_ROUTER_VERSIONS["8.0"]}-${IMAGE_VERSION}" MULTIARCH_VERSIONS="8.0" LATEST="8.0" diff --git a/mysql-router/gen_dockerfiles.sh b/mysql-router/gen_dockerfiles.sh index d0a6521d2..6ae6d87c0 100755 --- a/mysql-router/gen_dockerfiles.sh +++ b/mysql-router/gen_dockerfiles.sh @@ -5,38 +5,36 @@ source ./VERSION REPO=https://repo.mysql.com; [ -n "$1" ] && REPO=$1 CONFIG_PACKAGE_NAME=mysql80-community-release-el8.rpm; [ -n "$2" ] && CONFIG_PACKAGE_NAME=$2 -MYSQL_CLIENT_PACKAGE_NAME=mysql-community-client; [ -n "$3" ] && MYSQL_CLIENT_PACKAGE_NAME=$3 -MYSQL_ROUTER_PACKAGE_NAME=mysql-router-community; [ -n "$4" ] && MYSQL_ROUTER_PACKAGE_NAME=$4 -MYSQL_CLIENT_VERSION=mysql-community-client; [ -n "$5" ] && MYSQL_CLIENT_VERSION=$5 -MYSQL_ROUTER_VERSION=mysql-router-community; [ -n "$6" ] && MYSQL_ROUTER_VERSION=$6 +MYSQL_CLIENT_PACKAGE=mysql-community-client-${MYSQL_SERVER_VERSIONS[${MAJOR_VERSION}]}; [ -n "$3" ] && MYSQL_CLIENT_PACKAGE=$3 +MYSQL_ROUTER_PACKAGE=mysql-router-community-${MYSQL_ROUTER_VERSIONS[${MAJOR_VERSION}]}; [ -n "$4" ] && MYSQL_ROUTER_PACKAGE=$4 +MYSQL_CLIENT_PACKAGE_TEST=mysql-community-client; [ -n "$5" ] && MYSQL_CLIENT_PACKAGE_TEST=$5 +MYSQL_ROUTER_PACKAGE_TEST=mysql-router-community; [ -n "$6" ] && MYSQL_ROUTER_PACKAGE_TEST=$6 REPO_NAME_SERVER=mysql80-community; [ -n "$7" ] && REPO_NAME_SERVER=$7 REPO_NAME_TOOLS=mysql-tools-community; [ -n "$8" ] && REPO_NAME_TOOLS=$8 +for MAJOR_VERSION in "${!MYSQL_ROUTER_VERSIONS[@]}"; do + sed 's#%%MYSQL_CLIENT_PACKAGE%%#'"${MYSQL_CLIENT_PACKAGE}"'#g' template/Dockerfile > tmpFile + sed -i 's#%%MYSQL_ROUTER_PACKAGE%%#'"${MYSQL_ROUTER_PACKAGE}"'#g' tmpFile + sed -i 's#%%CONFIG_PACKAGE_NAME%%#'"${CONFIG_PACKAGE_NAME}"'#g' tmpFile + sed -i 's#%%REPO%%#'"${REPO}"'#g' tmpFile + sed -i 's#%%REPO_NAME_SERVER%%#'"${REPO_NAME_SERVER}"'#g' tmpFile + sed -i 's#%%REPO_NAME_TOOLS%%#'"${REPO_NAME_TOOLS}"'#g' tmpFile + mv tmpFile $MAJOR_VERSION/Dockerfile -MAJOR_VERSION=$(echo $MYSQL_CLIENT_VERSION | cut -d'.' -f'1,2') -MYSQL_CLIENT_PACKAGE=$MYSQL_CLIENT_PACKAGE_NAME-$MYSQL_CLIENT_VERSION -MYSQL_ROUTER_PACKAGE=$MYSQL_ROUTER_PACKAGE_NAME-$MYSQL_ROUTER_VERSION + # update test template + sed -e 's#%%MYSQL_CLIENT_PACKAGE_TEST%%#'"${MYSQL_CLIENT_PACKAGE_TEST}"'#g' template/control.rb > tmpFile + sed -i -e 's#%%MYSQL_CLIENT_PACKAGE_VERSION%%#'"${MYSQL_SERVER_VERSIONS[${MAJOR_VERSION}]}"'#g' tmpFile + sed -i -e 's#%%MYSQL_ROUTER_PACKAGE_TEST%%#'"${MYSQL_ROUTER_PACKAGE_TEST}"'#g' tmpFile + sed -i -e 's#%%MYSQL_ROUTER_PACKAGE_VERSION%%#'"${MYSQL_ROUTER_VERSIONS[${MAJOR_VERSION}]}"'#g' tmpFile + sed -i -e 's#%%MAJOR_VERSION%%#'"${MAJOR_VERSION}"'#g' tmpFile + if [ ! -d "${MAJOR_VERSION}/inspec" ]; then + mkdir "${MAJOR_VERSION}/inspec" + fi + mv tmpFile "${MAJOR_VERSION}/inspec/control.rb" -sed 's#%%MYSQL_CLIENT_PACKAGE%%#'"${MYSQL_CLIENT_PACKAGE}"'#g' template/Dockerfile > tmpFile -sed -i 's#%%MYSQL_ROUTER_PACKAGE%%#'"${MYSQL_ROUTER_PACKAGE}"'#g' tmpFile -sed -i 's#%%CONFIG_PACKAGE_NAME%%#'"${CONFIG_PACKAGE_NAME}"'#g' tmpFile -sed -i 's#%%REPO%%#'"${REPO}"'#g' tmpFile -sed -i 's#%%REPO_NAME_SERVER%%#'"${REPO_NAME_SERVER}"'#g' tmpFile -sed -i 's#%%REPO_NAME_TOOLS%%#'"${REPO_NAME_TOOLS}"'#g' tmpFile -mv tmpFile $MAJOR_VERSION/Dockerfile + # copy entrypoint script + cp template/run.sh $MAJOR_VERSION/run.sh + chmod +x $MAJOR_VERSION/run.sh -# update test template -sed -e 's#%%MYSQL_CLIENT_PACKAGE_NAME%%#'"${MYSQL_CLIENT_PACKAGE_NAME}"'#g' template/control.rb > tmpFile -sed -i -e 's#%%MYSQL_CLIENT_VERSION%%#'"${MYSQL_CLIENT_VERSION}"'#g' tmpFile -sed -i -e 's#%%MYSQL_ROUTER_PACKAGE_NAME%%#'"${MYSQL_ROUTER_PACKAGE_NAME}"'#g' tmpFile -sed -i -e 's#%%MYSQL_ROUTER_VERSION%%#'"${MYSQL_ROUTER_VERSION}"'#g' tmpFile -sed -i -e 's#%%MAJOR_VERSION%%#'"${MAJOR_VERSION}"'#g' tmpFile -if [ ! -d "${MAJOR_VERSION}/inspec" ]; then - mkdir "${MAJOR_VERSION}/inspec" -fi -mv tmpFile "${MAJOR_VERSION}/inspec/control.rb" + cp README.md $MAJOR_VERSION/ +done -# copy entrypoint script -cp template/run.sh $MAJOR_VERSION/run.sh -chmod +x $MAJOR_VERSION/run.sh - -cp README.md $MAJOR_VERSION/ diff --git a/mysql-router/tag.sh b/mysql-router/tag.sh index 7c5c0869b..9f2a41615 100755 --- a/mysql-router/tag.sh +++ b/mysql-router/tag.sh @@ -6,22 +6,15 @@ source VERSION SUFFIX='' [ -n "$1" ] && SUFFIX=$1 MAJOR_VERSIONS=("${!MYSQL_ROUTER_VERSIONS[@]}"); [ -n "$2" ] && MAJOR_VERSIONS=("${@:2}") -WEEKLY='' [ -n "$3" ] && WEEKLY=$3 for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do for MULTIARCH_VERSION in ${MULTIARCH_VERSIONS}; do if [[ "$MULTIARCH_VERSION" == "$MAJOR_VERSION" ]]; then - if [ "$WEEKLY" == "1" ]; then - ROUTER_VERSION=${WEEKLY_ROUTER_VERSIONS["${MAJOR_VERSION}"]} - else - ROUTER_VERSION=${MYSQL_ROUTER_VERSIONS["${MAJOR_VERSION}"]} - fi - FULL_ROUTER_VERSION="${ROUTER_VERSION}-${IMAGE_VERSION}" - TAGS="${ROUTER_VERSION}${SUFFIX} ${FULL_ROUTER_VERSION}${SUFFIX}" if [[ "$MAJOR_VERSION" == "$LATEST" ]]; then - TAGS="$TAGS latest${SUFFIX}" + echo "$MAJOR_VERSION ${MYSQL_ROUTER_VERSIONS["$MAJOR_VERSION"]} ${FULL_ROUTER_VERSIONS["$MAJOR_VERSION"]} latest" + else + echo "$MAJOR_VERSION ${MYSQL_ROUTER_VERSIONS["$MAJOR_VERSION"]} ${FULL_ROUTER_VERSIONS["$MAJOR_VERSION"]}" fi - echo $TAGS fi done done diff --git a/mysql-router/template/control.rb b/mysql-router/template/control.rb index 5491164a4..3f6bb45b1 100644 --- a/mysql-router/template/control.rb +++ b/mysql-router/template/control.rb @@ -9,12 +9,12 @@ end control 'packages' do impact 0.5 - describe package('%%MYSQL_CLIENT_PACKAGE_NAME%%') do + describe package('%%MYSQL_CLIENT_PACKAGE_TEST%%') do it { should be_installed } - its ('version') { should match '%%MYSQL_CLIENT_VERSION%%.*' } + its ('version') { should match '%%MYSQL_CLIENT_PACKAGE_VERSION%%.*' } end - describe package('%%MYSQL_ROUTER_PACKAGE_NAME%%') do + describe package('%%MYSQL_ROUTER_PACKAGE_TEST%%') do it { should be_installed } - its ('version') { should match '%%MYSQL_ROUTER_VERSION%%.*' } + its ('version') { should match '%%MYSQL_ROUTER_PACKAGE_VERSION%%.*' } end end diff --git a/mysql-server/VERSION b/mysql-server/VERSION index 26ac3b60d..543c1f20d 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,18 +1,16 @@ IMAGE_VERSION=1.2.12-server -declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS +declare -A MYSQL_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["5.7"]=5.7.42 MYSQL_SERVER_VERSIONS["8.0"]=8.0.33 -WEEKLY_SERVER_VERSIONS["5.7"]=5.7.43 -WEEKLY_SERVER_VERSIONS["8.0"]=8.0.34 - -declare -A MYSQL_SHELL_VERSIONS WEEKLY_SHELL_VERSIONS +declare -A MYSQL_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["5.7"]=8.0.33 MYSQL_SHELL_VERSIONS["8.0"]=8.0.33 -WEEKLY_SHELL_VERSIONS["5.7"]=8.0.34 -WEEKLY_SHELL_VERSIONS["8.0"]=8.0.34 +declare -A FULL_SERVER_VERSIONS +FULL_SERVER_VERSIONS["5.7"]="${MYSQL_SERVER_VERSIONS["5.7"]}-${IMAGE_VERSION}" +FULL_SERVER_VERSIONS["8.0"]="${MYSQL_SERVER_VERSIONS["8.0"]}-${IMAGE_VERSION}" MULTIARCH_VERSIONS="8.0" SINGLEARCH_VERSIONS="5.7" diff --git a/mysql-server/gen_dockerfiles.sh b/mysql-server/gen_dockerfiles.sh index 9620a004d..dcb2af0fc 100755 --- a/mysql-server/gen_dockerfiles.sh +++ b/mysql-server/gen_dockerfiles.sh @@ -31,8 +31,6 @@ REPO_NAME_TOOLS=mysql-tools-community; [ -n "$5" ] && REPO_NAME_TOOLS=$5 MYSQL_SERVER_PACKAGE_NAME="mysql-community-server-minimal"; [ -n "$6" ] && MYSQL_SERVER_PACKAGE_NAME=$6 MYSQL_SHELL_PACKAGE_NAME="mysql-shell"; [ -n "$7" ] && MYSQL_SHELL_PACKAGE_NAME=$7 MYSQL_VERSION=""; [ -n "$8" ] && MYSQL_VERSION=$8 -SHELL_VERSION=""; [ -n "$9" ] && SHELL_VERSION=$9 - # 33060 is the default port for the mysqlx plugin, new to 5.7 declare -A PORTS PORTS["5.7"]="3306 33060" @@ -53,66 +51,68 @@ declare -A PRECREATE_DIRS PRECREATE_DIRS["5.7"]="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" PRECREATE_DIRS["8.0"]="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" -declare -A DOCKERFILE_TEMPLATES -DOCKERFILE_TEMPLATES["5.7"]="template/Dockerfile-pre8" -DOCKERFILE_TEMPLATES["8.0"]="template/Dockerfile" - -declare -A SPEC_PORTS -SPEC_PORTS["5.7"]="3306/tcp, 33060/tcp" -SPEC_PORTS["8.0"]="3306/tcp, 33060-33061/tcp" - -# Get the Major Version -VERSION=$(echo $MYSQL_VERSION | cut -d'.' -f'1,2') - -MYSQL_SERVER_PACKAGE=${MYSQL_SERVER_PACKAGE_NAME}-${MYSQL_VERSION} -MYSQL_SHELL_PACKAGE=${MYSQL_SHELL_PACKAGE_NAME}-${SHELL_VERSION} - -# Dockerfiles -MYSQL_SERVER_REPOPATH=yum/mysql-$VERSION-community/docker/x86_64 - -sed 's#%%MYSQL_SERVER_PACKAGE%%#'"${MYSQL_SERVER_PACKAGE}"'#g' ${DOCKERFILE_TEMPLATES[${VERSION}]} > tmpfile -sed -i 's#%%REPO%%#'"${REPO}"'#g' tmpfile - -REPO_VERSION=${VERSION//\./} -sed -i 's#%%REPO_VERSION%%#'"${REPO_VERSION}"'#g' tmpfile - -sed -i 's#%%CONFIG_PACKAGE_NAME%%#'"${CONFIG_PACKAGE_NAME}"'#g' tmpfile -sed -i 's#%%CONFIG_PACKAGE_NAME_MINIMAL%%#'"${CONFIG_PACKAGE_NAME_MINIMAL}"'#g' tmpfile -sed -i 's#%%REPO_NAME_SERVER%%#'"${REPO_NAME_SERVER}"'#g' tmpfile -sed -i 's#%%REPO_NAME_TOOLS%%#'"${REPO_NAME_TOOLS}"'#g' tmpfile - -sed -i 's#%%MYSQL_SHELL_PACKAGE%%#'"${MYSQL_SHELL_PACKAGE}"'#g' tmpfile - -sed -i 's/%%PORTS%%/'"${PORTS[${VERSION}]}"'/g' tmpfile -mv tmpfile ${VERSION}/Dockerfile - -# Dockerfile_spec.rb -if [ ! -d "${VERSION}/inspec" ]; then - mkdir "${VERSION}/inspec" -fi - -sed 's#%%MYSQL_SERVER_VERSION%%#'"${MYSQL_VERSION}"'#g' template/control.rb > tmpFile -sed -i 's#%%MYSQL_SHELL_VERSION%%#'"${SHELL_VERSION}"'#g' tmpFile -sed -i 's#%%MYSQL_SERVER_PACKAGE_NAME%%#'"${MYSQL_SERVER_PACKAGE_NAME}"'#g' tmpFile -sed -i 's#%%MYSQL_SHELL_PACKAGE_NAME%%#'"${MYSQL_SHELL_PACKAGE_NAME}"'#g' tmpFile -sed -i 's#%%MAJOR_VERSION%%#'"${VERSION}"'#g' tmpFile - -sed -i 's#%%PORTS%%#'"${SPEC_PORTS[${VERSION}]}"'#g' tmpFile -mv tmpFile "${VERSION}/inspec/control.rb" - -# Entrypoint -FULL_SERVER_VERSION="$MYSQL_VERSION-${IMAGE_VERSION}" -sed 's#%%PASSWORDSET%%#'"${PASSWORDSET[${VERSION}]}"'#g' template/docker-entrypoint.sh > tmpfile -sed -i 's#%%FULL_SERVER_VERSION%%#'"${FULL_SERVER_VERSION}"'#g' tmpfile -sed -i 's#%%VALIDATE_CONFIG%%#'"${VALIDATE_CONFIG[${VERSION}]}"'#g' tmpfile -mv tmpfile ${VERSION}/docker-entrypoint.sh -chmod +x ${VERSION}/docker-entrypoint.sh - -# Healthcheck -cp template/healthcheck.sh ${VERSION}/ -chmod +x ${VERSION}/healthcheck.sh - -# Build-time preparation script -sed 's#%%PRECREATE_DIRS%%#'"${PRECREATE_DIRS[${VERSION}]}"'#g' template/prepare-image.sh > tmpfile -mv tmpfile ${VERSION}/prepare-image.sh -chmod +x ${VERSION}/prepare-image.sh +for VERSION in "${!MYSQL_SERVER_VERSIONS[@]}" +do + if [ -n "${MYSQL_VERSION}" ]; then + MYSQL_SERVER_PACKAGE=${MYSQL_SERVER_PACKAGE_NAME}-${MYSQL_VERSION} + MYSQL_SHELL_PACKAGE=${MYSQL_SHELL_PACKAGE_NAME}-${MYSQL_VERSION} + else + MYSQL_SERVER_PACKAGE=${MYSQL_SERVER_PACKAGE_NAME} + MYSQL_SHELL_PACKAGE=${MYSQL_SHELL_PACKAGE_NAME} + fi + # Dockerfiles + MYSQL_SERVER_REPOPATH=yum/mysql-$VERSION-community/docker/x86_64 + DOCKERFILE_TEMPLATE=template/Dockerfile + if [ "${VERSION}" != "8.0" ]; then + DOCKERFILE_TEMPLATE=template/Dockerfile-pre8 + fi + sed 's#%%MYSQL_SERVER_PACKAGE%%#'"${MYSQL_SERVER_PACKAGE}"'#g' $DOCKERFILE_TEMPLATE > tmpfile + sed -i 's#%%REPO%%#'"${REPO}"'#g' tmpfile + REPO_VERSION=${VERSION//\./} + sed -i 's#%%REPO_VERSION%%#'"${REPO_VERSION}"'#g' tmpfile + + sed -i 's#%%CONFIG_PACKAGE_NAME%%#'"${CONFIG_PACKAGE_NAME}"'#g' tmpfile + sed -i 's#%%CONFIG_PACKAGE_NAME_MINIMAL%%#'"${CONFIG_PACKAGE_NAME_MINIMAL}"'#g' tmpfile + sed -i 's#%%REPO_NAME_SERVER%%#'"${REPO_NAME_SERVER}"'#g' tmpfile + sed -i 's#%%REPO_NAME_TOOLS%%#'"${REPO_NAME_TOOLS}"'#g' tmpfile + + if [[ ! -z ${MYSQL_SHELL_VERSIONS[${VERSION}]} ]]; then + sed -i 's#%%MYSQL_SHELL_PACKAGE%%#'"${MYSQL_SHELL_PACKAGE}"'#g' tmpfile + else + sed -i 's#%%MYSQL_SHELL_PACKAGE%%#'""'#g' tmpfile + fi + + sed -i 's/%%PORTS%%/'"${PORTS[${VERSION}]}"'/g' tmpfile + mv tmpfile ${VERSION}/Dockerfile + + # Dockerfile_spec.rb + if [ ! -d "${VERSION}/inspec" ]; then + mkdir "${VERSION}/inspec" + fi + sed 's#%%MYSQL_VERSION%%#'"${MYSQL_VERSION}"'#g' template/control.rb > tmpFile + sed -i 's#%%MYSQL_SERVER_PACKAGE_NAME%%#'"${MYSQL_SERVER_PACKAGE_NAME}"'#g' tmpFile + sed -i 's#%%MYSQL_SHELL_PACKAGE_NAME%%#'"${MYSQL_SHELL_PACKAGE_NAME}"'#g' tmpFile + sed -i 's#%%MAJOR_VERSION%%#'"${VERSION}"'#g' tmpFile + if [ "${VERSION}" == "5.7" ]; then + sed -i 's#%%PORTS%%#'"3306/tcp, 33060/tcp"'#g' tmpFile + else + sed -i 's#%%PORTS%%#'"3306/tcp, 33060-33061/tcp"'#g' tmpFile + fi + mv tmpFile "${VERSION}/inspec/control.rb" + + # Entrypoint + sed 's#%%PASSWORDSET%%#'"${PASSWORDSET[${VERSION}]}"'#g' template/docker-entrypoint.sh > tmpfile + sed -i 's#%%FULL_SERVER_VERSION%%#'"${FULL_SERVER_VERSIONS[${VERSION}]}"'#g' tmpfile + sed -i 's#%%VALIDATE_CONFIG%%#'"${VALIDATE_CONFIG[${VERSION}]}"'#g' tmpfile + mv tmpfile ${VERSION}/docker-entrypoint.sh + chmod +x ${VERSION}/docker-entrypoint.sh + + # Healthcheck + cp template/healthcheck.sh ${VERSION}/ + chmod +x ${VERSION}/healthcheck.sh + + # Build-time preparation script + sed 's#%%PRECREATE_DIRS%%#'"${PRECREATE_DIRS[${VERSION}]}"'#g' template/prepare-image.sh > tmpfile + mv tmpfile ${VERSION}/prepare-image.sh + chmod +x ${VERSION}/prepare-image.sh +done diff --git a/mysql-server/tag.sh b/mysql-server/tag.sh index 311377f2d..f061b84a8 100755 --- a/mysql-server/tag.sh +++ b/mysql-server/tag.sh @@ -18,30 +18,20 @@ source VERSION SUFFIX='' [ -n "$1" ] && SUFFIX=$1 MAJOR_VERSIONS=("${!MYSQL_SERVER_VERSIONS[@]}"); [ -n "$2" ] && MAJOR_VERSIONS=("${@:2}") -WEEKLY='' [ -n "$3" ] && WEEKLY=$3 - for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do for MULTIARCH_VERSION in ${MULTIARCH_VERSIONS}; do - if [ "$WEEKLY" == "1" ]; then - SERVER_VERSION=${WEEKLY_SERVER_VERSIONS["${MAJOR_VERSION}"]} - else - SERVER_VERSION=${MYSQL_SERVER_VERSIONS["${MAJOR_VERSION}"]} - fi - FULL_SERVER_VERSION="${SERVER_VERSION}-${IMAGE_VERSION}" if [[ "$MULTIARCH_VERSION" == "$MAJOR_VERSION" ]]; then - TAGS="${SERVER_VERSION}${SUFFIX} ${FULL_SERVER_VERSION}${SUFFIX}" if [[ "$MAJOR_VERSION" == "$LATEST" ]]; then - TAGS="$TAGS latest${SUFFIX}" + echo "$MAJOR_VERSION$SUFFIX ${MYSQL_SERVER_VERSIONS["$MAJOR_VERSION"]}$SUFFIX ${FULL_SERVER_VERSIONS["$MAJOR_VERSION"]}$SUFFIX latest$SUFFIX" + else + echo "$MAJOR_VERSION$SUFFIX ${MYSQL_SERVER_VERSIONS["$MAJOR_VERSION"]}$SUFFIX ${FULL_SERVER_VERSIONS["$MAJOR_VERSION"]}$SUFFIX" fi - echo $TAGS fi done - for SINGLEARCH_VERSION in $SINGLEARCH_VERSIONS; do if [[ "$SINGLEARCH_VERSION" == "$MAJOR_VERSION" ]]; then - TAGS="${SERVER_VERSION} ${FULL_SERVER_VERSION}" - echo $TAGS + echo "$MAJOR_VERSION ${MYSQL_SERVER_VERSIONS["$MAJOR_VERSION"]} ${FULL_SERVER_VERSIONS["$MAJOR_VERSION"]}" fi done done diff --git a/mysql-server/template/control.rb b/mysql-server/template/control.rb index 33e3cfb61..2f3a3cd1a 100644 --- a/mysql-server/template/control.rb +++ b/mysql-server/template/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('%%MYSQL_SERVER_PACKAGE_NAME%%') do it { should be_installed } - its ('version') { should match '%%MYSQL_SERVER_VERSION%%.*' } + its ('version') { should match '%%MYSQL_VERSION%%.*' } end describe package('%%MYSQL_SHELL_PACKAGE_NAME%%') do it { should be_installed } - its ('version') { should match '%%MYSQL_SHELL_VERSION%%.*' } + its ('version') { should match '%%MYSQL_VERSION%%.*' } end end From 7d66d70613d958fc652769b1f0969a5b2b625513 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 19 Apr 2023 06:36:31 +0000 Subject: [PATCH 291/386] Release version 1.2.12-server * Revert "Fix for ET#77620, 77619, 77611, 70570" * Fix for ET#77620, 77619, 77611, 70570 * ET#70570 - Use weekly-tools-community for shell * ET#70570 - Use weekly yum repo for weekly server build * Update tests for podman support * Fix manifest add and push syntax * Use amd64 and arm64 as architecture names * Update image tests to work with podman * ET#77361: Bump versions for 8.0.33 Docker releases * [Docker] Updating the copyright year in the header * ET77115 - [Docker] Use OCR for fetching base images for docker builds --- mysql-server/5.7/Dockerfile | 4 ++-- mysql-server/5.7/docker-entrypoint.sh | 4 ++-- mysql-server/5.7/inspec/control.rb | 11 +++++------ mysql-server/8.0/Dockerfile | 2 +- mysql-server/8.0/docker-entrypoint.sh | 4 ++-- mysql-server/8.0/inspec/control.rb | 11 +++++------ 6 files changed, 17 insertions(+), 19 deletions(-) diff --git a/mysql-server/5.7/Dockerfile b/mysql-server/5.7/Dockerfile index 6eb3df278..40e9d11b2 100644 --- a/mysql-server/5.7/Dockerfile +++ b/mysql-server/5.7/Dockerfile @@ -22,8 +22,8 @@ RUN rpm -U https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ && rpm -U https://repo.mysql.com/mysql80-community-release-el7.rpm # Install server and shell 8.0 -RUN yum install -y $MYSQL_SHELL_PACKAGE \ - && yum install -y $MYSQL_SERVER_PACKAGE --enablerepo=mysql57-community-minimal\ +RUN yum install -y $MYSQL_SHELL_PACKAGE --enablerepo=mysql-tools-community \ + && yum install -y $MYSQL_SERVER_PACKAGE --enablerepo=mysql80-community-minimal \ && yum clean all \ && mkdir /docker-entrypoint-initdb.d diff --git a/mysql-server/5.7/docker-entrypoint.sh b/mysql-server/5.7/docker-entrypoint.sh index 18f6ef0d3..dffb313a0 100755 --- a/mysql-server/5.7/docker-entrypoint.sh +++ b/mysql-server/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.41-1.2.11-server" +echo "[Entrypoint] MySQL Docker Image 5.7.42-1.2.12-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 5.7.41-1.2.11-server" + echo "[Entrypoint] Starting MySQL 5.7.42-1.2.12-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/5.7/inspec/control.rb b/mysql-server/5.7/inspec/control.rb index 9abd2de48..48544a01e 100644 --- a/mysql-server/5.7/inspec/control.rb +++ b/mysql-server/5.7/inspec/control.rb @@ -1,11 +1,10 @@ control 'container' do impact 0.5 - describe docker_container('mysql-server-5.7') do - it { should exist } - it { should be_running } - its('repo') { should eq 'mysql/mysql-server' } - its('ports') { should eq '3306/tcp, 33060/tcp' } - its('command') { should match '/entrypoint.sh mysqld' } + describe podman.containers do + its('status') { should cmp /Up/ } + its('commands') { should cmp /mysqld/ } + its('images') { should cmp /mysql-server:5.7/ } + its('names') { should include "mysql-server-5.7" } end end control 'packages' do diff --git a/mysql-server/8.0/Dockerfile b/mysql-server/8.0/Dockerfile index b829578d6..0274aff35 100644 --- a/mysql-server/8.0/Dockerfile +++ b/mysql-server/8.0/Dockerfile @@ -1,4 +1,4 @@ -# Copyright (c) 2017, 2021, Oracle and/or its affiliates. +# Copyright (c) 2017, 2023, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/mysql-server/8.0/docker-entrypoint.sh b/mysql-server/8.0/docker-entrypoint.sh index c98b02019..ad210e57e 100755 --- a/mysql-server/8.0/docker-entrypoint.sh +++ b/mysql-server/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.32-1.2.11-server" +echo "[Entrypoint] MySQL Docker Image 8.0.33-1.2.12-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.32-1.2.11-server" + echo "[Entrypoint] Starting MySQL 8.0.33-1.2.12-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/8.0/inspec/control.rb b/mysql-server/8.0/inspec/control.rb index 4cbf2ad12..ed69fa988 100644 --- a/mysql-server/8.0/inspec/control.rb +++ b/mysql-server/8.0/inspec/control.rb @@ -1,11 +1,10 @@ control 'container' do impact 0.5 - describe docker_container('mysql-server-8.0') do - it { should exist } - it { should be_running } - its('repo') { should eq 'mysql/mysql-server' } - its('ports') { should eq '3306/tcp, 33060-33061/tcp' } - its('command') { should match '/entrypoint.sh mysqld' } + describe podman.containers do + its('status') { should cmp /Up/ } + its('commands') { should cmp /mysqld/ } + its('images') { should cmp /mysql-server:8.0/ } + its('names') { should include "mysql-server-8.0" } end end control 'packages' do From 74493503df932cdd4c61477e4d142c537b2bdf74 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 19 Apr 2023 07:07:34 +0000 Subject: [PATCH 292/386] Release version 1.2.12-cluster * Update tests for podman support * Update image tests to work with podman * ET#77361: Bump versions for 8.0.33 Docker releases * [Docker] Updating the copyright year in the header * ET77115 - [Docker] Use OCR for fetching base images for docker builds --- mysql-cluster/7.5/docker-entrypoint.sh | 4 ++-- mysql-cluster/7.5/inspec/control.rb | 11 +++++------ mysql-cluster/7.6/docker-entrypoint.sh | 4 ++-- mysql-cluster/7.6/inspec/control.rb | 11 +++++------ mysql-cluster/8.0/Dockerfile | 2 +- mysql-cluster/8.0/docker-entrypoint.sh | 4 ++-- mysql-cluster/8.0/inspec/control.rb | 11 +++++------ 7 files changed, 22 insertions(+), 25 deletions(-) diff --git a/mysql-cluster/7.5/docker-entrypoint.sh b/mysql-cluster/7.5/docker-entrypoint.sh index f795eef00..80c61a889 100755 --- a/mysql-cluster/7.5/docker-entrypoint.sh +++ b/mysql-cluster/7.5/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 7.5.29-1.2.11-cluster" +echo "[Entrypoint] MySQL Docker Image 7.5.30-1.2.12-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -227,7 +227,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 7.5.29-1.2.11-cluster" + echo "[Entrypoint] Starting MySQL 7.5.30-1.2.12-cluster" fi exec "$@" --user=$MYSQLD_USER else diff --git a/mysql-cluster/7.5/inspec/control.rb b/mysql-cluster/7.5/inspec/control.rb index 87a46af9e..aab485e21 100644 --- a/mysql-cluster/7.5/inspec/control.rb +++ b/mysql-cluster/7.5/inspec/control.rb @@ -1,11 +1,10 @@ control 'container' do impact 0.5 - describe docker_container('mysql-cluster-7.5') do - it { should exist } - it { should be_running } - its('repo') { should eq 'mysql/mysql-cluster' } - its('ports') { should eq '1186/tcp, 2202/tcp, 3306/tcp, 33060/tcp' } - its('command') { should match '/entrypoint.sh.*' } + describe podman.containers do + its('status') { should cmp /Up/ } + its('commands') { should cmp /mysqld/ } + its('images') { should cmp /mysql-cluster:7.5/ } + its('names') { should include "mysql-cluster-7.5" } end end control 'packages' do diff --git a/mysql-cluster/7.6/docker-entrypoint.sh b/mysql-cluster/7.6/docker-entrypoint.sh index 4819facb4..41f9b5930 100755 --- a/mysql-cluster/7.6/docker-entrypoint.sh +++ b/mysql-cluster/7.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 7.6.25-1.2.11-cluster" +echo "[Entrypoint] MySQL Docker Image 7.6.26-1.2.12-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -227,7 +227,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 7.6.25-1.2.11-cluster" + echo "[Entrypoint] Starting MySQL 7.6.26-1.2.12-cluster" fi exec "$@" --user=$MYSQLD_USER else diff --git a/mysql-cluster/7.6/inspec/control.rb b/mysql-cluster/7.6/inspec/control.rb index 69cae5db1..681b3a987 100644 --- a/mysql-cluster/7.6/inspec/control.rb +++ b/mysql-cluster/7.6/inspec/control.rb @@ -1,11 +1,10 @@ control 'container' do impact 0.5 - describe docker_container('mysql-cluster-7.6') do - it { should exist } - it { should be_running } - its('repo') { should eq 'mysql/mysql-cluster' } - its('ports') { should eq '1186/tcp, 2202/tcp, 3306/tcp, 33060/tcp' } - its('command') { should match '/entrypoint.sh.*' } + describe podman.containers do + its('status') { should cmp /Up/ } + its('commands') { should cmp /mysqld/ } + its('images') { should cmp /mysql-cluster:7.6/ } + its('names') { should include "mysql-cluster-7.6" } end end control 'packages' do diff --git a/mysql-cluster/8.0/Dockerfile b/mysql-cluster/8.0/Dockerfile index ccf9d5798..0a3aa28db 100644 --- a/mysql-cluster/8.0/Dockerfile +++ b/mysql-cluster/8.0/Dockerfile @@ -1,4 +1,4 @@ -# Copyright (c) 2017, 2021, Oracle and/or its affiliates. +# Copyright (c) 2017, 2023, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/mysql-cluster/8.0/docker-entrypoint.sh b/mysql-cluster/8.0/docker-entrypoint.sh index 1e60ea59f..8315e66e6 100755 --- a/mysql-cluster/8.0/docker-entrypoint.sh +++ b/mysql-cluster/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.32-1.2.11-cluster" +echo "[Entrypoint] MySQL Docker Image 8.0.33-1.2.12-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -227,7 +227,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.32-1.2.11-cluster" + echo "[Entrypoint] Starting MySQL 8.0.33-1.2.12-cluster" fi export MYSQLD_PARENT_PID=$$ ; exec "$@" --user= else diff --git a/mysql-cluster/8.0/inspec/control.rb b/mysql-cluster/8.0/inspec/control.rb index 0da0c0173..34b240fbd 100644 --- a/mysql-cluster/8.0/inspec/control.rb +++ b/mysql-cluster/8.0/inspec/control.rb @@ -1,11 +1,10 @@ control 'container' do impact 0.5 - describe docker_container('mysql-cluster-8.0') do - it { should exist } - it { should be_running } - its('repo') { should eq 'mysql/mysql-cluster' } - its('ports') { should eq '1186/tcp, 2202/tcp, 3306/tcp, 33060-33061/tcp' } - its('command') { should match '/entrypoint.sh.*' } + describe podman.containers do + its('status') { should cmp /Up/ } + its('commands') { should cmp /mysqld/ } + its('images') { should cmp /mysql-cluster:8.0/ } + its('names') { should include "mysql-cluster-8.0" } end end control 'packages' do From 476c6c6f3756a2f36591a185302362763ce6e78f Mon Sep 17 00:00:00 2001 From: Nawaz Nazeer Ahamed Date: Wed, 19 Apr 2023 14:01:02 +0530 Subject: [PATCH 293/386] [Docker] - Router - tag-release pipeline - Fix the MAJOR_VERSION usage Change-Id: I92f3d4e078717a5e67ae2fab3aae2e45f8c04873 --- mysql-router/gen_dockerfiles.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-router/gen_dockerfiles.sh b/mysql-router/gen_dockerfiles.sh index 6ae6d87c0..6ac2ed747 100755 --- a/mysql-router/gen_dockerfiles.sh +++ b/mysql-router/gen_dockerfiles.sh @@ -5,13 +5,13 @@ source ./VERSION REPO=https://repo.mysql.com; [ -n "$1" ] && REPO=$1 CONFIG_PACKAGE_NAME=mysql80-community-release-el8.rpm; [ -n "$2" ] && CONFIG_PACKAGE_NAME=$2 -MYSQL_CLIENT_PACKAGE=mysql-community-client-${MYSQL_SERVER_VERSIONS[${MAJOR_VERSION}]}; [ -n "$3" ] && MYSQL_CLIENT_PACKAGE=$3 -MYSQL_ROUTER_PACKAGE=mysql-router-community-${MYSQL_ROUTER_VERSIONS[${MAJOR_VERSION}]}; [ -n "$4" ] && MYSQL_ROUTER_PACKAGE=$4 MYSQL_CLIENT_PACKAGE_TEST=mysql-community-client; [ -n "$5" ] && MYSQL_CLIENT_PACKAGE_TEST=$5 MYSQL_ROUTER_PACKAGE_TEST=mysql-router-community; [ -n "$6" ] && MYSQL_ROUTER_PACKAGE_TEST=$6 REPO_NAME_SERVER=mysql80-community; [ -n "$7" ] && REPO_NAME_SERVER=$7 REPO_NAME_TOOLS=mysql-tools-community; [ -n "$8" ] && REPO_NAME_TOOLS=$8 for MAJOR_VERSION in "${!MYSQL_ROUTER_VERSIONS[@]}"; do + MYSQL_CLIENT_PACKAGE=mysql-community-client-${MYSQL_SERVER_VERSIONS[${MAJOR_VERSION}]}; [ -n "$3" ] && MYSQL_CLIENT_PACKAGE=$3 + MYSQL_ROUTER_PACKAGE=mysql-router-community-${MYSQL_ROUTER_VERSIONS[${MAJOR_VERSION}]}; [ -n "$4" ] && MYSQL_ROUTER_PACKAGE=$4 sed 's#%%MYSQL_CLIENT_PACKAGE%%#'"${MYSQL_CLIENT_PACKAGE}"'#g' template/Dockerfile > tmpFile sed -i 's#%%MYSQL_ROUTER_PACKAGE%%#'"${MYSQL_ROUTER_PACKAGE}"'#g' tmpFile sed -i 's#%%CONFIG_PACKAGE_NAME%%#'"${CONFIG_PACKAGE_NAME}"'#g' tmpFile From 4f52c7f0bd3c49094e062a778ec04e8cf284059b Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 19 Apr 2023 08:55:43 +0000 Subject: [PATCH 294/386] Release version 1.0.12-router * [Docker] - Router - tag-release pipeline - Fix the MAJOR_VERSION usage * Revert "Fix for ET#77620, 77619, 77611, 70570" * Fix for ET#77620, 77619, 77611, 70570 * ET#70570 - [docker] setup weekly router docker image builds * Router: Test for the correct command * Switch to arm64 for arm tags * Router: Update tests for podman * Update image tests to work with podman * ET#77361: Bump versions for 8.0.33 Docker releases * ET#77271 - [Docker] Restructure internal-enterprise - router pipeline * ET#77004 - [WIP] Create Docker ARM image for MySQL Router - Follow up fix - updated permission for manifest file * ET#77004 - [WIP] Create Docker ARM image for MySQL Router * [Docker] Updating the copyright year in the header * ET77115 - [Docker] Use OCR for fetching base images for docker builds --- mysql-router/8.0/Dockerfile | 17 +++++++++++------ mysql-router/8.0/inspec/control.rb | 15 +++++++-------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/mysql-router/8.0/Dockerfile b/mysql-router/8.0/Dockerfile index fe27abf84..cf912cab6 100644 --- a/mysql-router/8.0/Dockerfile +++ b/mysql-router/8.0/Dockerfile @@ -1,4 +1,4 @@ -# Copyright (c) 2018, 2021, Oracle and/or its affiliates. +# Copyright (c) 2018, 2023, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -14,15 +14,20 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM container-registry.oracle.com/os/oraclelinux:8-slim -ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.32 -ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.32 +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.33 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.33 +ARG CONFIG_PACKAGE_NAME=mysql80-community-release-el8.rpm +ARG REPO_NAME_SERVER=mysql80-community +ARG REPO_NAME_TOOLS=mysql-tools-community RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ -c "MySQL Router" mysqlrouter \ - && rpm -U https://repo.mysql.com/mysql80-community-release-el8.rpm \ - && microdnf install -y --disablerepo=ol8_appstream \ - $MYSQL_CLIENT_PACKAGE $MYSQL_ROUTER_PACKAGE \ + && rpm -U https://repo.mysql.com/$CONFIG_PACKAGE_NAME \ + && microdnf install -y --disablerepo=\* \ + --enablerepo=mysql80-community $MYSQL_CLIENT_PACKAGE \ + && microdnf install -y --disablerepo=\* \ + --enablerepo=mysql-tools-community $MYSQL_ROUTER_PACKAGE \ && microdnf clean all COPY run.sh /run.sh diff --git a/mysql-router/8.0/inspec/control.rb b/mysql-router/8.0/inspec/control.rb index 1b6579767..d44b6dc54 100644 --- a/mysql-router/8.0/inspec/control.rb +++ b/mysql-router/8.0/inspec/control.rb @@ -1,21 +1,20 @@ control 'container' do impact 0.5 - describe docker_container('mysql-router-8.0') do - it { should exist } - it { should be_running } - its('repo') { should eq 'mysql/mysql-router' } - its('ports') { should eq '6446-6449/tcp, 8443/tcp' } - its('command') { should match '/run.sh.*' } + describe podman.containers do + its('status') { should cmp /Up/ } + its('commands') { should cmp /sleep/ } + its('images') { should cmp /mysql-router:8.0/ } + its('names') { should include "mysql-router-8.0" } end end control 'packages' do impact 0.5 describe package('mysql-community-client') do it { should be_installed } - its ('version') { should match '8.0.32.*' } + its ('version') { should match '8.0.33.*' } end describe package('mysql-router-community') do it { should be_installed } - its ('version') { should match '8.0.32.*' } + its ('version') { should match '8.0.33.*' } end end From 230a9d5b81d0c04fc31ca82324df46cf6ac19134 Mon Sep 17 00:00:00 2001 From: Nawaz Nazeer Ahamed Date: Wed, 19 Apr 2023 17:35:48 +0530 Subject: [PATCH 295/386] Fix manifest add and push syntax - router Change-Id: I3d7270491cf72e93e41279e2f18ed0fb03477b35 --- mysql-router/manifest.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mysql-router/manifest.sh b/mysql-router/manifest.sh index 51b09d1e9..6a55e29e9 100755 --- a/mysql-router/manifest.sh +++ b/mysql-router/manifest.sh @@ -29,9 +29,10 @@ REPO=mysql/mysql-router; [ -n "$1" ] && REPO=$1 for MAJOR_VERSION in ${MULTIARCH_VERSIONS}; do MANIFEST_VERSIONS=$(./tag.sh "" "$MAJOR_VERSION") for MANIFEST_VERSION in $MANIFEST_VERSIONS; do + docker pull "$REPO:$MANIFEST_VERSION-arm64" "$REPO:$MANIFEST_VERSION-amd64" docker manifest create "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-arm64" "$REPO:$MANIFEST_VERSION-amd64" - docker manifest annotate "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-arm64" --os linux --arch arm64 - docker manifest annotate "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-amd64" --os linux --arch amd64 - docker manifest push "$REPO:$MANIFEST_VERSION" + docker manifest add "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-arm64" --os linux --arch arm64 + docker manifest add "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-amd64" --os linux --arch amd64 + docker manifest push "$REPO:$MANIFEST_VERSION" "docker://$REPO:$MANIFEST_VERSION" done done From 810d7392618f0a71d2d908f3166de83e455959ec Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 19 Apr 2023 13:44:02 +0000 Subject: [PATCH 296/386] Release version 1.0.12-router * Fix manifest add and push syntax - router From d96c6e1c41c5c09a9b133d0cea8fe4be0cc2a6ed Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Thu, 20 Apr 2023 08:32:15 +0000 Subject: [PATCH 297/386] Release version 1.0.12-router * Fix manifest add and push syntax - router From 7ae6bea8310cec8f2c22b841a1dc6fceb4017a56 Mon Sep 17 00:00:00 2001 From: Nawaz Nazeer Ahamed Date: Thu, 20 Apr 2023 15:08:29 +0530 Subject: [PATCH 298/386] Router - Add suffix to tags Change-Id: I78dc019b0211718a17e28d96ad03190878a648ab --- mysql-router/tag.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-router/tag.sh b/mysql-router/tag.sh index 9f2a41615..00ef07657 100755 --- a/mysql-router/tag.sh +++ b/mysql-router/tag.sh @@ -11,9 +11,9 @@ for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do for MULTIARCH_VERSION in ${MULTIARCH_VERSIONS}; do if [[ "$MULTIARCH_VERSION" == "$MAJOR_VERSION" ]]; then if [[ "$MAJOR_VERSION" == "$LATEST" ]]; then - echo "$MAJOR_VERSION ${MYSQL_ROUTER_VERSIONS["$MAJOR_VERSION"]} ${FULL_ROUTER_VERSIONS["$MAJOR_VERSION"]} latest" + echo "$MAJOR_VERSION$SUFFIX ${MYSQL_ROUTER_VERSIONS["$MAJOR_VERSION"]}$SUFFIX ${FULL_ROUTER_VERSIONS["$MAJOR_VERSION"]}$SUFFIX latest$SUFFIX" else - echo "$MAJOR_VERSION ${MYSQL_ROUTER_VERSIONS["$MAJOR_VERSION"]} ${FULL_ROUTER_VERSIONS["$MAJOR_VERSION"]}" + echo "$MAJOR_VERSION$SUFFIX ${MYSQL_ROUTER_VERSIONS["$MAJOR_VERSION"]}$SUFFIX ${FULL_ROUTER_VERSIONS["$MAJOR_VERSION"]}$SUFFIX" fi fi done From 99652d9954e6d1e3cebf7832b436c565b0696ae7 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Thu, 20 Apr 2023 10:32:17 +0000 Subject: [PATCH 299/386] Release version 1.0.12-router * Router - Add suffix to tags From 1826d9c16b046fcdc4a419d411812d69c759f057 Mon Sep 17 00:00:00 2001 From: Prashant Tekriwal Date: Wed, 26 Apr 2023 10:38:20 +0200 Subject: [PATCH 300/386] Revert "Revert "Fix for ET#77620, 77619, 77611, 70570"" This reverts commit 8cc988a2b9851cf9199eafb64f17d90ae9a53e4f. Change-Id: I309898ba9cac56ce875406d4e22dc956d5100caf --- mysql-router/VERSION | 10 +-- mysql-router/gen_dockerfiles.sh | 56 ++++++------- mysql-router/tag.sh | 13 +++- mysql-router/template/control.rb | 8 +- mysql-server/VERSION | 12 +-- mysql-server/gen_dockerfiles.sh | 130 +++++++++++++++---------------- mysql-server/tag.sh | 18 ++++- mysql-server/template/control.rb | 4 +- 8 files changed, 136 insertions(+), 115 deletions(-) diff --git a/mysql-router/VERSION b/mysql-router/VERSION index 7512ed1db..e4f327024 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -1,11 +1,11 @@ IMAGE_VERSION=1.0.12-router -declare -A MYSQL_ROUTER_VERSIONS +declare -A MYSQL_ROUTER_VERSIONS WEEKLY_ROUTER_VERSIONS MYSQL_ROUTER_VERSIONS["8.0"]=8.0.33 -declare -A MYSQL_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["8.0"]=8.0.33 +WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.34 -declare -A FULL_ROUTER_VERSIONS -FULL_ROUTER_VERSIONS["8.0"]="${MYSQL_ROUTER_VERSIONS["8.0"]}-${IMAGE_VERSION}" +declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS +MYSQL_SERVER_VERSIONS["8.0"]=8.0.33 +WEEKLY_SERVER_VERSIONS["8.0"]=8.0.34 MULTIARCH_VERSIONS="8.0" LATEST="8.0" diff --git a/mysql-router/gen_dockerfiles.sh b/mysql-router/gen_dockerfiles.sh index 6ac2ed747..d0a6521d2 100755 --- a/mysql-router/gen_dockerfiles.sh +++ b/mysql-router/gen_dockerfiles.sh @@ -5,36 +5,38 @@ source ./VERSION REPO=https://repo.mysql.com; [ -n "$1" ] && REPO=$1 CONFIG_PACKAGE_NAME=mysql80-community-release-el8.rpm; [ -n "$2" ] && CONFIG_PACKAGE_NAME=$2 -MYSQL_CLIENT_PACKAGE_TEST=mysql-community-client; [ -n "$5" ] && MYSQL_CLIENT_PACKAGE_TEST=$5 -MYSQL_ROUTER_PACKAGE_TEST=mysql-router-community; [ -n "$6" ] && MYSQL_ROUTER_PACKAGE_TEST=$6 +MYSQL_CLIENT_PACKAGE_NAME=mysql-community-client; [ -n "$3" ] && MYSQL_CLIENT_PACKAGE_NAME=$3 +MYSQL_ROUTER_PACKAGE_NAME=mysql-router-community; [ -n "$4" ] && MYSQL_ROUTER_PACKAGE_NAME=$4 +MYSQL_CLIENT_VERSION=mysql-community-client; [ -n "$5" ] && MYSQL_CLIENT_VERSION=$5 +MYSQL_ROUTER_VERSION=mysql-router-community; [ -n "$6" ] && MYSQL_ROUTER_VERSION=$6 REPO_NAME_SERVER=mysql80-community; [ -n "$7" ] && REPO_NAME_SERVER=$7 REPO_NAME_TOOLS=mysql-tools-community; [ -n "$8" ] && REPO_NAME_TOOLS=$8 -for MAJOR_VERSION in "${!MYSQL_ROUTER_VERSIONS[@]}"; do - MYSQL_CLIENT_PACKAGE=mysql-community-client-${MYSQL_SERVER_VERSIONS[${MAJOR_VERSION}]}; [ -n "$3" ] && MYSQL_CLIENT_PACKAGE=$3 - MYSQL_ROUTER_PACKAGE=mysql-router-community-${MYSQL_ROUTER_VERSIONS[${MAJOR_VERSION}]}; [ -n "$4" ] && MYSQL_ROUTER_PACKAGE=$4 - sed 's#%%MYSQL_CLIENT_PACKAGE%%#'"${MYSQL_CLIENT_PACKAGE}"'#g' template/Dockerfile > tmpFile - sed -i 's#%%MYSQL_ROUTER_PACKAGE%%#'"${MYSQL_ROUTER_PACKAGE}"'#g' tmpFile - sed -i 's#%%CONFIG_PACKAGE_NAME%%#'"${CONFIG_PACKAGE_NAME}"'#g' tmpFile - sed -i 's#%%REPO%%#'"${REPO}"'#g' tmpFile - sed -i 's#%%REPO_NAME_SERVER%%#'"${REPO_NAME_SERVER}"'#g' tmpFile - sed -i 's#%%REPO_NAME_TOOLS%%#'"${REPO_NAME_TOOLS}"'#g' tmpFile - mv tmpFile $MAJOR_VERSION/Dockerfile - # update test template - sed -e 's#%%MYSQL_CLIENT_PACKAGE_TEST%%#'"${MYSQL_CLIENT_PACKAGE_TEST}"'#g' template/control.rb > tmpFile - sed -i -e 's#%%MYSQL_CLIENT_PACKAGE_VERSION%%#'"${MYSQL_SERVER_VERSIONS[${MAJOR_VERSION}]}"'#g' tmpFile - sed -i -e 's#%%MYSQL_ROUTER_PACKAGE_TEST%%#'"${MYSQL_ROUTER_PACKAGE_TEST}"'#g' tmpFile - sed -i -e 's#%%MYSQL_ROUTER_PACKAGE_VERSION%%#'"${MYSQL_ROUTER_VERSIONS[${MAJOR_VERSION}]}"'#g' tmpFile - sed -i -e 's#%%MAJOR_VERSION%%#'"${MAJOR_VERSION}"'#g' tmpFile - if [ ! -d "${MAJOR_VERSION}/inspec" ]; then - mkdir "${MAJOR_VERSION}/inspec" - fi - mv tmpFile "${MAJOR_VERSION}/inspec/control.rb" +MAJOR_VERSION=$(echo $MYSQL_CLIENT_VERSION | cut -d'.' -f'1,2') +MYSQL_CLIENT_PACKAGE=$MYSQL_CLIENT_PACKAGE_NAME-$MYSQL_CLIENT_VERSION +MYSQL_ROUTER_PACKAGE=$MYSQL_ROUTER_PACKAGE_NAME-$MYSQL_ROUTER_VERSION - # copy entrypoint script - cp template/run.sh $MAJOR_VERSION/run.sh - chmod +x $MAJOR_VERSION/run.sh +sed 's#%%MYSQL_CLIENT_PACKAGE%%#'"${MYSQL_CLIENT_PACKAGE}"'#g' template/Dockerfile > tmpFile +sed -i 's#%%MYSQL_ROUTER_PACKAGE%%#'"${MYSQL_ROUTER_PACKAGE}"'#g' tmpFile +sed -i 's#%%CONFIG_PACKAGE_NAME%%#'"${CONFIG_PACKAGE_NAME}"'#g' tmpFile +sed -i 's#%%REPO%%#'"${REPO}"'#g' tmpFile +sed -i 's#%%REPO_NAME_SERVER%%#'"${REPO_NAME_SERVER}"'#g' tmpFile +sed -i 's#%%REPO_NAME_TOOLS%%#'"${REPO_NAME_TOOLS}"'#g' tmpFile +mv tmpFile $MAJOR_VERSION/Dockerfile - cp README.md $MAJOR_VERSION/ -done +# update test template +sed -e 's#%%MYSQL_CLIENT_PACKAGE_NAME%%#'"${MYSQL_CLIENT_PACKAGE_NAME}"'#g' template/control.rb > tmpFile +sed -i -e 's#%%MYSQL_CLIENT_VERSION%%#'"${MYSQL_CLIENT_VERSION}"'#g' tmpFile +sed -i -e 's#%%MYSQL_ROUTER_PACKAGE_NAME%%#'"${MYSQL_ROUTER_PACKAGE_NAME}"'#g' tmpFile +sed -i -e 's#%%MYSQL_ROUTER_VERSION%%#'"${MYSQL_ROUTER_VERSION}"'#g' tmpFile +sed -i -e 's#%%MAJOR_VERSION%%#'"${MAJOR_VERSION}"'#g' tmpFile +if [ ! -d "${MAJOR_VERSION}/inspec" ]; then + mkdir "${MAJOR_VERSION}/inspec" +fi +mv tmpFile "${MAJOR_VERSION}/inspec/control.rb" +# copy entrypoint script +cp template/run.sh $MAJOR_VERSION/run.sh +chmod +x $MAJOR_VERSION/run.sh + +cp README.md $MAJOR_VERSION/ diff --git a/mysql-router/tag.sh b/mysql-router/tag.sh index 00ef07657..7c5c0869b 100755 --- a/mysql-router/tag.sh +++ b/mysql-router/tag.sh @@ -6,15 +6,22 @@ source VERSION SUFFIX='' [ -n "$1" ] && SUFFIX=$1 MAJOR_VERSIONS=("${!MYSQL_ROUTER_VERSIONS[@]}"); [ -n "$2" ] && MAJOR_VERSIONS=("${@:2}") +WEEKLY='' [ -n "$3" ] && WEEKLY=$3 for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do for MULTIARCH_VERSION in ${MULTIARCH_VERSIONS}; do if [[ "$MULTIARCH_VERSION" == "$MAJOR_VERSION" ]]; then - if [[ "$MAJOR_VERSION" == "$LATEST" ]]; then - echo "$MAJOR_VERSION$SUFFIX ${MYSQL_ROUTER_VERSIONS["$MAJOR_VERSION"]}$SUFFIX ${FULL_ROUTER_VERSIONS["$MAJOR_VERSION"]}$SUFFIX latest$SUFFIX" + if [ "$WEEKLY" == "1" ]; then + ROUTER_VERSION=${WEEKLY_ROUTER_VERSIONS["${MAJOR_VERSION}"]} else - echo "$MAJOR_VERSION$SUFFIX ${MYSQL_ROUTER_VERSIONS["$MAJOR_VERSION"]}$SUFFIX ${FULL_ROUTER_VERSIONS["$MAJOR_VERSION"]}$SUFFIX" + ROUTER_VERSION=${MYSQL_ROUTER_VERSIONS["${MAJOR_VERSION}"]} + fi + FULL_ROUTER_VERSION="${ROUTER_VERSION}-${IMAGE_VERSION}" + TAGS="${ROUTER_VERSION}${SUFFIX} ${FULL_ROUTER_VERSION}${SUFFIX}" + if [[ "$MAJOR_VERSION" == "$LATEST" ]]; then + TAGS="$TAGS latest${SUFFIX}" fi + echo $TAGS fi done done diff --git a/mysql-router/template/control.rb b/mysql-router/template/control.rb index 3f6bb45b1..5491164a4 100644 --- a/mysql-router/template/control.rb +++ b/mysql-router/template/control.rb @@ -9,12 +9,12 @@ end control 'packages' do impact 0.5 - describe package('%%MYSQL_CLIENT_PACKAGE_TEST%%') do + describe package('%%MYSQL_CLIENT_PACKAGE_NAME%%') do it { should be_installed } - its ('version') { should match '%%MYSQL_CLIENT_PACKAGE_VERSION%%.*' } + its ('version') { should match '%%MYSQL_CLIENT_VERSION%%.*' } end - describe package('%%MYSQL_ROUTER_PACKAGE_TEST%%') do + describe package('%%MYSQL_ROUTER_PACKAGE_NAME%%') do it { should be_installed } - its ('version') { should match '%%MYSQL_ROUTER_PACKAGE_VERSION%%.*' } + its ('version') { should match '%%MYSQL_ROUTER_VERSION%%.*' } end end diff --git a/mysql-server/VERSION b/mysql-server/VERSION index 543c1f20d..26ac3b60d 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,16 +1,18 @@ IMAGE_VERSION=1.2.12-server -declare -A MYSQL_SERVER_VERSIONS +declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["5.7"]=5.7.42 MYSQL_SERVER_VERSIONS["8.0"]=8.0.33 -declare -A MYSQL_SHELL_VERSIONS +WEEKLY_SERVER_VERSIONS["5.7"]=5.7.43 +WEEKLY_SERVER_VERSIONS["8.0"]=8.0.34 + +declare -A MYSQL_SHELL_VERSIONS WEEKLY_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["5.7"]=8.0.33 MYSQL_SHELL_VERSIONS["8.0"]=8.0.33 -declare -A FULL_SERVER_VERSIONS -FULL_SERVER_VERSIONS["5.7"]="${MYSQL_SERVER_VERSIONS["5.7"]}-${IMAGE_VERSION}" -FULL_SERVER_VERSIONS["8.0"]="${MYSQL_SERVER_VERSIONS["8.0"]}-${IMAGE_VERSION}" +WEEKLY_SHELL_VERSIONS["5.7"]=8.0.34 +WEEKLY_SHELL_VERSIONS["8.0"]=8.0.34 MULTIARCH_VERSIONS="8.0" SINGLEARCH_VERSIONS="5.7" diff --git a/mysql-server/gen_dockerfiles.sh b/mysql-server/gen_dockerfiles.sh index dcb2af0fc..9620a004d 100755 --- a/mysql-server/gen_dockerfiles.sh +++ b/mysql-server/gen_dockerfiles.sh @@ -31,6 +31,8 @@ REPO_NAME_TOOLS=mysql-tools-community; [ -n "$5" ] && REPO_NAME_TOOLS=$5 MYSQL_SERVER_PACKAGE_NAME="mysql-community-server-minimal"; [ -n "$6" ] && MYSQL_SERVER_PACKAGE_NAME=$6 MYSQL_SHELL_PACKAGE_NAME="mysql-shell"; [ -n "$7" ] && MYSQL_SHELL_PACKAGE_NAME=$7 MYSQL_VERSION=""; [ -n "$8" ] && MYSQL_VERSION=$8 +SHELL_VERSION=""; [ -n "$9" ] && SHELL_VERSION=$9 + # 33060 is the default port for the mysqlx plugin, new to 5.7 declare -A PORTS PORTS["5.7"]="3306 33060" @@ -51,68 +53,66 @@ declare -A PRECREATE_DIRS PRECREATE_DIRS["5.7"]="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" PRECREATE_DIRS["8.0"]="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" -for VERSION in "${!MYSQL_SERVER_VERSIONS[@]}" -do - if [ -n "${MYSQL_VERSION}" ]; then - MYSQL_SERVER_PACKAGE=${MYSQL_SERVER_PACKAGE_NAME}-${MYSQL_VERSION} - MYSQL_SHELL_PACKAGE=${MYSQL_SHELL_PACKAGE_NAME}-${MYSQL_VERSION} - else - MYSQL_SERVER_PACKAGE=${MYSQL_SERVER_PACKAGE_NAME} - MYSQL_SHELL_PACKAGE=${MYSQL_SHELL_PACKAGE_NAME} - fi - # Dockerfiles - MYSQL_SERVER_REPOPATH=yum/mysql-$VERSION-community/docker/x86_64 - DOCKERFILE_TEMPLATE=template/Dockerfile - if [ "${VERSION}" != "8.0" ]; then - DOCKERFILE_TEMPLATE=template/Dockerfile-pre8 - fi - sed 's#%%MYSQL_SERVER_PACKAGE%%#'"${MYSQL_SERVER_PACKAGE}"'#g' $DOCKERFILE_TEMPLATE > tmpfile - sed -i 's#%%REPO%%#'"${REPO}"'#g' tmpfile - REPO_VERSION=${VERSION//\./} - sed -i 's#%%REPO_VERSION%%#'"${REPO_VERSION}"'#g' tmpfile - - sed -i 's#%%CONFIG_PACKAGE_NAME%%#'"${CONFIG_PACKAGE_NAME}"'#g' tmpfile - sed -i 's#%%CONFIG_PACKAGE_NAME_MINIMAL%%#'"${CONFIG_PACKAGE_NAME_MINIMAL}"'#g' tmpfile - sed -i 's#%%REPO_NAME_SERVER%%#'"${REPO_NAME_SERVER}"'#g' tmpfile - sed -i 's#%%REPO_NAME_TOOLS%%#'"${REPO_NAME_TOOLS}"'#g' tmpfile - - if [[ ! -z ${MYSQL_SHELL_VERSIONS[${VERSION}]} ]]; then - sed -i 's#%%MYSQL_SHELL_PACKAGE%%#'"${MYSQL_SHELL_PACKAGE}"'#g' tmpfile - else - sed -i 's#%%MYSQL_SHELL_PACKAGE%%#'""'#g' tmpfile - fi - - sed -i 's/%%PORTS%%/'"${PORTS[${VERSION}]}"'/g' tmpfile - mv tmpfile ${VERSION}/Dockerfile - - # Dockerfile_spec.rb - if [ ! -d "${VERSION}/inspec" ]; then - mkdir "${VERSION}/inspec" - fi - sed 's#%%MYSQL_VERSION%%#'"${MYSQL_VERSION}"'#g' template/control.rb > tmpFile - sed -i 's#%%MYSQL_SERVER_PACKAGE_NAME%%#'"${MYSQL_SERVER_PACKAGE_NAME}"'#g' tmpFile - sed -i 's#%%MYSQL_SHELL_PACKAGE_NAME%%#'"${MYSQL_SHELL_PACKAGE_NAME}"'#g' tmpFile - sed -i 's#%%MAJOR_VERSION%%#'"${VERSION}"'#g' tmpFile - if [ "${VERSION}" == "5.7" ]; then - sed -i 's#%%PORTS%%#'"3306/tcp, 33060/tcp"'#g' tmpFile - else - sed -i 's#%%PORTS%%#'"3306/tcp, 33060-33061/tcp"'#g' tmpFile - fi - mv tmpFile "${VERSION}/inspec/control.rb" - - # Entrypoint - sed 's#%%PASSWORDSET%%#'"${PASSWORDSET[${VERSION}]}"'#g' template/docker-entrypoint.sh > tmpfile - sed -i 's#%%FULL_SERVER_VERSION%%#'"${FULL_SERVER_VERSIONS[${VERSION}]}"'#g' tmpfile - sed -i 's#%%VALIDATE_CONFIG%%#'"${VALIDATE_CONFIG[${VERSION}]}"'#g' tmpfile - mv tmpfile ${VERSION}/docker-entrypoint.sh - chmod +x ${VERSION}/docker-entrypoint.sh - - # Healthcheck - cp template/healthcheck.sh ${VERSION}/ - chmod +x ${VERSION}/healthcheck.sh - - # Build-time preparation script - sed 's#%%PRECREATE_DIRS%%#'"${PRECREATE_DIRS[${VERSION}]}"'#g' template/prepare-image.sh > tmpfile - mv tmpfile ${VERSION}/prepare-image.sh - chmod +x ${VERSION}/prepare-image.sh -done +declare -A DOCKERFILE_TEMPLATES +DOCKERFILE_TEMPLATES["5.7"]="template/Dockerfile-pre8" +DOCKERFILE_TEMPLATES["8.0"]="template/Dockerfile" + +declare -A SPEC_PORTS +SPEC_PORTS["5.7"]="3306/tcp, 33060/tcp" +SPEC_PORTS["8.0"]="3306/tcp, 33060-33061/tcp" + +# Get the Major Version +VERSION=$(echo $MYSQL_VERSION | cut -d'.' -f'1,2') + +MYSQL_SERVER_PACKAGE=${MYSQL_SERVER_PACKAGE_NAME}-${MYSQL_VERSION} +MYSQL_SHELL_PACKAGE=${MYSQL_SHELL_PACKAGE_NAME}-${SHELL_VERSION} + +# Dockerfiles +MYSQL_SERVER_REPOPATH=yum/mysql-$VERSION-community/docker/x86_64 + +sed 's#%%MYSQL_SERVER_PACKAGE%%#'"${MYSQL_SERVER_PACKAGE}"'#g' ${DOCKERFILE_TEMPLATES[${VERSION}]} > tmpfile +sed -i 's#%%REPO%%#'"${REPO}"'#g' tmpfile + +REPO_VERSION=${VERSION//\./} +sed -i 's#%%REPO_VERSION%%#'"${REPO_VERSION}"'#g' tmpfile + +sed -i 's#%%CONFIG_PACKAGE_NAME%%#'"${CONFIG_PACKAGE_NAME}"'#g' tmpfile +sed -i 's#%%CONFIG_PACKAGE_NAME_MINIMAL%%#'"${CONFIG_PACKAGE_NAME_MINIMAL}"'#g' tmpfile +sed -i 's#%%REPO_NAME_SERVER%%#'"${REPO_NAME_SERVER}"'#g' tmpfile +sed -i 's#%%REPO_NAME_TOOLS%%#'"${REPO_NAME_TOOLS}"'#g' tmpfile + +sed -i 's#%%MYSQL_SHELL_PACKAGE%%#'"${MYSQL_SHELL_PACKAGE}"'#g' tmpfile + +sed -i 's/%%PORTS%%/'"${PORTS[${VERSION}]}"'/g' tmpfile +mv tmpfile ${VERSION}/Dockerfile + +# Dockerfile_spec.rb +if [ ! -d "${VERSION}/inspec" ]; then + mkdir "${VERSION}/inspec" +fi + +sed 's#%%MYSQL_SERVER_VERSION%%#'"${MYSQL_VERSION}"'#g' template/control.rb > tmpFile +sed -i 's#%%MYSQL_SHELL_VERSION%%#'"${SHELL_VERSION}"'#g' tmpFile +sed -i 's#%%MYSQL_SERVER_PACKAGE_NAME%%#'"${MYSQL_SERVER_PACKAGE_NAME}"'#g' tmpFile +sed -i 's#%%MYSQL_SHELL_PACKAGE_NAME%%#'"${MYSQL_SHELL_PACKAGE_NAME}"'#g' tmpFile +sed -i 's#%%MAJOR_VERSION%%#'"${VERSION}"'#g' tmpFile + +sed -i 's#%%PORTS%%#'"${SPEC_PORTS[${VERSION}]}"'#g' tmpFile +mv tmpFile "${VERSION}/inspec/control.rb" + +# Entrypoint +FULL_SERVER_VERSION="$MYSQL_VERSION-${IMAGE_VERSION}" +sed 's#%%PASSWORDSET%%#'"${PASSWORDSET[${VERSION}]}"'#g' template/docker-entrypoint.sh > tmpfile +sed -i 's#%%FULL_SERVER_VERSION%%#'"${FULL_SERVER_VERSION}"'#g' tmpfile +sed -i 's#%%VALIDATE_CONFIG%%#'"${VALIDATE_CONFIG[${VERSION}]}"'#g' tmpfile +mv tmpfile ${VERSION}/docker-entrypoint.sh +chmod +x ${VERSION}/docker-entrypoint.sh + +# Healthcheck +cp template/healthcheck.sh ${VERSION}/ +chmod +x ${VERSION}/healthcheck.sh + +# Build-time preparation script +sed 's#%%PRECREATE_DIRS%%#'"${PRECREATE_DIRS[${VERSION}]}"'#g' template/prepare-image.sh > tmpfile +mv tmpfile ${VERSION}/prepare-image.sh +chmod +x ${VERSION}/prepare-image.sh diff --git a/mysql-server/tag.sh b/mysql-server/tag.sh index f061b84a8..311377f2d 100755 --- a/mysql-server/tag.sh +++ b/mysql-server/tag.sh @@ -18,20 +18,30 @@ source VERSION SUFFIX='' [ -n "$1" ] && SUFFIX=$1 MAJOR_VERSIONS=("${!MYSQL_SERVER_VERSIONS[@]}"); [ -n "$2" ] && MAJOR_VERSIONS=("${@:2}") +WEEKLY='' [ -n "$3" ] && WEEKLY=$3 + for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do for MULTIARCH_VERSION in ${MULTIARCH_VERSIONS}; do + if [ "$WEEKLY" == "1" ]; then + SERVER_VERSION=${WEEKLY_SERVER_VERSIONS["${MAJOR_VERSION}"]} + else + SERVER_VERSION=${MYSQL_SERVER_VERSIONS["${MAJOR_VERSION}"]} + fi + FULL_SERVER_VERSION="${SERVER_VERSION}-${IMAGE_VERSION}" if [[ "$MULTIARCH_VERSION" == "$MAJOR_VERSION" ]]; then + TAGS="${SERVER_VERSION}${SUFFIX} ${FULL_SERVER_VERSION}${SUFFIX}" if [[ "$MAJOR_VERSION" == "$LATEST" ]]; then - echo "$MAJOR_VERSION$SUFFIX ${MYSQL_SERVER_VERSIONS["$MAJOR_VERSION"]}$SUFFIX ${FULL_SERVER_VERSIONS["$MAJOR_VERSION"]}$SUFFIX latest$SUFFIX" - else - echo "$MAJOR_VERSION$SUFFIX ${MYSQL_SERVER_VERSIONS["$MAJOR_VERSION"]}$SUFFIX ${FULL_SERVER_VERSIONS["$MAJOR_VERSION"]}$SUFFIX" + TAGS="$TAGS latest${SUFFIX}" fi + echo $TAGS fi done + for SINGLEARCH_VERSION in $SINGLEARCH_VERSIONS; do if [[ "$SINGLEARCH_VERSION" == "$MAJOR_VERSION" ]]; then - echo "$MAJOR_VERSION ${MYSQL_SERVER_VERSIONS["$MAJOR_VERSION"]} ${FULL_SERVER_VERSIONS["$MAJOR_VERSION"]}" + TAGS="${SERVER_VERSION} ${FULL_SERVER_VERSION}" + echo $TAGS fi done done diff --git a/mysql-server/template/control.rb b/mysql-server/template/control.rb index 2f3a3cd1a..33e3cfb61 100644 --- a/mysql-server/template/control.rb +++ b/mysql-server/template/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('%%MYSQL_SERVER_PACKAGE_NAME%%') do it { should be_installed } - its ('version') { should match '%%MYSQL_VERSION%%.*' } + its ('version') { should match '%%MYSQL_SERVER_VERSION%%.*' } end describe package('%%MYSQL_SHELL_PACKAGE_NAME%%') do it { should be_installed } - its ('version') { should match '%%MYSQL_VERSION%%.*' } + its ('version') { should match '%%MYSQL_SHELL_VERSION%%.*' } end end From e45eba4b2f226f40e87eb2938870693026859fc3 Mon Sep 17 00:00:00 2001 From: Prashant Tekriwal Date: Fri, 5 May 2023 11:16:14 +0200 Subject: [PATCH 301/386] ET#77853 - Fix router version used in manifest task for weekly builds Change-Id: I14dfd112796f71d8c1e037470803d464bef0ef0f --- mysql-router/manifest.sh | 8 +++++++- mysql-server/manifest.sh | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/mysql-router/manifest.sh b/mysql-router/manifest.sh index 6a55e29e9..fe69eb1d8 100755 --- a/mysql-router/manifest.sh +++ b/mysql-router/manifest.sh @@ -26,8 +26,14 @@ fi REPO=mysql/mysql-router; [ -n "$1" ] && REPO=$1 +WEEKLY=0 + +if [[ "$REPO" =~ (weekly) ]]; then + WEEKLY=1 +fi + for MAJOR_VERSION in ${MULTIARCH_VERSIONS}; do - MANIFEST_VERSIONS=$(./tag.sh "" "$MAJOR_VERSION") + MANIFEST_VERSIONS=$(./tag.sh "" "$MAJOR_VERSION" "$WEEKLY") for MANIFEST_VERSION in $MANIFEST_VERSIONS; do docker pull "$REPO:$MANIFEST_VERSION-arm64" "$REPO:$MANIFEST_VERSION-amd64" docker manifest create "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-arm64" "$REPO:$MANIFEST_VERSION-amd64" diff --git a/mysql-server/manifest.sh b/mysql-server/manifest.sh index d4ae5b459..f779f3424 100755 --- a/mysql-server/manifest.sh +++ b/mysql-server/manifest.sh @@ -26,8 +26,13 @@ fi REPO=mysql/mysql-server; [ -n "$1" ] && REPO=$1 +WEEKLY=0 +if [[ "$REPO" =~ (weekly) ]]; then + WEEKLY=1 +fi + for MAJOR_VERSION in ${MULTIARCH_VERSIONS}; do - MANIFEST_VERSIONS=$(./tag.sh "" "$MAJOR_VERSION") + MANIFEST_VERSIONS=$(./tag.sh "" "$MAJOR_VERSION" "$WEEKLY") for MANIFEST_VERSION in $MANIFEST_VERSIONS; do docker pull "$REPO:$MANIFEST_VERSION-arm64" "$REPO:$MANIFEST_VERSION-amd64" docker manifest create "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-arm64" "$REPO:$MANIFEST_VERSION-amd64" From 7e7510158016662dfbeb545243d6f001a5e13acd Mon Sep 17 00:00:00 2001 From: Prashant Tekriwal Date: Thu, 11 May 2023 09:43:37 +0200 Subject: [PATCH 302/386] ET#77897 - Add MAJOR_VERSION tag for docker builds i.e. 8.0 or 5.7 Change-Id: I491039e486d447f4e2c5e1838e005ae5cf84d89e --- mysql-router/tag.sh | 2 +- mysql-server/tag.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mysql-router/tag.sh b/mysql-router/tag.sh index 7c5c0869b..d3ee4314d 100755 --- a/mysql-router/tag.sh +++ b/mysql-router/tag.sh @@ -17,7 +17,7 @@ for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do ROUTER_VERSION=${MYSQL_ROUTER_VERSIONS["${MAJOR_VERSION}"]} fi FULL_ROUTER_VERSION="${ROUTER_VERSION}-${IMAGE_VERSION}" - TAGS="${ROUTER_VERSION}${SUFFIX} ${FULL_ROUTER_VERSION}${SUFFIX}" + TAGS="${MAJOR_VERSION}${SUFFIX} ${ROUTER_VERSION}${SUFFIX} ${FULL_ROUTER_VERSION}${SUFFIX}" if [[ "$MAJOR_VERSION" == "$LATEST" ]]; then TAGS="$TAGS latest${SUFFIX}" fi diff --git a/mysql-server/tag.sh b/mysql-server/tag.sh index 311377f2d..90a60eeef 100755 --- a/mysql-server/tag.sh +++ b/mysql-server/tag.sh @@ -30,7 +30,7 @@ for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do fi FULL_SERVER_VERSION="${SERVER_VERSION}-${IMAGE_VERSION}" if [[ "$MULTIARCH_VERSION" == "$MAJOR_VERSION" ]]; then - TAGS="${SERVER_VERSION}${SUFFIX} ${FULL_SERVER_VERSION}${SUFFIX}" + TAGS="${MAJOR_VERSION}${SUFFIX} ${SERVER_VERSION}${SUFFIX} ${FULL_SERVER_VERSION}${SUFFIX}" if [[ "$MAJOR_VERSION" == "$LATEST" ]]; then TAGS="$TAGS latest${SUFFIX}" fi @@ -40,7 +40,7 @@ for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do for SINGLEARCH_VERSION in $SINGLEARCH_VERSIONS; do if [[ "$SINGLEARCH_VERSION" == "$MAJOR_VERSION" ]]; then - TAGS="${SERVER_VERSION} ${FULL_SERVER_VERSION}" + TAGS="${MAJOR_VERSION} ${SERVER_VERSION} ${FULL_SERVER_VERSION}" echo $TAGS fi done From deb6578b549b01c8a7a6ed8af5387f2c32aed197 Mon Sep 17 00:00:00 2001 From: Nawaz Nazeer Ahamed Date: Fri, 12 May 2023 12:12:13 +0530 Subject: [PATCH 303/386] ET#72314 - Clean up repo config after build Change-Id: I771559c8c2164dbdf3dedbb6873bad6fad30496d --- mysql-server/gen_dockerfiles.sh | 5 +++++ mysql-server/template/Dockerfile | 1 + mysql-server/template/Dockerfile-pre8 | 1 + 3 files changed, 7 insertions(+) diff --git a/mysql-server/gen_dockerfiles.sh b/mysql-server/gen_dockerfiles.sh index 9620a004d..c8d628b84 100755 --- a/mysql-server/gen_dockerfiles.sh +++ b/mysql-server/gen_dockerfiles.sh @@ -32,6 +32,8 @@ MYSQL_SERVER_PACKAGE_NAME="mysql-community-server-minimal"; [ -n "$6" ] && MYSQL MYSQL_SHELL_PACKAGE_NAME="mysql-shell"; [ -n "$7" ] && MYSQL_SHELL_PACKAGE_NAME=$7 MYSQL_VERSION=""; [ -n "$8" ] && MYSQL_VERSION=$8 SHELL_VERSION=""; [ -n "$9" ] && SHELL_VERSION=$9 +MYSQL_CONFIG_PKG_MINIMAL="mysql-community-minimal-release"; [ -n "$10" ] && MYSQL_CONFIG_PKG_MINIMAL=$10 +MYSQL_CONFIG_PKG="mysql80-community-release"; [ -n "$11" ] && MYSQL_CONFIG_PKG=$11 # 33060 is the default port for the mysqlx plugin, new to 5.7 declare -A PORTS @@ -83,6 +85,9 @@ sed -i 's#%%REPO_NAME_TOOLS%%#'"${REPO_NAME_TOOLS}"'#g' tmpfile sed -i 's#%%MYSQL_SHELL_PACKAGE%%#'"${MYSQL_SHELL_PACKAGE}"'#g' tmpfile +sed -i 's#%%MYSQL_CONFIG_PKG_MINIMAL%%#'"${MYSQL_CONFIG_PKG_MINIMAL}"'#g' tmpfile +sed -i 's#%%MYSQL_CONFIG_PKG%%#'"${MYSQL_CONFIG_PKG}"'#g' tmpfile + sed -i 's/%%PORTS%%/'"${PORTS[${VERSION}]}"'/g' tmpfile mv tmpfile ${VERSION}/Dockerfile diff --git a/mysql-server/template/Dockerfile b/mysql-server/template/Dockerfile index a623b390e..1aaf290cc 100644 --- a/mysql-server/template/Dockerfile +++ b/mysql-server/template/Dockerfile @@ -27,6 +27,7 @@ RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ && microdnf install -y --enablerepo=%%REPO_NAME_TOOLS%% $MYSQL_SHELL_PACKAGE \ && microdnf install -y --disablerepo=ol8_appstream \ --enablerepo=%%REPO_NAME_SERVER%% $MYSQL_SERVER_PACKAGE \ + && microdnf remove %%MYSQL_CONFIG_PKG_MINIMAL%% %%MYSQL_CONFIG_PKG%% && microdnf clean all \ && mkdir /docker-entrypoint-initdb.d diff --git a/mysql-server/template/Dockerfile-pre8 b/mysql-server/template/Dockerfile-pre8 index 13c652a92..e8e0451f2 100644 --- a/mysql-server/template/Dockerfile-pre8 +++ b/mysql-server/template/Dockerfile-pre8 @@ -24,6 +24,7 @@ RUN rpm -U %%REPO%%/mysql-community-minimal-release-el7.rpm \ # Install server and shell 8.0 RUN yum install -y $MYSQL_SHELL_PACKAGE --enablerepo=%%REPO_NAME_TOOLS%% \ && yum install -y $MYSQL_SERVER_PACKAGE --enablerepo=%%REPO_NAME_SERVER%% \ + && yum remove %%MYSQL_CONFIG_PKG_MINIMAL%% %%MYSQL_CONFIG_PKG%% && yum clean all \ && mkdir /docker-entrypoint-initdb.d From d5583fd86fdfb388eae5fb2e6fa74f78a086b98a Mon Sep 17 00:00:00 2001 From: Nawaz Nazeer Ahamed Date: Tue, 16 May 2023 12:01:31 +0530 Subject: [PATCH 304/386] ET#72314 - [Follow-up] Fix to use correct positional arguments Change-Id: I04af15463601e8b8ca3d183741aeba3a0da12008 --- mysql-server/gen_dockerfiles.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-server/gen_dockerfiles.sh b/mysql-server/gen_dockerfiles.sh index c8d628b84..4fefde635 100755 --- a/mysql-server/gen_dockerfiles.sh +++ b/mysql-server/gen_dockerfiles.sh @@ -32,8 +32,8 @@ MYSQL_SERVER_PACKAGE_NAME="mysql-community-server-minimal"; [ -n "$6" ] && MYSQL MYSQL_SHELL_PACKAGE_NAME="mysql-shell"; [ -n "$7" ] && MYSQL_SHELL_PACKAGE_NAME=$7 MYSQL_VERSION=""; [ -n "$8" ] && MYSQL_VERSION=$8 SHELL_VERSION=""; [ -n "$9" ] && SHELL_VERSION=$9 -MYSQL_CONFIG_PKG_MINIMAL="mysql-community-minimal-release"; [ -n "$10" ] && MYSQL_CONFIG_PKG_MINIMAL=$10 -MYSQL_CONFIG_PKG="mysql80-community-release"; [ -n "$11" ] && MYSQL_CONFIG_PKG=$11 +MYSQL_CONFIG_PKG_MINIMAL="mysql-community-minimal-release"; [ -n "${10}" ] && MYSQL_CONFIG_PKG_MINIMAL=${10} +MYSQL_CONFIG_PKG="mysql80-community-release"; [ -n "${11}" ] && MYSQL_CONFIG_PKG=${11} # 33060 is the default port for the mysqlx plugin, new to 5.7 declare -A PORTS From 9d202148beb619c9617b67f423cfbfccae4eab13 Mon Sep 17 00:00:00 2001 From: Nawaz Nazeer Ahamed Date: Tue, 16 May 2023 12:58:07 +0530 Subject: [PATCH 305/386] ET#72314 - [Follow-up] Fix docker run cmd usage Change-Id: Ifb18a250c6ba2349ba8f18a276fce47faccac180 --- mysql-server/template/Dockerfile | 2 +- mysql-server/template/Dockerfile-pre8 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-server/template/Dockerfile b/mysql-server/template/Dockerfile index 1aaf290cc..c0cc05021 100644 --- a/mysql-server/template/Dockerfile +++ b/mysql-server/template/Dockerfile @@ -27,7 +27,7 @@ RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ && microdnf install -y --enablerepo=%%REPO_NAME_TOOLS%% $MYSQL_SHELL_PACKAGE \ && microdnf install -y --disablerepo=ol8_appstream \ --enablerepo=%%REPO_NAME_SERVER%% $MYSQL_SERVER_PACKAGE \ - && microdnf remove %%MYSQL_CONFIG_PKG_MINIMAL%% %%MYSQL_CONFIG_PKG%% + && microdnf remove %%MYSQL_CONFIG_PKG_MINIMAL%% %%MYSQL_CONFIG_PKG%% \ && microdnf clean all \ && mkdir /docker-entrypoint-initdb.d diff --git a/mysql-server/template/Dockerfile-pre8 b/mysql-server/template/Dockerfile-pre8 index e8e0451f2..720ff5c5f 100644 --- a/mysql-server/template/Dockerfile-pre8 +++ b/mysql-server/template/Dockerfile-pre8 @@ -24,7 +24,7 @@ RUN rpm -U %%REPO%%/mysql-community-minimal-release-el7.rpm \ # Install server and shell 8.0 RUN yum install -y $MYSQL_SHELL_PACKAGE --enablerepo=%%REPO_NAME_TOOLS%% \ && yum install -y $MYSQL_SERVER_PACKAGE --enablerepo=%%REPO_NAME_SERVER%% \ - && yum remove %%MYSQL_CONFIG_PKG_MINIMAL%% %%MYSQL_CONFIG_PKG%% + && yum remove %%MYSQL_CONFIG_PKG_MINIMAL%% %%MYSQL_CONFIG_PKG%% \ && yum clean all \ && mkdir /docker-entrypoint-initdb.d From 283c62c8c833876e67d8af3ab7f0fddc65fc5b6c Mon Sep 17 00:00:00 2001 From: Nawaz Nazeer Ahamed Date: Tue, 16 May 2023 21:31:38 +0530 Subject: [PATCH 306/386] ET#72314 - [Follow-up] Override default user command option in yum Change-Id: I80fdbb4aa0c02ed5f475489b5a7f9c148294e7e7 --- mysql-server/template/Dockerfile-pre8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-server/template/Dockerfile-pre8 b/mysql-server/template/Dockerfile-pre8 index 720ff5c5f..8541998f1 100644 --- a/mysql-server/template/Dockerfile-pre8 +++ b/mysql-server/template/Dockerfile-pre8 @@ -24,7 +24,7 @@ RUN rpm -U %%REPO%%/mysql-community-minimal-release-el7.rpm \ # Install server and shell 8.0 RUN yum install -y $MYSQL_SHELL_PACKAGE --enablerepo=%%REPO_NAME_TOOLS%% \ && yum install -y $MYSQL_SERVER_PACKAGE --enablerepo=%%REPO_NAME_SERVER%% \ - && yum remove %%MYSQL_CONFIG_PKG_MINIMAL%% %%MYSQL_CONFIG_PKG%% \ + && yum remove -y %%MYSQL_CONFIG_PKG_MINIMAL%% %%MYSQL_CONFIG_PKG%% \ && yum clean all \ && mkdir /docker-entrypoint-initdb.d From dfa1fa4f7aeb7b575c5dd05cad5413008c8177dc Mon Sep 17 00:00:00 2001 From: Nawaz Nazeer Ahamed Date: Wed, 24 May 2023 08:24:58 +0200 Subject: [PATCH 307/386] ET#77992 - Update docker main repo - support 5.7 commercial builds Change-Id: Ie88b77b4be0dd27da0f67be40b54004d74e46270 --- mysql-server/build.sh | 13 ++++++++++--- mysql-server/gen_dockerfiles.sh | 8 +++++++- mysql-server/template/Dockerfile-pre8 | 4 ++-- mysql-server/template/control.rb | 4 ++-- mysql-server/test.sh | 19 +++++++++++++------ 5 files changed, 34 insertions(+), 14 deletions(-) diff --git a/mysql-server/build.sh b/mysql-server/build.sh index bb5e1369e..bac7380dc 100755 --- a/mysql-server/build.sh +++ b/mysql-server/build.sh @@ -25,17 +25,24 @@ if grep -q Microsoft /proc/version; then fi ARCH=amd64; [ -n "$1" ] && ARCH=$1 -MAJOR_VERSIONS=("${!MYSQL_SERVER_VERSIONS[@]}"); [ -n "$2" ] && MAJOR_VERSIONS=("${@:2}") +BUILD_TYPE=community; [ -n "$2" ] && BUILD_TYPE=$2 +MAJOR_VERSIONS=("${!MYSQL_SERVER_VERSIONS[@]}"); [ -n "$2" ] && MAJOR_VERSIONS=("${@:3}") + +if [[ ${BUILD_TYPE} =~ (commercial) ]]; then + IMG_LOC=store/oracle/mysql-enterprise-server +else + IMG_LOC=mysql/mysql-server +fi for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do for MULTIARCH_VERSION in ${MULTIARCH_VERSIONS}; do if [[ "$MULTIARCH_VERSION" == "$MAJOR_VERSION" ]]; then - docker build --build-arg http_proxy="$http_proxy" --build-arg https_proxy="$http_proxy" --build-arg no_proxy="$no_proxy" -t mysql/mysql-server:"$MAJOR_VERSION"-$ARCH "$MAJOR_VERSION" + docker build --build-arg http_proxy="$http_proxy" --build-arg https_proxy="$http_proxy" --build-arg no_proxy="$no_proxy" -t $IMG_LOC:"$MAJOR_VERSION"-$ARCH "$MAJOR_VERSION" fi done for SINGLEARCH_VERSION in $SINGLEARCH_VERSIONS; do if [[ "$SINGLEARCH_VERSION" == "$MAJOR_VERSION" ]]; then - docker build --build-arg http_proxy="$http_proxy" --build-arg https_proxy="$http_proxy" --build-arg no_proxy="$no_proxy" -t mysql/mysql-server:"$MAJOR_VERSION" "$MAJOR_VERSION" + docker build --build-arg http_proxy="$http_proxy" --build-arg https_proxy="$http_proxy" --build-arg no_proxy="$no_proxy" -t $IMG_LOC:"$MAJOR_VERSION" "$MAJOR_VERSION" fi done done diff --git a/mysql-server/gen_dockerfiles.sh b/mysql-server/gen_dockerfiles.sh index 4fefde635..32e5543b0 100755 --- a/mysql-server/gen_dockerfiles.sh +++ b/mysql-server/gen_dockerfiles.sh @@ -35,6 +35,12 @@ SHELL_VERSION=""; [ -n "$9" ] && SHELL_VERSION=$9 MYSQL_CONFIG_PKG_MINIMAL="mysql-community-minimal-release"; [ -n "${10}" ] && MYSQL_CONFIG_PKG_MINIMAL=${10} MYSQL_CONFIG_PKG="mysql80-community-release"; [ -n "${11}" ] && MYSQL_CONFIG_PKG=${11} +if [[ ${MYSQL_CONFIG_PKG_MINIMAL} =~ (community) ]]; then + CONT_NAME="mysql-server" +else + CONT_NAME="mysql-enterprise-server" +fi + # 33060 is the default port for the mysqlx plugin, new to 5.7 declare -A PORTS PORTS["5.7"]="3306 33060" @@ -101,7 +107,7 @@ sed -i 's#%%MYSQL_SHELL_VERSION%%#'"${SHELL_VERSION}"'#g' tmpFile sed -i 's#%%MYSQL_SERVER_PACKAGE_NAME%%#'"${MYSQL_SERVER_PACKAGE_NAME}"'#g' tmpFile sed -i 's#%%MYSQL_SHELL_PACKAGE_NAME%%#'"${MYSQL_SHELL_PACKAGE_NAME}"'#g' tmpFile sed -i 's#%%MAJOR_VERSION%%#'"${VERSION}"'#g' tmpFile - +sed -i 's#%%CONT_NAME%%#'"${CONT_NAME}"'#g' tmpFile sed -i 's#%%PORTS%%#'"${SPEC_PORTS[${VERSION}]}"'#g' tmpFile mv tmpFile "${VERSION}/inspec/control.rb" diff --git a/mysql-server/template/Dockerfile-pre8 b/mysql-server/template/Dockerfile-pre8 index 8541998f1..53a7d387e 100644 --- a/mysql-server/template/Dockerfile-pre8 +++ b/mysql-server/template/Dockerfile-pre8 @@ -18,8 +18,8 @@ ARG MYSQL_SERVER_PACKAGE=%%MYSQL_SERVER_PACKAGE%% ARG MYSQL_SHELL_PACKAGE=%%MYSQL_SHELL_PACKAGE%% # Setup repositories for minimal packages (all versions) -RUN rpm -U %%REPO%%/mysql-community-minimal-release-el7.rpm \ - && rpm -U %%REPO%%/mysql80-community-release-el7.rpm +RUN rpm -U %%REPO%%/%%CONFIG_PACKAGE_NAME_MINIMAL%% \ + && rpm -U %%REPO%%/%%CONFIG_PACKAGE_NAME%% # Install server and shell 8.0 RUN yum install -y $MYSQL_SHELL_PACKAGE --enablerepo=%%REPO_NAME_TOOLS%% \ diff --git a/mysql-server/template/control.rb b/mysql-server/template/control.rb index 33e3cfb61..ac449005f 100644 --- a/mysql-server/template/control.rb +++ b/mysql-server/template/control.rb @@ -3,8 +3,8 @@ describe podman.containers do its('status') { should cmp /Up/ } its('commands') { should cmp /mysqld/ } - its('images') { should cmp /mysql-server:%%MAJOR_VERSION%%/ } - its('names') { should include "mysql-server-%%MAJOR_VERSION%%" } + its('images') { should cmp /%%CONT_NAME%%:%%MAJOR_VERSION%%/ } + its('names') { should include "%%CONT_NAME%%-%%MAJOR_VERSION%%" } end end control 'packages' do diff --git a/mysql-server/test.sh b/mysql-server/test.sh index cb644163d..e69d1c468 100755 --- a/mysql-server/test.sh +++ b/mysql-server/test.sh @@ -16,7 +16,6 @@ # This script will simply use sed to replace placeholder variables in the # files in template/ with version-specific variants. - set -e source ./VERSION @@ -31,8 +30,16 @@ if grep -q Microsoft /proc/version; then fi ARCH=amd64; [ -n "$1" ] && ARCH=$1 -MAJOR_VERSIONS=("${!MYSQL_SERVER_VERSIONS[@]}"); [ -n "$2" ] && MAJOR_VERSIONS=("${@:2}") +BUILD_TYPE=community; [ -n "$2" ] && BUILD_TYPE=$2 +MAJOR_VERSIONS=("${!MYSQL_SERVER_VERSIONS[@]}"); [ -n "$3" ] && MAJOR_VERSIONS=("${@:3}") +if [[ ${BUILD_TYPE} =~ (commercial) ]]; then + IMG_LOC="store/oracle/mysql-enterprise-server" + CONT_NAME="mysql-enterprise-server-$MAJOR_VERSION" +else + IMG_LOC="mysql/mysql-server" + CONT_NAME="mysql-server-$MAJOR_VERSION" +fi for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do ARCH_SUFFIX="" @@ -41,14 +48,14 @@ for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do ARCH_SUFFIX="-$ARCH" fi done - podman run -d --rm --name "mysql-server-$MAJOR_VERSION" mysql/mysql-server:"$MAJOR_VERSION$ARCH_SUFFIX" + podman run -d --rm --name $CONT_NAME "$IMG_LOC":"$MAJOR_VERSION$ARCH_SUFFIX" export DOCKER_HOST=unix:///tmp/podman.sock podman system service --time=0 ${DOCKER_HOST} & DOCKER_SOCK_PID="$!" inspec exec --no-color "$MAJOR_VERSION/inspec/control.rb" --controls container - inspec exec --no-color "$MAJOR_VERSION/inspec/control.rb" -t "docker://mysql-server-$MAJOR_VERSION" --controls packages - podman stop -i "mysql-server-$MAJOR_VERSION" - podman rm -i -f "mysql-server-$MAJOR_VERSION" + inspec exec --no-color "$MAJOR_VERSION/inspec/control.rb" -t "docker://$CONT_NAME" --controls packages + podman stop -i "$CONT_NAME" + podman rm -i -f "$CONT_NAME" kill -TERM ${DOCKER_SOCK_PID} rm -f /tmp/podman.sock done From a64789f34bdf7ab1f05a698fc9a055a8e0e7a03d Mon Sep 17 00:00:00 2001 From: Nawaz Nazeer Ahamed Date: Mon, 5 Jun 2023 08:27:48 +0200 Subject: [PATCH 308/386] ET#78090 - Added support for 8.1 version Change-Id: I9b4a7463dc4e334cd648080c9612912aeefe29eb --- mysql-server/VERSION | 23 +- mysql-server/build.sh | 11 +- mysql-server/gen_dockerfiles.sh | 20 +- mysql-server/innovation/Dockerfile | 44 ++++ mysql-server/innovation/docker-entrypoint.sh | 230 +++++++++++++++++++ mysql-server/innovation/healthcheck.sh | 24 ++ mysql-server/innovation/inspec/control.rb | 20 ++ mysql-server/innovation/prepare-image.sh | 25 ++ mysql-server/manifest.sh | 18 +- mysql-server/tag.sh | 5 +- mysql-server/test.sh | 16 +- 11 files changed, 405 insertions(+), 31 deletions(-) create mode 100644 mysql-server/innovation/Dockerfile create mode 100755 mysql-server/innovation/docker-entrypoint.sh create mode 100755 mysql-server/innovation/healthcheck.sh create mode 100644 mysql-server/innovation/inspec/control.rb create mode 100755 mysql-server/innovation/prepare-image.sh diff --git a/mysql-server/VERSION b/mysql-server/VERSION index 26ac3b60d..da7d7cc29 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,19 +1,24 @@ IMAGE_VERSION=1.2.12-server declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["5.7"]=5.7.42 -MYSQL_SERVER_VERSIONS["8.0"]=8.0.33 +MYSQL_SERVER_VERSIONS["5.7"]=5.7.43 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.34 +MYSQL_SERVER_VERSIONS["innovation"]=8.1.0 -WEEKLY_SERVER_VERSIONS["5.7"]=5.7.43 -WEEKLY_SERVER_VERSIONS["8.0"]=8.0.34 +WEEKLY_SERVER_VERSIONS["5.7"]=5.7.44 +WEEKLY_SERVER_VERSIONS["8.0"]=8.0.35 +WEEKLY_SERVER_VERSIONS["innovation_next"]=8.2.0 declare -A MYSQL_SHELL_VERSIONS WEEKLY_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["5.7"]=8.0.33 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.33 +MYSQL_SHELL_VERSIONS["5.7"]=8.0.34 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.34 +MYSQL_SHELL_VERSIONS["innovation"]=8.1.0 -WEEKLY_SHELL_VERSIONS["5.7"]=8.0.34 -WEEKLY_SHELL_VERSIONS["8.0"]=8.0.34 +WEEKLY_SHELL_VERSIONS["5.7"]=8.0.35 +WEEKLY_SHELL_VERSIONS["8.0"]=8.0.35 +WEEKLY_SHELL_VERSIONS["innovation_next"]=8.2.0 -MULTIARCH_VERSIONS="8.0" +MULTIARCH_VERSIONS=("8.0" "innovation") SINGLEARCH_VERSIONS="5.7" LATEST="8.0" +LATEST_INNOVATION="8.1" diff --git a/mysql-server/build.sh b/mysql-server/build.sh index bac7380dc..5b10eac4b 100755 --- a/mysql-server/build.sh +++ b/mysql-server/build.sh @@ -26,7 +26,7 @@ fi ARCH=amd64; [ -n "$1" ] && ARCH=$1 BUILD_TYPE=community; [ -n "$2" ] && BUILD_TYPE=$2 -MAJOR_VERSIONS=("${!MYSQL_SERVER_VERSIONS[@]}"); [ -n "$2" ] && MAJOR_VERSIONS=("${@:3}") +MAJOR_VERSIONS=("${!MYSQL_SERVER_VERSIONS[@]}"); [ -n "$3" ] && MAJOR_VERSIONS=("${@:3}") if [[ ${BUILD_TYPE} =~ (commercial) ]]; then IMG_LOC=store/oracle/mysql-enterprise-server @@ -35,9 +35,14 @@ else fi for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do - for MULTIARCH_VERSION in ${MULTIARCH_VERSIONS}; do + for MULTIARCH_VERSION in "${MULTIARCH_VERSIONS[@]}"; do if [[ "$MULTIARCH_VERSION" == "$MAJOR_VERSION" ]]; then - docker build --build-arg http_proxy="$http_proxy" --build-arg https_proxy="$http_proxy" --build-arg no_proxy="$no_proxy" -t $IMG_LOC:"$MAJOR_VERSION"-$ARCH "$MAJOR_VERSION" + if [[ "$MAJOR_VERSION" == "innovation" ]]; then + VERSION=${LATEST_INNOVATION} + docker build --build-arg http_proxy="$http_proxy" --build-arg https_proxy="$http_proxy" --build-arg no_proxy="$no_proxy" -t $IMG_LOC:"$VERSION"-$ARCH "$MAJOR_VERSION" + else + docker build --build-arg http_proxy="$http_proxy" --build-arg https_proxy="$http_proxy" --build-arg no_proxy="$no_proxy" -t $IMG_LOC:"$MAJOR_VERSION"-$ARCH "$MAJOR_VERSION" + fi fi done for SINGLEARCH_VERSION in $SINGLEARCH_VERSIONS; do diff --git a/mysql-server/gen_dockerfiles.sh b/mysql-server/gen_dockerfiles.sh index 32e5543b0..6fb956be1 100755 --- a/mysql-server/gen_dockerfiles.sh +++ b/mysql-server/gen_dockerfiles.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2017, 2021, Oracle and/or its affiliates. +# Copyright (c) 2017, 2023, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -13,7 +13,6 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - set -e # This script will simply use sed to replace placeholder variables in the @@ -45,32 +44,42 @@ fi declare -A PORTS PORTS["5.7"]="3306 33060" PORTS["8.0"]="3306 33060 33061" +PORTS["innovation"]="3306 33060 33061" declare -A PASSWORDSET PASSWORDSET["5.7"]="ALTER USER 'root'@'localhost' IDENTIFIED BY '\${MYSQL_ROOT_PASSWORD}';" PASSWORDSET["8.0"]=${PASSWORDSET["5.7"]} +PASSWORDSET["innovation"]=${PASSWORDSET["8.0"]} # MySQL 8.0 supports a call to validate the config, while older versions have it as a side # effect of running --verbose --help declare -A VALIDATE_CONFIG VALIDATE_CONFIG["5.7"]="output=\$(\"\$@\" --verbose --help 2>\&1 > /dev/null) || result=\$?" VALIDATE_CONFIG["8.0"]="output=\$(\"\$@\" --validate-config) || result=\$?" +VALIDATE_CONFIG["innovation"]="output=\$(\"\$@\" --validate-config) || result=\$?" # Data directories that must be created with special ownership and permissions when the image is built declare -A PRECREATE_DIRS PRECREATE_DIRS["5.7"]="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" PRECREATE_DIRS["8.0"]="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" +PRECREATE_DIRS["innovation"]="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" declare -A DOCKERFILE_TEMPLATES DOCKERFILE_TEMPLATES["5.7"]="template/Dockerfile-pre8" DOCKERFILE_TEMPLATES["8.0"]="template/Dockerfile" +DOCKERFILE_TEMPLATES["innovation"]="template/Dockerfile" declare -A SPEC_PORTS SPEC_PORTS["5.7"]="3306/tcp, 33060/tcp" SPEC_PORTS["8.0"]="3306/tcp, 33060-33061/tcp" +SPEC_PORTS["innovation"]="3306/tcp, 33060-33061/tcp" + # Get the Major Version VERSION=$(echo $MYSQL_VERSION | cut -d'.' -f'1,2') +if [[ $(awk -v ver="$VERSION" 'BEGIN{ if (ver >= 8.1) print "true" }') == "true" ]]; then + VERSION="innovation" +fi MYSQL_SERVER_PACKAGE=${MYSQL_SERVER_PACKAGE_NAME}-${MYSQL_VERSION} MYSQL_SHELL_PACKAGE=${MYSQL_SHELL_PACKAGE_NAME}-${SHELL_VERSION} @@ -106,7 +115,12 @@ sed 's#%%MYSQL_SERVER_VERSION%%#'"${MYSQL_VERSION}"'#g' template/control.rb > tm sed -i 's#%%MYSQL_SHELL_VERSION%%#'"${SHELL_VERSION}"'#g' tmpFile sed -i 's#%%MYSQL_SERVER_PACKAGE_NAME%%#'"${MYSQL_SERVER_PACKAGE_NAME}"'#g' tmpFile sed -i 's#%%MYSQL_SHELL_PACKAGE_NAME%%#'"${MYSQL_SHELL_PACKAGE_NAME}"'#g' tmpFile -sed -i 's#%%MAJOR_VERSION%%#'"${VERSION}"'#g' tmpFile +if [[ "$VERSION" == "innovation" ]]; then + MAJOR_VERSION=${LATEST_INNOVATION} +else + MAJOR_VERSION=${VERSION} +fi +sed -i 's#%%MAJOR_VERSION%%#'"${MAJOR_VERSION}"'#g' tmpFile sed -i 's#%%CONT_NAME%%#'"${CONT_NAME}"'#g' tmpFile sed -i 's#%%PORTS%%#'"${SPEC_PORTS[${VERSION}]}"'#g' tmpFile mv tmpFile "${VERSION}/inspec/control.rb" diff --git a/mysql-server/innovation/Dockerfile b/mysql-server/innovation/Dockerfile new file mode 100644 index 000000000..5233b0987 --- /dev/null +++ b/mysql-server/innovation/Dockerfile @@ -0,0 +1,44 @@ +# Copyright (c) 2017, 2023, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +FROM container-registry.oracle.com/os/oraclelinux:8-slim + +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal +ARG MYSQL_SHELL_PACKAGE=mysql-shell + +# Setup repositories for minimal packages (all versions) +RUN rpm -U https://repo.mysql.com/mysql-community-minimal-release-el8.rpm \ + && rpm -U https://repo.mysql.com/mysql80-community-release-el8.rpm + +# Install server and shell innovation +RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ + && microdnf install -y --enablerepo=mysql-tools-community $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --disablerepo=ol8_appstream \ + --enablerepo=mysql80-community-minimal $MYSQL_SERVER_PACKAGE \ + && microdnf clean all \ + && mkdir /docker-entrypoint-initdb.d + +COPY prepare-image.sh / +RUN /prepare-image.sh && rm -f /prepare-image.sh + +ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock + +COPY docker-entrypoint.sh /entrypoint.sh +COPY healthcheck.sh /healthcheck.sh +ENTRYPOINT ["/entrypoint.sh"] +HEALTHCHECK CMD /healthcheck.sh +EXPOSE 3306 33060 33061 +CMD ["mysqld"] + diff --git a/mysql-server/innovation/docker-entrypoint.sh b/mysql-server/innovation/docker-entrypoint.sh new file mode 100755 index 000000000..a0c85927f --- /dev/null +++ b/mysql-server/innovation/docker-entrypoint.sh @@ -0,0 +1,230 @@ +#!/bin/bash +# Copyright (c) 2017, 2023, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +echo "[Entrypoint] MySQL Docker Image 8.1.0-1.0.0-server" +# Fetch value from server config +# We use mysqld --verbose --help instead of my_print_defaults because the +# latter only show values present in config files, and not server defaults +_get_config() { + local conf="$1"; shift + "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' +} + +# Generate a random password +_mkpw() { + letter=$(cat /dev/urandom| tr -dc a-zA-Z | dd bs=1 count=16 2> /dev/null ) + number=$(cat /dev/urandom| tr -dc 0-9 | dd bs=1 count=8 2> /dev/null) + special=$(cat /dev/urandom| tr -dc '=+@#%^&*_.,;:?/' | dd bs=1 count=8 2> /dev/null) + + echo $letter$number$special | fold -w 1 | shuf | tr -d '\n' +} + +# If command starts with an option, prepend mysqld +# This allows users to add command-line options without +# needing to specify the "mysqld" command +if [ "${1:0:1}" = '-' ]; then + set -- mysqld "$@" +fi + +# Check if entrypoint (and the container) is running as root +if [ $(id -u) = "0" ]; then + is_root=1 + install_devnull="install /dev/null -m0600 -omysql -gmysql" + MYSQLD_USER=mysql +else + install_devnull="install /dev/null -m0600" + MYSQLD_USER=$(id -u) +fi + +if [ "$1" = 'mysqld' ]; then + # Test that the server can start. We redirect stdout to /dev/null so + # only the error messages are left. + result=0 + output=$("$@" --validate-config) || result=$? + if [ ! "$result" = "0" ]; then + echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' + echo >&2 "[Entrypoint] $output" + exit 1 + fi + + # Get config + DATADIR="$(_get_config 'datadir' "$@")" + SOCKET="$(_get_config 'socket' "$@")" + + if [ ! -d "$DATADIR/mysql" ]; then + # If the password variable is a filename we use the contents of the file. We + # read this first to make sure that a proper error is generated for empty files. + if [ -f "$MYSQL_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + if [ -z "$MYSQL_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' + exit 1 + fi + fi + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] No password option specified for new database.' + echo >&2 '[Entrypoint] A random onetime password will be generated.' + MYSQL_RANDOM_ROOT_PASSWORD=true + MYSQL_ONETIME_PASSWORD=true + fi + if [ ! -d "$DATADIR" ]; then + mkdir -p "$DATADIR" + chown mysql:mysql "$DATADIR" + fi + + # The user can set a default_timezone either in a my.cnf file + # they mount into the container or on command line + # (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`) + # however the timezone tables will only be populated in a later + # stage of this script. By using +00:00 as timezone we override + # the user's choice during initialization. Later the server + # will be restarted using the user's option. + + echo '[Entrypoint] Initializing database' + "$@" --user=$MYSQLD_USER --initialize-insecure --default-time-zone=+00:00 + + echo '[Entrypoint] Database initialized' + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" --default-time-zone=+00:00 + + # To avoid using password on commandline, put it in a temporary file. + # The file is only populated when and if the root password is set. + PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + $install_devnull "$PASSFILE" + # Define the client command used throughout the script + # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") + + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break + fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 + fi + + mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql + + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(_mkpw)" + echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + fi + if [ -z "$MYSQL_ROOT_HOST" ]; then + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';" + else + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ + GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + fi + "${mysql[@]}" <<-EOSQL + DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; + ${ROOTCREATE} + FLUSH PRIVILEGES ; + EOSQL + if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then + # Put the password into the temporary config file + cat >"$PASSFILE" < "$SQL" +ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL + fi + + echo + echo '[Entrypoint] MySQL init process done. Ready for start up.' + echo + fi + + # Used by healthcheck to make sure it doesn't mistakenly report container + # healthy during startup + # Put the password into the temporary config file + touch /var/lib/mysql-files/healthcheck.cnf + cat >"/var/lib/mysql-files/healthcheck.cnf" < Date: Wed, 7 Jun 2023 07:14:01 +0200 Subject: [PATCH 309/386] ET#77928 - Add Docker cluster pipeline for 8.1 Change-Id: Ic2218e6a1e95d1c592faf8b3d15b7d7532c4d374 --- mysql-cluster/VERSION | 18 +++-- mysql-cluster/build.sh | 4 +- mysql-cluster/gen_dockerfiles.sh | 122 ++++++++++++++++++------------ mysql-cluster/tag.sh | 10 ++- mysql-cluster/template/control.rb | 2 +- mysql-cluster/test.sh | 2 +- 6 files changed, 95 insertions(+), 63 deletions(-) diff --git a/mysql-cluster/VERSION b/mysql-cluster/VERSION index 84a6496c0..6942f7cf1 100644 --- a/mysql-cluster/VERSION +++ b/mysql-cluster/VERSION @@ -1,18 +1,22 @@ IMAGE_VERSION=1.2.12-cluster declare -A MYSQL_CLUSTER_VERSIONS -MYSQL_CLUSTER_VERSIONS["7.5"]=7.5.30 -MYSQL_CLUSTER_VERSIONS["7.6"]=7.6.26 -MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.33 +MYSQL_CLUSTER_VERSIONS["7.5"]=7.5.31 +MYSQL_CLUSTER_VERSIONS["7.6"]=7.6.27 +MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.34 +MYSQL_CLUSTER_VERSIONS["8.1"]=8.1.0 declare -A MYSQL_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["7.5"]=8.0.33 -MYSQL_SHELL_VERSIONS["7.6"]=8.0.33 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.33 +MYSQL_SHELL_VERSIONS["7.5"]=8.0.34 +MYSQL_SHELL_VERSIONS["7.6"]=8.0.34 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.34 +MYSQL_SHELL_VERSIONS["8.1"]=8.1.0 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["7.5"]="${MYSQL_CLUSTER_VERSIONS["7.5"]}-${IMAGE_VERSION}" FULL_SERVER_VERSIONS["7.6"]="${MYSQL_CLUSTER_VERSIONS["7.6"]}-${IMAGE_VERSION}" FULL_SERVER_VERSIONS["8.0"]="${MYSQL_CLUSTER_VERSIONS["8.0"]}-${IMAGE_VERSION}" +FULL_SERVER_VERSIONS["8.1"]="${MYSQL_CLUSTER_VERSIONS["8.1"]}-${IMAGE_VERSION}" -LATEST="8.0" +LATEST="8.1" +LATEST_INNOVATION="8.1" diff --git a/mysql-cluster/build.sh b/mysql-cluster/build.sh index 039c8a62b..637aea955 100755 --- a/mysql-cluster/build.sh +++ b/mysql-cluster/build.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -14,7 +14,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -source VERSION +source ./VERSION MAJOR_VERSIONS=("${!MYSQL_CLUSTER_VERSIONS[@]}"); [ -n "$1" ] && MAJOR_VERSIONS=("${@:1}") diff --git a/mysql-cluster/gen_dockerfiles.sh b/mysql-cluster/gen_dockerfiles.sh index 063821218..56979a5a2 100755 --- a/mysql-cluster/gen_dockerfiles.sh +++ b/mysql-cluster/gen_dockerfiles.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2017, 2021, Oracle and/or its affiliates. +# Copyright (c) 2017, 2023, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -22,35 +22,40 @@ set -e source ./VERSION REPO=https://repo.mysql.com; [ -n "$1" ] && REPO=$1 -CONFIG_PACKAGE_NAME=mysql80-community-release-el8.rpm; [ -n "$2" ] && CONFIG_PACKAGE_NAME=$2 -CONFIG_PACKAGE_NAME_MINIMAL=mysql-cluster-community-minimal-release-el8.rpm; [ -n "$3" ] && CONFIG_PACKAGE_NAME_MINIMAL=$3 +MYSQL_VERSION=""; [ -n "$2" ] && MYSQL_VERSION=$2 +SHELL_VERSION=""; [ -n "$3" ] && SHELL_VERSION=$3 +CONFIG_PACKAGE_NAME=mysql80-community-release-el8.rpm; [ -n "$4" ] && CONFIG_PACKAGE_NAME=$4 +CONFIG_PACKAGE_NAME_MINIMAL=mysql-cluster-community-minimal-release-el8.rpm; [ -n "$5" ] && CONFIG_PACKAGE_NAME_MINIMAL=$5 -REPO_NAME_SERVER=mysql-cluster80-community-minimal; [ -n "$4" ] && REPO_NAME_SERVER=$4 -REPO_NAME_TOOLS=mysql-tools-community; [ -n "$5" ] && REPO_NAME_TOOLS=$5 +REPO_NAME_SERVER=mysql-cluster80-community-minimal; [ -n "$6" ] && REPO_NAME_SERVER=$6 +REPO_NAME_TOOLS=mysql-tools-community; [ -n "$7" ] && REPO_NAME_TOOLS=$7 -MYSQL_SERVER_PACKAGE_NAME="mysql-cluster-community-server-minimal"; [ -n "$6" ] && MYSQL_SERVER_PACKAGE_NAME=$6 -MYSQL_SHELL_PACKAGE_NAME="mysql-shell"; [ -n "$7" ] && MYSQL_SHELL_PACKAGE_NAME=$7 -MYSQL_VERSION=""; [ -n "$8" ] && MYSQL_VERSION=$8 +MYSQL_SERVER_PACKAGE_NAME="mysql-cluster-community-server-minimal"; [ -n "$8" ] && MYSQL_SERVER_PACKAGE_NAME=$8 +MYSQL_SHELL_PACKAGE_NAME="mysql-shell"; [ -n "$9" ] && MYSQL_SHELL_PACKAGE_NAME=$9 declare -A PORTS PORTS["7.5"]="3306 33060 2202 1186" PORTS["7.6"]="3306 33060 2202 1186" PORTS["8.0"]="3306 33060-33061 2202 1186" +PORTS["$LATEST_INNOVATION"]="3306 33060-33061 2202 1186" declare -A PASSWORDSET PASSWORDSET["7.5"]="ALTER USER 'root'@'localhost' IDENTIFIED BY '\${MYSQL_ROOT_PASSWORD}';" PASSWORDSET["7.6"]=${PASSWORDSET["7.5"]} PASSWORDSET["8.0"]=${PASSWORDSET["7.6"]} +PASSWORDSET["$LATEST_INNOVATION"]=${PASSWORDSET["7.6"]} declare -A DATABASE_INIT DATABASE_INIT["7.5"]="\"\$@\" --user=\$MYSQLD_USER --initialize-insecure" DATABASE_INIT["7.6"]="\"\$@\" --user=\$MYSQLD_USER --initialize-insecure" DATABASE_INIT["8.0"]="\"\$@\" --user=\$MYSQLD_USER --initialize-insecure" +DATABASE_INIT["$LATEST_INNOVATION"]="\"\$@\" --user=\$MYSQLD_USER --initialize-insecure" declare -A STARTUP STARTUP["7.5"]="exec \"\$@\" --user=\$MYSQLD_USER" STARTUP["7.6"]="exec \"\$@\" --user=\$MYSQLD_USER" STARTUP["8.0"]="export MYSQLD_PARENT_PID=\$\$ ; exec \"\$@\" --user=$MYSQLD_USER" +STARTUP["$LATEST_INNOVATION"]="export MYSQLD_PARENT_PID=\$\$ ; exec \"\$@\" --user=$MYSQLD_USER" declare -A STARTUP_WAIT @@ -64,76 +69,97 @@ declare -A VALIDATE_CONFIG VALIDATE_CONFIG["7.5"]="output=\$(\"\$@\" --verbose --help 2>\&1 > /dev/null) || result=\$?" VALIDATE_CONFIG["7.6"]="output=\$(\"\$@\" --verbose --help 2>\&1 > /dev/null) || result=\$?" VALIDATE_CONFIG["8.0"]="output=\$(\"\$@\" --validate-config) || result=\$?" +VALIDATE_CONFIG["$LATEST_INNOVATION"]="output=\$(\"\$@\" --validate-config) || result=\$?" # Data directories that must be created with special ownership and permissions when the image is built declare -A PRECREATE_DIRS PRECREATE_DIRS["7.5"]="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" PRECREATE_DIRS["7.6"]="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" PRECREATE_DIRS["8.0"]="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" +PRECREATE_DIRS["$LATEST_INNOVATION"]="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" + +process_version() { + MAJOR_VERSION=$1 + MYSQL_SERVER_PACKAGE=${MYSQL_SERVER_PACKAGE_NAME}${SERVER_PKG_SUFFIX} + MYSQL_SHELL_PACKAGE=${MYSQL_SHELL_PACKAGE_NAME}${SHELL_PKG_SUFFIX} -for VERSION in "${!MYSQL_CLUSTER_VERSIONS[@]}" -do - if [ -n "${MYSQL_VERSION}" ]; then - MYSQL_SERVER_PACKAGE=${MYSQL_SERVER_PACKAGE_NAME}-${MYSQL_VERSION} - MYSQL_SHELL_PACKAGE=${MYSQL_SHELL_PACKAGE_NAME}-${MYSQL_VERSION} - else - MYSQL_SERVER_PACKAGE=${MYSQL_SERVER_PACKAGE_NAME} - MYSQL_SHELL_PACKAGE=${MYSQL_SHELL_PACKAGE_NAME} - fi # Dockerfiles - MYSQL_SERVER_REPOPATH=yum/mysql-$VERSION-community/docker/x86_64 DOCKERFILE_TEMPLATE=template/Dockerfile - if [ "${VERSION}" != "8.0" ]; then + if [[ "${MAJOR_VERSION}" =~ 7\.(5|6) ]]; then DOCKERFILE_TEMPLATE=template/Dockerfile-pre8 fi + + # Dockerfile_spec.rb + if [ ! -d "${MAJOR_VERSION}" ]; then + mkdir "${MAJOR_VERSION}" + fi + sed 's#%%MYSQL_SERVER_PACKAGE%%#'"${MYSQL_SERVER_PACKAGE}"'#g' $DOCKERFILE_TEMPLATE > tmpfile sed -i 's#%%REPO%%#'"${REPO}"'#g' tmpfile - REPO_VERSION=${VERSION//\./} + REPO_VERSION=${MAJOR_VERSION//\./} sed -i 's#%%REPO_VERSION%%#'"${REPO_VERSION}"'#g' tmpfile sed -i 's#%%CONFIG_PACKAGE_NAME%%#'"${CONFIG_PACKAGE_NAME}"'#g' tmpfile sed -i 's#%%CONFIG_PACKAGE_NAME_MINIMAL%%#'"${CONFIG_PACKAGE_NAME_MINIMAL}"'#g' tmpfile sed -i 's#%%REPO_NAME_SERVER%%#'"${REPO_NAME_SERVER}"'#g' tmpfile sed -i 's#%%REPO_NAME_TOOLS%%#'"${REPO_NAME_TOOLS}"'#g' tmpfile - - if [[ ! -z ${MYSQL_SHELL_VERSIONS[${VERSION}]} ]]; then - sed -i 's#%%MYSQL_SHELL_PACKAGE%%#'"${MYSQL_SHELL_PACKAGE}"'#g' tmpfile - else - sed -i 's#%%MYSQL_SHELL_PACKAGE%%#'""'#g' tmpfile - fi - - sed -i 's/%%PORTS%%/'"${PORTS[${VERSION}]}"'/g' tmpfile - mv tmpfile ${VERSION}/Dockerfile + sed -i 's#%%MYSQL_SHELL_PACKAGE%%#'"${MYSQL_SHELL_PACKAGE}"'#g' tmpfile + sed -i 's/%%PORTS%%/'"${PORTS[${MAJOR_VERSION}]}"'/g' tmpfile + mv tmpfile ${MAJOR_VERSION}/Dockerfile # Dockerfile_spec.rb - if [ ! -d "${VERSION}/inspec" ]; then - mkdir "${VERSION}/inspec" + if [ ! -d "${MAJOR_VERSION}/inspec" ]; then + mkdir "${MAJOR_VERSION}/inspec" fi + sed 's#%%MYSQL_VERSION%%#'"${MYSQL_VERSION}"'#g' template/control.rb > tmpFile sed -i 's#%%MYSQL_SERVER_PACKAGE_NAME%%#'"${MYSQL_SERVER_PACKAGE_NAME}"'#g' tmpFile sed -i 's#%%MYSQL_SHELL_PACKAGE_NAME%%#'"${MYSQL_SHELL_PACKAGE_NAME}"'#g' tmpFile - sed -i 's#%%MAJOR_VERSION%%#'"${VERSION}"'#g' tmpFile - if [ "${VERSION}" == "8.0" ]; then - sed -i 's#%%PORTS%%#'"1186/tcp, 2202/tcp, 3306/tcp, 33060-33061/tcp"'#g' tmpFile - else + + sed -i 's#%%MAJOR_VERSION%%#'"${MAJOR_VERSION}"'#g' tmpFile + sed -i 's#%%MYSQL_SHELL_VERSION%%#'"${SHELL_VERSION}"'#g' tmpFile + + if [[ "${MAJOR_VERSION}" =~ 7\.(5|6) ]]; then sed -i 's#%%PORTS%%#'"1186/tcp, 2202/tcp, 3306/tcp, 33060/tcp"'#g' tmpFile + else + sed -i 's#%%PORTS%%#'"1186/tcp, 2202/tcp, 3306/tcp, 33060-33061/tcp"'#g' tmpFile fi - mv tmpFile "${VERSION}/inspec/control.rb" + mv tmpFile "${MAJOR_VERSION}/inspec/control.rb" # Entrypoint - sed 's#%%PASSWORDSET%%#'"${PASSWORDSET[${VERSION}]}"'#g' template/docker-entrypoint.sh > tmpfile - sed -i 's#%%STARTUP%%#'"${STARTUP[${VERSION}]}"'#g' tmpfile - sed -i 's#%%FULL_SERVER_VERSION%%#'"${FULL_SERVER_VERSIONS[${VERSION}]}"'#g' tmpfile - sed -i 's#%%VALIDATE_CONFIG%%#'"${VALIDATE_CONFIG[${VERSION}]}"'#g' tmpfile - mv tmpfile ${VERSION}/docker-entrypoint.sh - chmod +x ${VERSION}/docker-entrypoint.sh + sed 's#%%PASSWORDSET%%#'"${PASSWORDSET[${MAJOR_VERSION}]}"'#g' template/docker-entrypoint.sh > tmpfile + sed -i 's#%%STARTUP%%#'"${STARTUP[${MAJOR_VERSION}]}"'#g' tmpfile + sed -i 's#%%FULL_SERVER_VERSION%%#'"${FULL_SERVER_VERSIONS[${MAJOR_VERSION}]}"'#g' tmpfile + sed -i 's#%%VALIDATE_CONFIG%%#'"${VALIDATE_CONFIG[${MAJOR_VERSION}]}"'#g' tmpfile + mv tmpfile ${MAJOR_VERSION}/docker-entrypoint.sh + chmod +x ${MAJOR_VERSION}/docker-entrypoint.sh # Healthcheck - cp template/healthcheck.sh ${VERSION}/ - chmod +x ${VERSION}/healthcheck.sh + cp template/healthcheck.sh ${MAJOR_VERSION}/ + chmod +x ${MAJOR_VERSION}/healthcheck.sh # Build-time preparation script - sed 's#%%PRECREATE_DIRS%%#'"${PRECREATE_DIRS[${VERSION}]}"'#g' template/prepare-image.sh > tmpfile - mv tmpfile ${VERSION}/prepare-image.sh - chmod +x ${VERSION}/prepare-image.sh -done + sed 's#%%PRECREATE_DIRS%%#'"${PRECREATE_DIRS[${MAJOR_VERSION}]}"'#g' template/prepare-image.sh > tmpfile + mv tmpfile ${MAJOR_VERSION}/prepare-image.sh + chmod +x ${MAJOR_VERSION}/prepare-image.sh + + # Copy cnf files + cp -r template/cnf ${MAJOR_VERSION}/ +} + +if [ -n "$MYSQL_VERSION" ]; then + MAJOR_VERSION=$(echo $MYSQL_VERSION | cut -d'.' -f'1,2') + SERVER_PKG_SUFFIX="-${MYSQL_VERSION}" + SHELL_PKG_SUFFIX="-${SHELL_VERSION}" + process_version $MAJOR_VERSION +else + for MAJOR_VERSION in "${!MYSQL_CLUSTER_VERSIONS[@]}" + do + SHELL_VERSION="${MYSQL_SHELL_VERSIONS[$MAJOR_VERSION]}" + SHELL_PKG_SUFFIX="-${SHELL_VERSION}" + SERVER_PKG_SUFFIX="-${MYSQL_CLUSTER_VERSIONS[$MAJOR_VERSION]}" + + process_version $MAJOR_VERSION + done +fi + diff --git a/mysql-cluster/tag.sh b/mysql-cluster/tag.sh index 77d9965c4..ada5bdb79 100755 --- a/mysql-cluster/tag.sh +++ b/mysql-cluster/tag.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,9 +19,11 @@ source VERSION MAJOR_VERSIONS=("${!MYSQL_CLUSTER_VERSIONS[@]}"); [ -n "$1" ] && MAJOR_VERSIONS=("${@:1}") for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do + TAGS="$MAJOR_VERSION ${MYSQL_CLUSTER_VERSIONS[$MAJOR_VERSION]} ${FULL_SERVER_VERSIONS[$MAJOR_VERSION]}" + if [ "$MAJOR_VERSION" = "$LATEST" ]; then - echo "$MAJOR_VERSION ${MYSQL_CLUSTER_VERSIONS["$MAJOR_VERSION"]} latest" - else - echo "$MAJOR_VERSION ${MYSQL_CLUSTER_VERSIONS["$MAJOR_VERSION"]}" + TAGS="latest $TAGS" fi + + echo $TAGS done diff --git a/mysql-cluster/template/control.rb b/mysql-cluster/template/control.rb index 5f9d77675..9582baf4b 100644 --- a/mysql-cluster/template/control.rb +++ b/mysql-cluster/template/control.rb @@ -15,6 +15,6 @@ end describe package('%%MYSQL_SHELL_PACKAGE_NAME%%') do it { should be_installed } - its ('version') { should match '%%MYSQL_VERSION%%.*' } + its ('version') { should match '%%MYSQL_SHELL_VERSION%%.*' } end end diff --git a/mysql-cluster/test.sh b/mysql-cluster/test.sh index 827d62e8b..5ea6a0122 100755 --- a/mysql-cluster/test.sh +++ b/mysql-cluster/test.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by From db90f90eed1fdcb72c59b543bf9db9b00b269bcc Mon Sep 17 00:00:00 2001 From: Nawaz Nazeer Ahamed Date: Wed, 7 Jun 2023 22:09:32 +0200 Subject: [PATCH 310/386] ET#78138 - [Docker] Add support for 8.1 in Docker router & Server Change-Id: I7ba07efc3e5d5e434a79cf3650f17d9a40a88655 --- mysql-router/VERSION | 19 +- mysql-router/build.sh | 3 +- mysql-router/gen_dockerfiles.sh | 22 +- mysql-router/manifest.sh | 17 +- mysql-router/tag.sh | 14 +- mysql-router/test.sh | 24 +- mysql-server/VERSION | 12 +- mysql-server/build.sh | 9 +- mysql-server/gen_dockerfiles.sh | 65 +++--- mysql-server/innovation/Dockerfile | 44 ---- mysql-server/innovation/docker-entrypoint.sh | 230 ------------------- mysql-server/innovation/healthcheck.sh | 24 -- mysql-server/innovation/inspec/control.rb | 20 -- mysql-server/innovation/prepare-image.sh | 25 -- mysql-server/manifest.sh | 3 +- mysql-server/tag.sh | 3 - mysql-server/test.sh | 14 +- 17 files changed, 97 insertions(+), 451 deletions(-) delete mode 100644 mysql-server/innovation/Dockerfile delete mode 100755 mysql-server/innovation/docker-entrypoint.sh delete mode 100755 mysql-server/innovation/healthcheck.sh delete mode 100644 mysql-server/innovation/inspec/control.rb delete mode 100755 mysql-server/innovation/prepare-image.sh diff --git a/mysql-router/VERSION b/mysql-router/VERSION index e4f327024..10f8714cf 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -1,11 +1,18 @@ IMAGE_VERSION=1.0.12-router declare -A MYSQL_ROUTER_VERSIONS WEEKLY_ROUTER_VERSIONS -MYSQL_ROUTER_VERSIONS["8.0"]=8.0.33 -WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.34 +MYSQL_ROUTER_VERSIONS["8.0"]=8.0.34 +MYSQL_ROUTER_VERSIONS["8.1"]=8.1.0 + +WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.35 +WEEKLY_ROUTER_VERSIONS["8.2"]=8.2.0 declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["8.0"]=8.0.33 -WEEKLY_SERVER_VERSIONS["8.0"]=8.0.34 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.34 +MYSQL_SERVER_VERSIONS["8.1"]=8.1.0 + +WEEKLY_SERVER_VERSIONS["8.0"]=8.0.35 +WEEKLY_SERVER_VERSIONS["8.2"]=8.2.0 -MULTIARCH_VERSIONS="8.0" -LATEST="8.0" +MULTIARCH_VERSIONS=("8.0" "8.1") +LATEST="8.1" +LATEST_INNOVATION="8.1" diff --git a/mysql-router/build.sh b/mysql-router/build.sh index daad43e74..c79816235 100755 --- a/mysql-router/build.sh +++ b/mysql-router/build.sh @@ -17,7 +17,8 @@ set -e source ./VERSION ARCH=amd64; [ -n "$1" ] && ARCH=$1 +MAJOR_VERSIONS=("${!MYSQL_ROUTER_VERSIONS[@]}"); [ -n "$2" ] && MAJOR_VERSIONS=("${@:2}") -for MAJOR_VERSION in "${!MYSQL_ROUTER_VERSIONS[@]}"; do +for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$http_proxy --build-arg no_proxy=$no_proxy -t mysql/mysql-router:$MAJOR_VERSION-$ARCH $MAJOR_VERSION done diff --git a/mysql-router/gen_dockerfiles.sh b/mysql-router/gen_dockerfiles.sh index d0a6521d2..5071f585e 100755 --- a/mysql-router/gen_dockerfiles.sh +++ b/mysql-router/gen_dockerfiles.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -x set -e source ./VERSION @@ -13,16 +14,26 @@ REPO_NAME_SERVER=mysql80-community; [ -n "$7" ] && REPO_NAME_SERVER=$7 REPO_NAME_TOOLS=mysql-tools-community; [ -n "$8" ] && REPO_NAME_TOOLS=$8 MAJOR_VERSION=$(echo $MYSQL_CLIENT_VERSION | cut -d'.' -f'1,2') + MYSQL_CLIENT_PACKAGE=$MYSQL_CLIENT_PACKAGE_NAME-$MYSQL_CLIENT_VERSION MYSQL_ROUTER_PACKAGE=$MYSQL_ROUTER_PACKAGE_NAME-$MYSQL_ROUTER_VERSION +echo "In the place" +echo `ls` +if [ ! -d "${MAJOR_VERSION}" ]; then + mkdir -p "${MAJOR_VERSION}/inspec" +fi +echo `ls -lrt` +echo 'inside 8.1' +echo `ls -lrt 8.1` + sed 's#%%MYSQL_CLIENT_PACKAGE%%#'"${MYSQL_CLIENT_PACKAGE}"'#g' template/Dockerfile > tmpFile sed -i 's#%%MYSQL_ROUTER_PACKAGE%%#'"${MYSQL_ROUTER_PACKAGE}"'#g' tmpFile sed -i 's#%%CONFIG_PACKAGE_NAME%%#'"${CONFIG_PACKAGE_NAME}"'#g' tmpFile sed -i 's#%%REPO%%#'"${REPO}"'#g' tmpFile sed -i 's#%%REPO_NAME_SERVER%%#'"${REPO_NAME_SERVER}"'#g' tmpFile sed -i 's#%%REPO_NAME_TOOLS%%#'"${REPO_NAME_TOOLS}"'#g' tmpFile -mv tmpFile $MAJOR_VERSION/Dockerfile +mv tmpFile ${MAJOR_VERSION}/Dockerfile # update test template sed -e 's#%%MYSQL_CLIENT_PACKAGE_NAME%%#'"${MYSQL_CLIENT_PACKAGE_NAME}"'#g' template/control.rb > tmpFile @@ -30,13 +41,10 @@ sed -i -e 's#%%MYSQL_CLIENT_VERSION%%#'"${MYSQL_CLIENT_VERSION}"'#g' tmpFile sed -i -e 's#%%MYSQL_ROUTER_PACKAGE_NAME%%#'"${MYSQL_ROUTER_PACKAGE_NAME}"'#g' tmpFile sed -i -e 's#%%MYSQL_ROUTER_VERSION%%#'"${MYSQL_ROUTER_VERSION}"'#g' tmpFile sed -i -e 's#%%MAJOR_VERSION%%#'"${MAJOR_VERSION}"'#g' tmpFile -if [ ! -d "${MAJOR_VERSION}/inspec" ]; then - mkdir "${MAJOR_VERSION}/inspec" -fi mv tmpFile "${MAJOR_VERSION}/inspec/control.rb" # copy entrypoint script -cp template/run.sh $MAJOR_VERSION/run.sh -chmod +x $MAJOR_VERSION/run.sh +cp template/run.sh ${MAJOR_VERSION}/run.sh +chmod +x ${MAJOR_VERSION}/run.sh -cp README.md $MAJOR_VERSION/ +cp README.md ${MAJOR_VERSION}/ diff --git a/mysql-router/manifest.sh b/mysql-router/manifest.sh index fe69eb1d8..25b8da87d 100755 --- a/mysql-router/manifest.sh +++ b/mysql-router/manifest.sh @@ -25,6 +25,7 @@ if grep -q Microsoft /proc/version; then fi REPO=mysql/mysql-router; [ -n "$1" ] && REPO=$1 +MAJOR_VERSIONS=("${!MYSQL_SERVER_VERSIONS[@]}"); [ -n "$2" ] && MAJOR_VERSIONS=("${@:2}") WEEKLY=0 @@ -32,13 +33,11 @@ if [[ "$REPO" =~ (weekly) ]]; then WEEKLY=1 fi -for MAJOR_VERSION in ${MULTIARCH_VERSIONS}; do - MANIFEST_VERSIONS=$(./tag.sh "" "$MAJOR_VERSION" "$WEEKLY") - for MANIFEST_VERSION in $MANIFEST_VERSIONS; do - docker pull "$REPO:$MANIFEST_VERSION-arm64" "$REPO:$MANIFEST_VERSION-amd64" - docker manifest create "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-arm64" "$REPO:$MANIFEST_VERSION-amd64" - docker manifest add "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-arm64" --os linux --arch arm64 - docker manifest add "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-amd64" --os linux --arch amd64 - docker manifest push "$REPO:$MANIFEST_VERSION" "docker://$REPO:$MANIFEST_VERSION" - done +MANIFEST_VERSIONS=$(./tag.sh "" "$MAJOR_VERSIONS" "$WEEKLY") +for MANIFEST_VERSION in $MANIFEST_VERSIONS; do + docker pull "$REPO:$MANIFEST_VERSION-arm64" "$REPO:$MANIFEST_VERSION-amd64" + docker manifest create "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-arm64" "$REPO:$MANIFEST_VERSION-amd64" + docker manifest add "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-arm64" --os linux --arch arm64 + docker manifest add "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-amd64" --os linux --arch amd64 + docker manifest push "$REPO:$MANIFEST_VERSION" "docker://$REPO:$MANIFEST_VERSION" done diff --git a/mysql-router/tag.sh b/mysql-router/tag.sh index d3ee4314d..36526657e 100755 --- a/mysql-router/tag.sh +++ b/mysql-router/tag.sh @@ -9,14 +9,14 @@ MAJOR_VERSIONS=("${!MYSQL_ROUTER_VERSIONS[@]}"); [ -n "$2" ] && MAJOR_VERSIONS=( WEEKLY='' [ -n "$3" ] && WEEKLY=$3 for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do - for MULTIARCH_VERSION in ${MULTIARCH_VERSIONS}; do + for MULTIARCH_VERSION in "${MULTIARCH_VERSIONS[@]}"; do + if [ "$WEEKLY" == "1" ]; then + ROUTER_VERSION=${WEEKLY_ROUTER_VERSIONS["${MAJOR_VERSION}"]} + else + ROUTER_VERSION=${MYSQL_ROUTER_VERSIONS["${MAJOR_VERSION}"]} + fi + FULL_ROUTER_VERSION="${ROUTER_VERSION}-${IMAGE_VERSION}" if [[ "$MULTIARCH_VERSION" == "$MAJOR_VERSION" ]]; then - if [ "$WEEKLY" == "1" ]; then - ROUTER_VERSION=${WEEKLY_ROUTER_VERSIONS["${MAJOR_VERSION}"]} - else - ROUTER_VERSION=${MYSQL_ROUTER_VERSIONS["${MAJOR_VERSION}"]} - fi - FULL_ROUTER_VERSION="${ROUTER_VERSION}-${IMAGE_VERSION}" TAGS="${MAJOR_VERSION}${SUFFIX} ${ROUTER_VERSION}${SUFFIX} ${FULL_ROUTER_VERSION}${SUFFIX}" if [[ "$MAJOR_VERSION" == "$LATEST" ]]; then TAGS="$TAGS latest${SUFFIX}" diff --git a/mysql-router/test.sh b/mysql-router/test.sh index 6d518ed35..ae01fc845 100755 --- a/mysql-router/test.sh +++ b/mysql-router/test.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2018, 2021, Oracle and/or its affiliates. +# Copyright (c) 2018, 2023, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,16 +21,16 @@ set -e source ./VERSION ARCH=amd64; [ -n "$1" ] && ARCH=$1 +MAJOR_VERSIONS=("${!MYSQL_SERVER_VERSIONS[@]}"); [ -n "$2" ] && MAJOR_VERSIONS=("${@:2}") -for MAJOR_VERSION in "${!MYSQL_ROUTER_VERSIONS[@]}" -do - podman run -d --rm -e MYSQL_HOST=x -e MYSQL_PORT=9 -e MYSQL_USER=x -e MYSQL_PASSWORD=x -e MYSQL_INNODB_CLUSTER_MEMBERS=1 --name "mysql-router-$MAJOR_VERSION" mysql/mysql-router:$MAJOR_VERSION-$ARCH sleep 5000 - export DOCKER_HOST=unix:///tmp/podman.sock - podman system service --time=0 ${DOCKER_HOST} & DOCKER_SOCK_PID="$!" - inspec exec $MAJOR_VERSION/inspec/control.rb --controls container - inspec exec $MAJOR_VERSION/inspec/control.rb -t "docker://mysql-router-$MAJOR_VERSION" --controls packages - podman stop -i "mysql-router-$MAJOR_VERSION" - podman rm -i -f "mysql-router-$MAJOR_VERSION" - kill -TERM ${DOCKER_SOCK_PID} - rm -f /tmp/podman.sock +for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do + podman run -d --rm -e MYSQL_HOST=x -e MYSQL_PORT=9 -e MYSQL_USER=x -e MYSQL_PASSWORD=x -e MYSQL_INNODB_CLUSTER_MEMBERS=1 --name "mysql-router-$MAJOR_VERSION" mysql/mysql-router:$MAJOR_VERSION-$ARCH sleep 5000 + export DOCKER_HOST=unix:///tmp/podman.sock + podman system service --time=0 ${DOCKER_HOST} & DOCKER_SOCK_PID="$!" + inspec exec $MAJOR_VERSION/inspec/control.rb --controls container + inspec exec $MAJOR_VERSION/inspec/control.rb -t "docker://mysql-router-$MAJOR_VERSION" --controls packages + podman stop -i "mysql-router-$MAJOR_VERSION" + podman rm -i -f "mysql-router-$MAJOR_VERSION" + kill -TERM ${DOCKER_SOCK_PID} + rm -f /tmp/podman.sock done diff --git a/mysql-server/VERSION b/mysql-server/VERSION index da7d7cc29..f020050ea 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -3,22 +3,22 @@ IMAGE_VERSION=1.2.12-server declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["5.7"]=5.7.43 MYSQL_SERVER_VERSIONS["8.0"]=8.0.34 -MYSQL_SERVER_VERSIONS["innovation"]=8.1.0 +MYSQL_SERVER_VERSIONS["8.1"]=8.1.0 WEEKLY_SERVER_VERSIONS["5.7"]=5.7.44 WEEKLY_SERVER_VERSIONS["8.0"]=8.0.35 -WEEKLY_SERVER_VERSIONS["innovation_next"]=8.2.0 +WEEKLY_SERVER_VERSIONS["8.2"]=8.2.0 declare -A MYSQL_SHELL_VERSIONS WEEKLY_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["5.7"]=8.0.34 MYSQL_SHELL_VERSIONS["8.0"]=8.0.34 -MYSQL_SHELL_VERSIONS["innovation"]=8.1.0 +MYSQL_SHELL_VERSIONS["8.1"]=8.1.0 WEEKLY_SHELL_VERSIONS["5.7"]=8.0.35 WEEKLY_SHELL_VERSIONS["8.0"]=8.0.35 -WEEKLY_SHELL_VERSIONS["innovation_next"]=8.2.0 +WEEKLY_SHELL_VERSIONS["8.2"]=8.2.0 -MULTIARCH_VERSIONS=("8.0" "innovation") +MULTIARCH_VERSIONS=("8.0" "8.1") SINGLEARCH_VERSIONS="5.7" -LATEST="8.0" +LATEST="8.1" LATEST_INNOVATION="8.1" diff --git a/mysql-server/build.sh b/mysql-server/build.sh index 5b10eac4b..6338ad0fa 100755 --- a/mysql-server/build.sh +++ b/mysql-server/build.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2023 Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -37,12 +37,7 @@ fi for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do for MULTIARCH_VERSION in "${MULTIARCH_VERSIONS[@]}"; do if [[ "$MULTIARCH_VERSION" == "$MAJOR_VERSION" ]]; then - if [[ "$MAJOR_VERSION" == "innovation" ]]; then - VERSION=${LATEST_INNOVATION} - docker build --build-arg http_proxy="$http_proxy" --build-arg https_proxy="$http_proxy" --build-arg no_proxy="$no_proxy" -t $IMG_LOC:"$VERSION"-$ARCH "$MAJOR_VERSION" - else - docker build --build-arg http_proxy="$http_proxy" --build-arg https_proxy="$http_proxy" --build-arg no_proxy="$no_proxy" -t $IMG_LOC:"$MAJOR_VERSION"-$ARCH "$MAJOR_VERSION" - fi + docker build --build-arg http_proxy="$http_proxy" --build-arg https_proxy="$http_proxy" --build-arg no_proxy="$no_proxy" -t $IMG_LOC:"$MAJOR_VERSION"-$ARCH "$MAJOR_VERSION" fi done for SINGLEARCH_VERSION in $SINGLEARCH_VERSIONS; do diff --git a/mysql-server/gen_dockerfiles.sh b/mysql-server/gen_dockerfiles.sh index 6fb956be1..331009313 100755 --- a/mysql-server/gen_dockerfiles.sh +++ b/mysql-server/gen_dockerfiles.sh @@ -44,55 +44,53 @@ fi declare -A PORTS PORTS["5.7"]="3306 33060" PORTS["8.0"]="3306 33060 33061" -PORTS["innovation"]="3306 33060 33061" +PORTS["$LATEST_INNOVATION"]="3306 33060 33061" declare -A PASSWORDSET PASSWORDSET["5.7"]="ALTER USER 'root'@'localhost' IDENTIFIED BY '\${MYSQL_ROOT_PASSWORD}';" PASSWORDSET["8.0"]=${PASSWORDSET["5.7"]} -PASSWORDSET["innovation"]=${PASSWORDSET["8.0"]} +PASSWORDSET["$LATEST_INNOVATION"]=${PASSWORDSET["8.0"]} # MySQL 8.0 supports a call to validate the config, while older versions have it as a side # effect of running --verbose --help declare -A VALIDATE_CONFIG VALIDATE_CONFIG["5.7"]="output=\$(\"\$@\" --verbose --help 2>\&1 > /dev/null) || result=\$?" VALIDATE_CONFIG["8.0"]="output=\$(\"\$@\" --validate-config) || result=\$?" -VALIDATE_CONFIG["innovation"]="output=\$(\"\$@\" --validate-config) || result=\$?" +VALIDATE_CONFIG["$LATEST_INNOVATION"]="output=\$(\"\$@\" --validate-config) || result=\$?" # Data directories that must be created with special ownership and permissions when the image is built declare -A PRECREATE_DIRS PRECREATE_DIRS["5.7"]="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" PRECREATE_DIRS["8.0"]="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" -PRECREATE_DIRS["innovation"]="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" +PRECREATE_DIRS["$LATEST_INNOVATION"]="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" declare -A DOCKERFILE_TEMPLATES DOCKERFILE_TEMPLATES["5.7"]="template/Dockerfile-pre8" DOCKERFILE_TEMPLATES["8.0"]="template/Dockerfile" -DOCKERFILE_TEMPLATES["innovation"]="template/Dockerfile" +DOCKERFILE_TEMPLATES["$LATEST_INNOVATION"]="template/Dockerfile" declare -A SPEC_PORTS SPEC_PORTS["5.7"]="3306/tcp, 33060/tcp" SPEC_PORTS["8.0"]="3306/tcp, 33060-33061/tcp" -SPEC_PORTS["innovation"]="3306/tcp, 33060-33061/tcp" +SPEC_PORTS["$LATEST_INNOVATION"]="3306/tcp, 33060-33061/tcp" # Get the Major Version -VERSION=$(echo $MYSQL_VERSION | cut -d'.' -f'1,2') -if [[ $(awk -v ver="$VERSION" 'BEGIN{ if (ver >= 8.1) print "true" }') == "true" ]]; then - VERSION="innovation" +MAJOR_VERSION=$(echo $MYSQL_VERSION | cut -d'.' -f'1,2') +if [[ $(awk -v ver="$MAJOR_VERSION" 'BEGIN{ if (ver >= 8.1) print "true" }') == "true" ]]; then + REPO_PATH="innovation" +fi + +if [ ! -d "${MAJOR_VERSION}" ]; then + mkdir -p "${MAJOR_VERSION}/inspec" fi MYSQL_SERVER_PACKAGE=${MYSQL_SERVER_PACKAGE_NAME}-${MYSQL_VERSION} MYSQL_SHELL_PACKAGE=${MYSQL_SHELL_PACKAGE_NAME}-${SHELL_VERSION} # Dockerfiles -MYSQL_SERVER_REPOPATH=yum/mysql-$VERSION-community/docker/x86_64 - -sed 's#%%MYSQL_SERVER_PACKAGE%%#'"${MYSQL_SERVER_PACKAGE}"'#g' ${DOCKERFILE_TEMPLATES[${VERSION}]} > tmpfile +sed 's#%%MYSQL_SERVER_PACKAGE%%#'"${MYSQL_SERVER_PACKAGE}"'#g' ${DOCKERFILE_TEMPLATES[${MAJOR_VERSION}]} > tmpfile sed -i 's#%%REPO%%#'"${REPO}"'#g' tmpfile - -REPO_VERSION=${VERSION//\./} -sed -i 's#%%REPO_VERSION%%#'"${REPO_VERSION}"'#g' tmpfile - sed -i 's#%%CONFIG_PACKAGE_NAME%%#'"${CONFIG_PACKAGE_NAME}"'#g' tmpfile sed -i 's#%%CONFIG_PACKAGE_NAME_MINIMAL%%#'"${CONFIG_PACKAGE_NAME_MINIMAL}"'#g' tmpfile sed -i 's#%%REPO_NAME_SERVER%%#'"${REPO_NAME_SERVER}"'#g' tmpfile @@ -103,41 +101,32 @@ sed -i 's#%%MYSQL_SHELL_PACKAGE%%#'"${MYSQL_SHELL_PACKAGE}"'#g' tmpfile sed -i 's#%%MYSQL_CONFIG_PKG_MINIMAL%%#'"${MYSQL_CONFIG_PKG_MINIMAL}"'#g' tmpfile sed -i 's#%%MYSQL_CONFIG_PKG%%#'"${MYSQL_CONFIG_PKG}"'#g' tmpfile -sed -i 's/%%PORTS%%/'"${PORTS[${VERSION}]}"'/g' tmpfile -mv tmpfile ${VERSION}/Dockerfile +sed -i 's/%%PORTS%%/'"${PORTS[${MAJOR_VERSION}]}"'/g' tmpfile +mv tmpfile ${MAJOR_VERSION}/Dockerfile # Dockerfile_spec.rb -if [ ! -d "${VERSION}/inspec" ]; then - mkdir "${VERSION}/inspec" -fi - sed 's#%%MYSQL_SERVER_VERSION%%#'"${MYSQL_VERSION}"'#g' template/control.rb > tmpFile sed -i 's#%%MYSQL_SHELL_VERSION%%#'"${SHELL_VERSION}"'#g' tmpFile sed -i 's#%%MYSQL_SERVER_PACKAGE_NAME%%#'"${MYSQL_SERVER_PACKAGE_NAME}"'#g' tmpFile sed -i 's#%%MYSQL_SHELL_PACKAGE_NAME%%#'"${MYSQL_SHELL_PACKAGE_NAME}"'#g' tmpFile -if [[ "$VERSION" == "innovation" ]]; then - MAJOR_VERSION=${LATEST_INNOVATION} -else - MAJOR_VERSION=${VERSION} -fi sed -i 's#%%MAJOR_VERSION%%#'"${MAJOR_VERSION}"'#g' tmpFile sed -i 's#%%CONT_NAME%%#'"${CONT_NAME}"'#g' tmpFile -sed -i 's#%%PORTS%%#'"${SPEC_PORTS[${VERSION}]}"'#g' tmpFile -mv tmpFile "${VERSION}/inspec/control.rb" +sed -i 's#%%PORTS%%#'"${SPEC_PORTS[${MAJOR_VERSION}]}"'#g' tmpFile +mv tmpFile "${MAJOR_VERSION}/inspec/control.rb" # Entrypoint FULL_SERVER_VERSION="$MYSQL_VERSION-${IMAGE_VERSION}" -sed 's#%%PASSWORDSET%%#'"${PASSWORDSET[${VERSION}]}"'#g' template/docker-entrypoint.sh > tmpfile +sed 's#%%PASSWORDSET%%#'"${PASSWORDSET[${MAJOR_VERSION}]}"'#g' template/docker-entrypoint.sh > tmpfile sed -i 's#%%FULL_SERVER_VERSION%%#'"${FULL_SERVER_VERSION}"'#g' tmpfile -sed -i 's#%%VALIDATE_CONFIG%%#'"${VALIDATE_CONFIG[${VERSION}]}"'#g' tmpfile -mv tmpfile ${VERSION}/docker-entrypoint.sh -chmod +x ${VERSION}/docker-entrypoint.sh +sed -i 's#%%VALIDATE_CONFIG%%#'"${VALIDATE_CONFIG[${MAJOR_VERSION}]}"'#g' tmpfile +mv tmpfile ${MAJOR_VERSION}/docker-entrypoint.sh +chmod +x ${MAJOR_VERSION}/docker-entrypoint.sh # Healthcheck -cp template/healthcheck.sh ${VERSION}/ -chmod +x ${VERSION}/healthcheck.sh +cp template/healthcheck.sh ${MAJOR_VERSION}/ +chmod +x ${MAJOR_VERSION}/healthcheck.sh # Build-time preparation script -sed 's#%%PRECREATE_DIRS%%#'"${PRECREATE_DIRS[${VERSION}]}"'#g' template/prepare-image.sh > tmpfile -mv tmpfile ${VERSION}/prepare-image.sh -chmod +x ${VERSION}/prepare-image.sh +sed 's#%%PRECREATE_DIRS%%#'"${PRECREATE_DIRS[${MAJOR_VERSION}]}"'#g' template/prepare-image.sh > tmpfile +mv tmpfile ${MAJOR_VERSION}/prepare-image.sh +chmod +x ${MAJOR_VERSION}/prepare-image.sh diff --git a/mysql-server/innovation/Dockerfile b/mysql-server/innovation/Dockerfile deleted file mode 100644 index 5233b0987..000000000 --- a/mysql-server/innovation/Dockerfile +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) 2017, 2023, Oracle and/or its affiliates. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -FROM container-registry.oracle.com/os/oraclelinux:8-slim - -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal -ARG MYSQL_SHELL_PACKAGE=mysql-shell - -# Setup repositories for minimal packages (all versions) -RUN rpm -U https://repo.mysql.com/mysql-community-minimal-release-el8.rpm \ - && rpm -U https://repo.mysql.com/mysql80-community-release-el8.rpm - -# Install server and shell innovation -RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ - && microdnf install -y --enablerepo=mysql-tools-community $MYSQL_SHELL_PACKAGE \ - && microdnf install -y --disablerepo=ol8_appstream \ - --enablerepo=mysql80-community-minimal $MYSQL_SERVER_PACKAGE \ - && microdnf clean all \ - && mkdir /docker-entrypoint-initdb.d - -COPY prepare-image.sh / -RUN /prepare-image.sh && rm -f /prepare-image.sh - -ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock - -COPY docker-entrypoint.sh /entrypoint.sh -COPY healthcheck.sh /healthcheck.sh -ENTRYPOINT ["/entrypoint.sh"] -HEALTHCHECK CMD /healthcheck.sh -EXPOSE 3306 33060 33061 -CMD ["mysqld"] - diff --git a/mysql-server/innovation/docker-entrypoint.sh b/mysql-server/innovation/docker-entrypoint.sh deleted file mode 100755 index a0c85927f..000000000 --- a/mysql-server/innovation/docker-entrypoint.sh +++ /dev/null @@ -1,230 +0,0 @@ -#!/bin/bash -# Copyright (c) 2017, 2023, Oracle and/or its affiliates. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -set -e - -echo "[Entrypoint] MySQL Docker Image 8.1.0-1.0.0-server" -# Fetch value from server config -# We use mysqld --verbose --help instead of my_print_defaults because the -# latter only show values present in config files, and not server defaults -_get_config() { - local conf="$1"; shift - "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' -} - -# Generate a random password -_mkpw() { - letter=$(cat /dev/urandom| tr -dc a-zA-Z | dd bs=1 count=16 2> /dev/null ) - number=$(cat /dev/urandom| tr -dc 0-9 | dd bs=1 count=8 2> /dev/null) - special=$(cat /dev/urandom| tr -dc '=+@#%^&*_.,;:?/' | dd bs=1 count=8 2> /dev/null) - - echo $letter$number$special | fold -w 1 | shuf | tr -d '\n' -} - -# If command starts with an option, prepend mysqld -# This allows users to add command-line options without -# needing to specify the "mysqld" command -if [ "${1:0:1}" = '-' ]; then - set -- mysqld "$@" -fi - -# Check if entrypoint (and the container) is running as root -if [ $(id -u) = "0" ]; then - is_root=1 - install_devnull="install /dev/null -m0600 -omysql -gmysql" - MYSQLD_USER=mysql -else - install_devnull="install /dev/null -m0600" - MYSQLD_USER=$(id -u) -fi - -if [ "$1" = 'mysqld' ]; then - # Test that the server can start. We redirect stdout to /dev/null so - # only the error messages are left. - result=0 - output=$("$@" --validate-config) || result=$? - if [ ! "$result" = "0" ]; then - echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' - echo >&2 "[Entrypoint] $output" - exit 1 - fi - - # Get config - DATADIR="$(_get_config 'datadir' "$@")" - SOCKET="$(_get_config 'socket' "$@")" - - if [ ! -d "$DATADIR/mysql" ]; then - # If the password variable is a filename we use the contents of the file. We - # read this first to make sure that a proper error is generated for empty files. - if [ -f "$MYSQL_ROOT_PASSWORD" ]; then - MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" - if [ -z "$MYSQL_ROOT_PASSWORD" ]; then - echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' - exit 1 - fi - fi - if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - echo >&2 '[Entrypoint] No password option specified for new database.' - echo >&2 '[Entrypoint] A random onetime password will be generated.' - MYSQL_RANDOM_ROOT_PASSWORD=true - MYSQL_ONETIME_PASSWORD=true - fi - if [ ! -d "$DATADIR" ]; then - mkdir -p "$DATADIR" - chown mysql:mysql "$DATADIR" - fi - - # The user can set a default_timezone either in a my.cnf file - # they mount into the container or on command line - # (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`) - # however the timezone tables will only be populated in a later - # stage of this script. By using +00:00 as timezone we override - # the user's choice during initialization. Later the server - # will be restarted using the user's option. - - echo '[Entrypoint] Initializing database' - "$@" --user=$MYSQLD_USER --initialize-insecure --default-time-zone=+00:00 - - echo '[Entrypoint] Database initialized' - "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" --default-time-zone=+00:00 - - # To avoid using password on commandline, put it in a temporary file. - # The file is only populated when and if the root password is set. - PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) - $install_devnull "$PASSFILE" - # Define the client command used throughout the script - # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly - mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") - - for i in {30..0}; do - if mysqladmin --socket="$SOCKET" ping &>/dev/null; then - break - fi - echo '[Entrypoint] Waiting for server...' - sleep 1 - done - if [ "$i" = 0 ]; then - echo >&2 '[Entrypoint] Timeout during MySQL init.' - exit 1 - fi - - mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql - - if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - MYSQL_ROOT_PASSWORD="$(_mkpw)" - echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" - fi - if [ -z "$MYSQL_ROOT_HOST" ]; then - ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';" - else - ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ - CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ - GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ - GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" - fi - "${mysql[@]}" <<-EOSQL - DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); - CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; - ${ROOTCREATE} - FLUSH PRIVILEGES ; - EOSQL - if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then - # Put the password into the temporary config file - cat >"$PASSFILE" < "$SQL" -ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; -ALTER USER 'root'@'localhost' PASSWORD EXPIRE; -EOF - else - cat << EOF > "$SQL" -ALTER USER 'root'@'localhost' PASSWORD EXPIRE; -EOF - fi - set -- "$@" --init-file="$SQL" - unset SQL - fi - - echo - echo '[Entrypoint] MySQL init process done. Ready for start up.' - echo - fi - - # Used by healthcheck to make sure it doesn't mistakenly report container - # healthy during startup - # Put the password into the temporary config file - touch /var/lib/mysql-files/healthcheck.cnf - cat >"/var/lib/mysql-files/healthcheck.cnf" < Date: Thu, 15 Jun 2023 06:59:22 +0200 Subject: [PATCH 311/386] Bumped image version for July cycle Change-Id: Id28832e010d6b6a2dcf8a762700ae9447e2bb726 --- mysql-cluster/VERSION | 2 +- mysql-router/VERSION | 2 +- mysql-server/VERSION | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mysql-cluster/VERSION b/mysql-cluster/VERSION index 6942f7cf1..cd1d75451 100644 --- a/mysql-cluster/VERSION +++ b/mysql-cluster/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.2.12-cluster +IMAGE_VERSION=1.2.13-cluster declare -A MYSQL_CLUSTER_VERSIONS MYSQL_CLUSTER_VERSIONS["7.5"]=7.5.31 diff --git a/mysql-router/VERSION b/mysql-router/VERSION index 10f8714cf..6dc42e03e 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.0.12-router +IMAGE_VERSION=1.0.13-router declare -A MYSQL_ROUTER_VERSIONS WEEKLY_ROUTER_VERSIONS MYSQL_ROUTER_VERSIONS["8.0"]=8.0.34 MYSQL_ROUTER_VERSIONS["8.1"]=8.1.0 diff --git a/mysql-server/VERSION b/mysql-server/VERSION index f020050ea..315c83d2e 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.2.12-server +IMAGE_VERSION=1.2.13-server declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["5.7"]=5.7.43 From 54d066194f1d51b833c7e7bd7c0e5b78cd44b225 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 19 Jul 2023 07:19:04 +0000 Subject: [PATCH 312/386] Release version 1.2.13-server * Bumped image version for July cycle * ET#78138 - [Docker] Add support for 8.1 in Docker router & Server * ET#78090 - Added support for 8.1 version * ET#77992 - Update docker main repo - support 5.7 commercial builds * ET#72314 - [Follow-up] Override default user command option in yum * ET#72314 - [Follow-up] Fix docker run cmd usage * ET#72314 - [Follow-up] Fix to use correct positional arguments * ET#72314 - Clean up repo config after build * ET#77897 - Add MAJOR_VERSION tag for docker builds i.e. 8.0 or 5.7 * ET#77853 - Fix router version used in manifest task for weekly builds * Revert "Revert "Fix for ET#77620, 77619, 77611, 70570"" --- mysql-server/5.7/Dockerfile | 11 +- mysql-server/5.7/docker-entrypoint.sh | 4 +- mysql-server/5.7/inspec/control.rb | 4 +- mysql-server/8.0/Dockerfile | 9 +- mysql-server/8.0/docker-entrypoint.sh | 4 +- mysql-server/8.0/inspec/control.rb | 4 +- mysql-server/8.1/Dockerfile | 45 +++++ mysql-server/8.1/docker-entrypoint.sh | 230 ++++++++++++++++++++++++++ mysql-server/8.1/healthcheck.sh | 24 +++ mysql-server/8.1/inspec/control.rb | 20 +++ mysql-server/8.1/prepare-image.sh | 25 +++ 11 files changed, 363 insertions(+), 17 deletions(-) create mode 100644 mysql-server/8.1/Dockerfile create mode 100755 mysql-server/8.1/docker-entrypoint.sh create mode 100755 mysql-server/8.1/healthcheck.sh create mode 100644 mysql-server/8.1/inspec/control.rb create mode 100755 mysql-server/8.1/prepare-image.sh diff --git a/mysql-server/5.7/Dockerfile b/mysql-server/5.7/Dockerfile index 40e9d11b2..80fdb94d1 100644 --- a/mysql-server/5.7/Dockerfile +++ b/mysql-server/5.7/Dockerfile @@ -14,16 +14,17 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM container-registry.oracle.com/os/oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal -ARG MYSQL_SHELL_PACKAGE=mysql-shell +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.43 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.34 # Setup repositories for minimal packages (all versions) -RUN rpm -U https://repo.mysql.com/mysql-community-minimal-release-el7.rpm \ - && rpm -U https://repo.mysql.com/mysql80-community-release-el7.rpm +RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el7.rpm \ + && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql80-community-release-el7.rpm # Install server and shell 8.0 RUN yum install -y $MYSQL_SHELL_PACKAGE --enablerepo=mysql-tools-community \ - && yum install -y $MYSQL_SERVER_PACKAGE --enablerepo=mysql80-community-minimal \ + && yum install -y $MYSQL_SERVER_PACKAGE --enablerepo=mysql57-community-minimal \ + && yum remove -y mysql-community-minimal-release mysql80-community-release \ && yum clean all \ && mkdir /docker-entrypoint-initdb.d diff --git a/mysql-server/5.7/docker-entrypoint.sh b/mysql-server/5.7/docker-entrypoint.sh index dffb313a0..6a9e390af 100755 --- a/mysql-server/5.7/docker-entrypoint.sh +++ b/mysql-server/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.42-1.2.12-server" +echo "[Entrypoint] MySQL Docker Image 5.7.43-1.2.13-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 5.7.42-1.2.12-server" + echo "[Entrypoint] Starting MySQL 5.7.43-1.2.13-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/5.7/inspec/control.rb b/mysql-server/5.7/inspec/control.rb index 48544a01e..65d913d82 100644 --- a/mysql-server/5.7/inspec/control.rb +++ b/mysql-server/5.7/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '.*' } + its ('version') { should match '5.7.43.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '.*' } + its ('version') { should match '8.0.34.*' } end end diff --git a/mysql-server/8.0/Dockerfile b/mysql-server/8.0/Dockerfile index 0274aff35..f3da793ea 100644 --- a/mysql-server/8.0/Dockerfile +++ b/mysql-server/8.0/Dockerfile @@ -15,18 +15,19 @@ FROM container-registry.oracle.com/os/oraclelinux:8-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal -ARG MYSQL_SHELL_PACKAGE=mysql-shell +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.34 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.34 # Setup repositories for minimal packages (all versions) -RUN rpm -U https://repo.mysql.com/mysql-community-minimal-release-el8.rpm \ - && rpm -U https://repo.mysql.com/mysql80-community-release-el8.rpm +RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el8.rpm \ + && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql80-community-release-el8.rpm # Install server and shell 8.0 RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ && microdnf install -y --enablerepo=mysql-tools-community $MYSQL_SHELL_PACKAGE \ && microdnf install -y --disablerepo=ol8_appstream \ --enablerepo=mysql80-community-minimal $MYSQL_SERVER_PACKAGE \ + && microdnf remove mysql-community-minimal-release mysql80-community-release \ && microdnf clean all \ && mkdir /docker-entrypoint-initdb.d diff --git a/mysql-server/8.0/docker-entrypoint.sh b/mysql-server/8.0/docker-entrypoint.sh index ad210e57e..f70459cfc 100755 --- a/mysql-server/8.0/docker-entrypoint.sh +++ b/mysql-server/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.33-1.2.12-server" +echo "[Entrypoint] MySQL Docker Image 8.0.34-1.2.13-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.33-1.2.12-server" + echo "[Entrypoint] Starting MySQL 8.0.34-1.2.13-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/8.0/inspec/control.rb b/mysql-server/8.0/inspec/control.rb index ed69fa988..b8daaed05 100644 --- a/mysql-server/8.0/inspec/control.rb +++ b/mysql-server/8.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '.*' } + its ('version') { should match '8.0.34.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '.*' } + its ('version') { should match '8.0.34.*' } end end diff --git a/mysql-server/8.1/Dockerfile b/mysql-server/8.1/Dockerfile new file mode 100644 index 000000000..9e073711b --- /dev/null +++ b/mysql-server/8.1/Dockerfile @@ -0,0 +1,45 @@ +# Copyright (c) 2017, 2023, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +FROM container-registry.oracle.com/os/oraclelinux:8-slim + +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.1.0 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.1.0 + +# Setup repositories for minimal packages (all versions) +RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el8.rpm \ + && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql80-community-release-el8.rpm + +# Install server and shell 8.0 +RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ + && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --disablerepo=ol8_appstream \ + --enablerepo=mysql-innovation-community-minimal $MYSQL_SERVER_PACKAGE \ + && microdnf remove mysql-community-minimal-release mysql80-community-release \ + && microdnf clean all \ + && mkdir /docker-entrypoint-initdb.d + +COPY prepare-image.sh / +RUN /prepare-image.sh && rm -f /prepare-image.sh + +ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock + +COPY docker-entrypoint.sh /entrypoint.sh +COPY healthcheck.sh /healthcheck.sh +ENTRYPOINT ["/entrypoint.sh"] +HEALTHCHECK CMD /healthcheck.sh +EXPOSE 3306 33060 33061 +CMD ["mysqld"] + diff --git a/mysql-server/8.1/docker-entrypoint.sh b/mysql-server/8.1/docker-entrypoint.sh new file mode 100755 index 000000000..5ad9acb38 --- /dev/null +++ b/mysql-server/8.1/docker-entrypoint.sh @@ -0,0 +1,230 @@ +#!/bin/bash +# Copyright (c) 2017, 2021, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +echo "[Entrypoint] MySQL Docker Image 8.1.0-1.2.13-server" +# Fetch value from server config +# We use mysqld --verbose --help instead of my_print_defaults because the +# latter only show values present in config files, and not server defaults +_get_config() { + local conf="$1"; shift + "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' +} + +# Generate a random password +_mkpw() { + letter=$(cat /dev/urandom| tr -dc a-zA-Z | dd bs=1 count=16 2> /dev/null ) + number=$(cat /dev/urandom| tr -dc 0-9 | dd bs=1 count=8 2> /dev/null) + special=$(cat /dev/urandom| tr -dc '=+@#%^&*_.,;:?/' | dd bs=1 count=8 2> /dev/null) + + echo $letter$number$special | fold -w 1 | shuf | tr -d '\n' +} + +# If command starts with an option, prepend mysqld +# This allows users to add command-line options without +# needing to specify the "mysqld" command +if [ "${1:0:1}" = '-' ]; then + set -- mysqld "$@" +fi + +# Check if entrypoint (and the container) is running as root +if [ $(id -u) = "0" ]; then + is_root=1 + install_devnull="install /dev/null -m0600 -omysql -gmysql" + MYSQLD_USER=mysql +else + install_devnull="install /dev/null -m0600" + MYSQLD_USER=$(id -u) +fi + +if [ "$1" = 'mysqld' ]; then + # Test that the server can start. We redirect stdout to /dev/null so + # only the error messages are left. + result=0 + output=$("$@" --validate-config) || result=$? + if [ ! "$result" = "0" ]; then + echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' + echo >&2 "[Entrypoint] $output" + exit 1 + fi + + # Get config + DATADIR="$(_get_config 'datadir' "$@")" + SOCKET="$(_get_config 'socket' "$@")" + + if [ ! -d "$DATADIR/mysql" ]; then + # If the password variable is a filename we use the contents of the file. We + # read this first to make sure that a proper error is generated for empty files. + if [ -f "$MYSQL_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + if [ -z "$MYSQL_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' + exit 1 + fi + fi + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] No password option specified for new database.' + echo >&2 '[Entrypoint] A random onetime password will be generated.' + MYSQL_RANDOM_ROOT_PASSWORD=true + MYSQL_ONETIME_PASSWORD=true + fi + if [ ! -d "$DATADIR" ]; then + mkdir -p "$DATADIR" + chown mysql:mysql "$DATADIR" + fi + + # The user can set a default_timezone either in a my.cnf file + # they mount into the container or on command line + # (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`) + # however the timezone tables will only be populated in a later + # stage of this script. By using +00:00 as timezone we override + # the user's choice during initialization. Later the server + # will be restarted using the user's option. + + echo '[Entrypoint] Initializing database' + "$@" --user=$MYSQLD_USER --initialize-insecure --default-time-zone=+00:00 + + echo '[Entrypoint] Database initialized' + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" --default-time-zone=+00:00 + + # To avoid using password on commandline, put it in a temporary file. + # The file is only populated when and if the root password is set. + PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + $install_devnull "$PASSFILE" + # Define the client command used throughout the script + # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") + + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break + fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 + fi + + mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql + + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(_mkpw)" + echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + fi + if [ -z "$MYSQL_ROOT_HOST" ]; then + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';" + else + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ + GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + fi + "${mysql[@]}" <<-EOSQL + DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; + ${ROOTCREATE} + FLUSH PRIVILEGES ; + EOSQL + if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then + # Put the password into the temporary config file + cat >"$PASSFILE" < "$SQL" +ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL + fi + + echo + echo '[Entrypoint] MySQL init process done. Ready for start up.' + echo + fi + + # Used by healthcheck to make sure it doesn't mistakenly report container + # healthy during startup + # Put the password into the temporary config file + touch /var/lib/mysql-files/healthcheck.cnf + cat >"/var/lib/mysql-files/healthcheck.cnf" < Date: Wed, 19 Jul 2023 20:57:37 +0200 Subject: [PATCH 313/386] Server - Fix test script - container name update Change-Id: I6e1bcaadb2b8479778003d5f3abc17cfbf5e0f44 --- mysql-server/test.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mysql-server/test.sh b/mysql-server/test.sh index 51ba4244c..a0bff3014 100755 --- a/mysql-server/test.sh +++ b/mysql-server/test.sh @@ -33,14 +33,14 @@ ARCH=amd64; [ -n "$1" ] && ARCH=$1 BUILD_TYPE=community; [ -n "$2" ] && BUILD_TYPE=$2 MAJOR_VERSIONS=("${!MYSQL_SERVER_VERSIONS[@]}"); [ -n "$3" ] && MAJOR_VERSIONS=("${@:3}") -if [[ ${BUILD_TYPE} =~ (commercial) ]]; then - IMG_LOC="store/oracle/mysql-enterprise-server" - CONT_NAME="mysql-enterprise-server-$MAJOR_VERSION" -else - IMG_LOC="mysql/mysql-server" - CONT_NAME="mysql-server-$MAJOR_VERSION" -fi for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do + if [[ ${BUILD_TYPE} =~ (commercial) ]]; then + IMG_LOC="store/oracle/mysql-enterprise-server" + CONT_NAME="mysql-enterprise-server-$MAJOR_VERSION" + else + IMG_LOC="mysql/mysql-server" + CONT_NAME="mysql-server-$MAJOR_VERSION" + fi ARCH_SUFFIX="" for MULTIARCH_VERSION in "${MULTIARCH_VERSIONS[@]}"; do if [[ "$MULTIARCH_VERSION" == "$MAJOR_VERSION" ]]; then From 7d13441fcdf69f8aaeb4d02b1f936a3a86fc30ba Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 19 Jul 2023 19:54:00 +0000 Subject: [PATCH 314/386] Release version 1.2.13-server * Server - Fix test script - container name update From a39fdd14e0f0e8d425f0f51fcd751cce4d668e48 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Thu, 20 Jul 2023 05:10:32 +0000 Subject: [PATCH 315/386] Release version 1.2.13-server * Server - Fix test script - container name update From 1bd785908fd004f135109c763fbdc42789c0173d Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Thu, 20 Jul 2023 18:51:03 +0000 Subject: [PATCH 316/386] Release version 1.0.13-router * Bumped image version for July cycle * ET#78138 - [Docker] Add support for 8.1 in Docker router & Server * ET#77897 - Add MAJOR_VERSION tag for docker builds i.e. 8.0 or 5.7 * ET#77853 - Fix router version used in manifest task for weekly builds * Revert "Revert "Fix for ET#77620, 77619, 77611, 70570"" --- mysql-router/8.0/Dockerfile | 6 +- mysql-router/8.0/inspec/control.rb | 4 +- mysql-router/8.1/Dockerfile | 39 +++++++++++ mysql-router/8.1/README.md | 88 +++++++++++++++++++++++++ mysql-router/8.1/inspec/control.rb | 20 ++++++ mysql-router/8.1/run.sh | 101 +++++++++++++++++++++++++++++ 6 files changed, 253 insertions(+), 5 deletions(-) create mode 100644 mysql-router/8.1/Dockerfile create mode 100644 mysql-router/8.1/README.md create mode 100644 mysql-router/8.1/inspec/control.rb create mode 100755 mysql-router/8.1/run.sh diff --git a/mysql-router/8.0/Dockerfile b/mysql-router/8.0/Dockerfile index cf912cab6..82cd25b28 100644 --- a/mysql-router/8.0/Dockerfile +++ b/mysql-router/8.0/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM container-registry.oracle.com/os/oraclelinux:8-slim -ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.33 -ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.33 +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.34 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.34 ARG CONFIG_PACKAGE_NAME=mysql80-community-release-el8.rpm ARG REPO_NAME_SERVER=mysql80-community ARG REPO_NAME_TOOLS=mysql-tools-community @@ -23,7 +23,7 @@ ARG REPO_NAME_TOOLS=mysql-tools-community RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ -c "MySQL Router" mysqlrouter \ - && rpm -U https://repo.mysql.com/$CONFIG_PACKAGE_NAME \ + && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/$CONFIG_PACKAGE_NAME \ && microdnf install -y --disablerepo=\* \ --enablerepo=mysql80-community $MYSQL_CLIENT_PACKAGE \ && microdnf install -y --disablerepo=\* \ diff --git a/mysql-router/8.0/inspec/control.rb b/mysql-router/8.0/inspec/control.rb index d44b6dc54..446c5862b 100644 --- a/mysql-router/8.0/inspec/control.rb +++ b/mysql-router/8.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-client') do it { should be_installed } - its ('version') { should match '8.0.33.*' } + its ('version') { should match '8.0.34.*' } end describe package('mysql-router-community') do it { should be_installed } - its ('version') { should match '8.0.33.*' } + its ('version') { should match '8.0.34.*' } end end diff --git a/mysql-router/8.1/Dockerfile b/mysql-router/8.1/Dockerfile new file mode 100644 index 000000000..8f550f123 --- /dev/null +++ b/mysql-router/8.1/Dockerfile @@ -0,0 +1,39 @@ +# Copyright (c) 2018, 2023, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +FROM container-registry.oracle.com/os/oraclelinux:8-slim + +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.1.0 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.1.0 +ARG CONFIG_PACKAGE_NAME=mysql80-community-release-el8.rpm +ARG REPO_NAME_SERVER=mysql-innovation-community +ARG REPO_NAME_TOOLS=mysql-tools-innovation-community + +RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ + && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ + -c "MySQL Router" mysqlrouter \ + && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/$CONFIG_PACKAGE_NAME \ + && microdnf install -y --disablerepo=\* \ + --enablerepo=mysql-innovation-community $MYSQL_CLIENT_PACKAGE \ + && microdnf install -y --disablerepo=\* \ + --enablerepo=mysql-tools-innovation-community $MYSQL_ROUTER_PACKAGE \ + && microdnf clean all + +COPY run.sh /run.sh +HEALTHCHECK \ + CMD mysqladmin --port 6446 --protocol TCP ping 2>&1 | grep Access || exit 1 +EXPOSE 6446 6447 6448 6449 8443 +USER 999:999 +ENTRYPOINT ["/run.sh"] +CMD ["mysqlrouter"] diff --git a/mysql-router/8.1/README.md b/mysql-router/8.1/README.md new file mode 100644 index 000000000..0f2711ba5 --- /dev/null +++ b/mysql-router/8.1/README.md @@ -0,0 +1,88 @@ +![logo](https://www.mysql.com/common/logos/logo-mysql-170x115.png) + +# What is MySQL Router? + +MySQL Router is part of InnoDB cluster, and is lightweight middleware that +provides transparent routing between your application and back-end MySQL +Servers. It can be used for a wide variety of use cases, such as providing high +availability and scalability by effectively routing database traffic to +appropriate back-end MySQL Servers. The pluggable architecture also enables +developers to extend MySQL Router for custom use cases. + +# Supported Tags and Respective Dockerfile Links + +* MySQL Router 8.0 (tag: [`latest`, `8.0`](https://github.com/mysql/mysql-docker/blob/mysql-router/8.0/Dockerfile)) ([mysql-router/8.0/Dockerfile](https://github.com/mysql/mysql-docker/blob/mysql-router/8.0/Dockerfile)) + +Images are updated when new MySQL Server maintenance releases and development milestones are published. Please note that non-GA releases are for preview purposes only and should not be used in production setups. + +# How to Use the MySQL Router Images + +The image currently uses the following mandatory variables: + +| Variable | Description | +| ------------------------ | ------------------------------------------- | +| MYSQL_HOST | MySQL host to connect to | +| MYSQL_PORT | Port to use | +| MYSQL_USER | User to connect with | +| MYSQL_PASSWORD | Password to connect with | + +Running in a container requires a working InnoDB cluster. + +The image uses the following optional variables: + +| Variable | Description | +| ------------------------------------ | ------------------------------------------- | +| MYSQL_INNODB_CLUSTER_MEMBERS | Wait for at least this number of cluster instances to be ONLINE | +| MYSQL_CREATE_ROUTER_USER | Whether to create a new account for the Router to use when it's running. Defaults to 1, set to 0 to disable. | +| MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS | Additional command line options applied while bootstrapping + +If supplied the run script waits for the given mysql host to be up, the InnoDB cluster to have +MYSQL_INNODB_CLUSTER_MEMBERS members and then uses the given server for its +bootstrap mode +[Bootstrapping](https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-deploying-bootstrapping.html). + +The image can be run via: + +``` +docker run -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -e MYSQL_INNODB_CLUSTER_MEMBERS=3 -ti mysql/mysql-router +``` + +Additional command line options for running MySQL Router after bootstrap can be passed a command options. For instance you can use a config file from your home directory like this: + +``` +docker run -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -ti -v $HOME/router-extra.conf:/tmp/router-extra.conf mysql/mysql-router mysqlrouter --extra-config=/tmp/router-extra.conf +``` + +It can be verified by typing: + +``` +docker ps +``` + +The following output should be displayed: + +``` +4954b1c80be1 mysql-router:8.0 "/run.sh mysqlrouter" About a minute ago Up About a minute (healthy) 6447/tcp, 6448/tcp, 0.0.0.0:6446->6446/tcp, 6449/tcp innodbcluster_mysql-router_1 +``` + +By default the container will run as user 999:999 which maps to mysqlrouter:mysqlrouter inside the container. + +# Exposed Ports + +The following TCP ports are exposed by the MySQL Router container: + +| Port | Description +| ----- | --------------------------------------------------------------------------------------- | +| 6446 | R/W connection port. Clients that connect to this port will be forwarded to the PRIMARY | +| 6447 | R/O connection port. Clients that connect to this port will be forwarded to a SECONDARY | +| 6448 | X Protocol R/W connection port. R/W port for X protocol client connections | +| 6449 | X Protocol R/O connection port. R/O port for X protocol client connections | +| 8443 | HTTPS REST interface port. | + +For more information about the REST interface API, see: + +https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-rest-api-reference.html + +For full usage documentation, see: + +https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-installation-docker.html diff --git a/mysql-router/8.1/inspec/control.rb b/mysql-router/8.1/inspec/control.rb new file mode 100644 index 000000000..ca9ebf141 --- /dev/null +++ b/mysql-router/8.1/inspec/control.rb @@ -0,0 +1,20 @@ +control 'container' do + impact 0.5 + describe podman.containers do + its('status') { should cmp /Up/ } + its('commands') { should cmp /sleep/ } + its('images') { should cmp /mysql-router:8.1/ } + its('names') { should include "mysql-router-8.1" } + end +end +control 'packages' do + impact 0.5 + describe package('mysql-community-client') do + it { should be_installed } + its ('version') { should match '8.1.0.*' } + end + describe package('mysql-router-community') do + it { should be_installed } + its ('version') { should match '8.1.0.*' } + end +end diff --git a/mysql-router/8.1/run.sh b/mysql-router/8.1/run.sh new file mode 100755 index 000000000..f806c1afe --- /dev/null +++ b/mysql-router/8.1/run.sh @@ -0,0 +1,101 @@ +#!/bin/bash +# Copyright (c) 2018, 2021, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +if [ "$1" = 'mysqlrouter' ]; then + if [[ -z $MYSQL_HOST || -z $MYSQL_PORT || -z $MYSQL_USER || -z $MYSQL_PASSWORD ]]; then + echo "We require all of" + echo " MYSQL_HOST" + echo " MYSQL_PORT" + echo " MYSQL_USER" + echo " MYSQL_PASSWORD" + echo "to be set." + echo "In addition you can set" + echo " MYSQL_INNODB_CLUSTER_MEMBERS " + echo " MYSQL_CREATE_ROUTER_USER" + echo " MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS" + echo "Exiting." + exit 1 + fi + + PASSFILE=$(mktemp) + echo "$MYSQL_PASSWORD" > "$PASSFILE" + if [ -z $MYSQL_CREATE_ROUTER_USER ]; then + echo "$MYSQL_PASSWORD" >> "$PASSFILE" + MYSQL_CREATE_ROUTER_USER=1 + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is not set, Router will generate a new account to be used at runtime." + echo "[Entrypoint] Set it to 0 to reuse $MYSQL_USER instead." + elif [ "$MYSQL_CREATE_ROUTER_USER" = "0" ]; then + echo "$MYSQL_PASSWORD" >> "$PASSFILE" + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is 0, Router will reuse $MYSQL_USER account at runtime" + else + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is not 0, Router will generate a new account to be used at runtime" + fi + + DEFAULTS_EXTRA_FILE=$(mktemp) + cat >"$DEFAULTS_EXTRA_FILE" < "/dev/tcp/$MYSQL_HOST/$MYSQL_PORT") >/dev/null 2>&1; do + echo "[Entrypoint] Waiting for mysql server $MYSQL_HOST ($attempt_num/$max_tries)" + sleep $(( attempt_num++ )) + if (( attempt_num == max_tries )); then + exit 1 + fi + done + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST:$MYSQL_PORT. Checking for cluster state." + if ! [[ "$(mysql --defaults-extra-file="$DEFAULTS_EXTRA_FILE" -u "$MYSQL_USER" -h "$MYSQL_HOST" -P "$MYSQL_PORT" -e "show status;" 2> /dev/null)" ]]; then + echo "[Entrypoint] ERROR: Can not connect to database. Exiting." + exit 1 + fi + if [[ -n $MYSQL_INNODB_CLUSTER_MEMBERS ]]; then + attempt_num=0 + echo $attempt_num + echo $max_tries + until [ "$(mysql --defaults-extra-file="$DEFAULTS_EXTRA_FILE" -u "$MYSQL_USER" -h "$MYSQL_HOST" -P "$MYSQL_PORT" -N performance_schema -e "select count(MEMBER_STATE) >= $MYSQL_INNODB_CLUSTER_MEMBERS from replication_group_members where MEMBER_STATE = 'ONLINE';" 2> /dev/null)" -eq 1 ]; do + echo "[Entrypoint] Waiting for $MYSQL_INNODB_CLUSTER_MEMBERS cluster instances to become available via $MYSQL_HOST ($attempt_num/$max_tries)" + sleep $(( attempt_num++ )) + if (( attempt_num == max_tries )); then + exit 1 + fi + done + echo "[Entrypoint] Successfully contacted cluster with $MYSQL_INNODB_CLUSTER_MEMBERS members. Bootstrapping." + fi + if [ $(id -u) = "0" ]; then + opt_user=--user=mysqlrouter + fi + if [ "$MYSQL_CREATE_ROUTER_USER" = "0" ]; then + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap reusing account \"$MYSQL_USER\"." + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force --account-create=never --account=$MYSQL_USER $opt_user $MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS < "$PASSFILE" || exit 1 + else + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap." + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force $opt_user $MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS < "$PASSFILE" || exit 1 + fi + + sed -i -e 's/logging_folder=.*$/logging_folder=/' /tmp/mysqlrouter/mysqlrouter.conf + echo "[Entrypoint] Starting mysql-router." + exec "$@" --config /tmp/mysqlrouter/mysqlrouter.conf + + rm -f "$PASSFILE" + rm -f "$DEFAULTS_EXTRA_FILE" + unset DEFAULTS_EXTRA_FILE +else + exec "$@" +fi From e8f56dafebc6ad33b6c1a35399773487df613f1a Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Thu, 20 Jul 2023 19:03:23 +0000 Subject: [PATCH 317/386] Release version 1.0.13-router * Release version 1.0.13-router * Bumped image version for July cycle * ET#78138 - [Docker] Add support for 8.1 in Docker router & Server * ET#77897 - Add MAJOR_VERSION tag for docker builds i.e. 8.0 or 5.7 * ET#77853 - Fix router version used in manifest task for weekly builds * Revert "Revert "Fix for ET#77620, 77619, 77611, 70570"" From 645ef6e8cd2e37fea9635dc8b760bf0c4c992a9f Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Thu, 20 Jul 2023 19:22:01 +0000 Subject: [PATCH 318/386] Release version 1.2.13-cluster * Bumped image version for July cycle * ET#77928 - Add Docker cluster pipeline for 8.1 --- mysql-cluster/7.5/Dockerfile | 8 +- mysql-cluster/7.5/docker-entrypoint.sh | 4 +- mysql-cluster/7.5/inspec/control.rb | 4 +- mysql-cluster/7.6/Dockerfile | 8 +- mysql-cluster/7.6/docker-entrypoint.sh | 4 +- mysql-cluster/7.6/inspec/control.rb | 4 +- mysql-cluster/8.0/Dockerfile | 8 +- mysql-cluster/8.0/docker-entrypoint.sh | 4 +- mysql-cluster/8.0/inspec/control.rb | 4 +- mysql-cluster/8.1/Dockerfile | 47 +++++ mysql-cluster/8.1/cnf/my.cnf | 22 ++ mysql-cluster/8.1/cnf/mysql-cluster.cnf | 39 ++++ mysql-cluster/8.1/docker-entrypoint.sh | 264 ++++++++++++++++++++++++ mysql-cluster/8.1/healthcheck.sh | 24 +++ mysql-cluster/8.1/inspec/control.rb | 20 ++ mysql-cluster/8.1/prepare-image.sh | 25 +++ 16 files changed, 465 insertions(+), 24 deletions(-) create mode 100644 mysql-cluster/8.1/Dockerfile create mode 100644 mysql-cluster/8.1/cnf/my.cnf create mode 100644 mysql-cluster/8.1/cnf/mysql-cluster.cnf create mode 100755 mysql-cluster/8.1/docker-entrypoint.sh create mode 100755 mysql-cluster/8.1/healthcheck.sh create mode 100644 mysql-cluster/8.1/inspec/control.rb create mode 100755 mysql-cluster/8.1/prepare-image.sh diff --git a/mysql-cluster/7.5/Dockerfile b/mysql-cluster/7.5/Dockerfile index 9663a947e..bbd9f538d 100644 --- a/mysql-cluster/7.5/Dockerfile +++ b/mysql-cluster/7.5/Dockerfile @@ -15,12 +15,12 @@ FROM container-registry.oracle.com/os/oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal -ARG MYSQL_SHELL_PACKAGE=mysql-shell +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-7.5.31 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.34 # Setup repositories for minimal packages (all versions) -RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el7.rpm \ - && rpm -U https://repo.mysql.com/mysql80-community-release-el7.rpm +RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-cluster-community-minimal-release-el7.rpm \ + && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql80-community-release-el7.rpm # Install server and shell 8.0 RUN yum install -y $MYSQL_SHELL_PACKAGE \ diff --git a/mysql-cluster/7.5/docker-entrypoint.sh b/mysql-cluster/7.5/docker-entrypoint.sh index 80c61a889..381550938 100755 --- a/mysql-cluster/7.5/docker-entrypoint.sh +++ b/mysql-cluster/7.5/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 7.5.30-1.2.12-cluster" +echo "[Entrypoint] MySQL Docker Image 7.5.31-1.2.13-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -227,7 +227,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 7.5.30-1.2.12-cluster" + echo "[Entrypoint] Starting MySQL 7.5.31-1.2.13-cluster" fi exec "$@" --user=$MYSQLD_USER else diff --git a/mysql-cluster/7.5/inspec/control.rb b/mysql-cluster/7.5/inspec/control.rb index aab485e21..70b488911 100644 --- a/mysql-cluster/7.5/inspec/control.rb +++ b/mysql-cluster/7.5/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '.*' } + its ('version') { should match '7.5.31.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '.*' } + its ('version') { should match '8.0.34.*' } end end diff --git a/mysql-cluster/7.6/Dockerfile b/mysql-cluster/7.6/Dockerfile index 260c09f31..a8d0aed4b 100644 --- a/mysql-cluster/7.6/Dockerfile +++ b/mysql-cluster/7.6/Dockerfile @@ -15,12 +15,12 @@ FROM container-registry.oracle.com/os/oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal -ARG MYSQL_SHELL_PACKAGE=mysql-shell +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-7.6.27 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.34 # Setup repositories for minimal packages (all versions) -RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el7.rpm \ - && rpm -U https://repo.mysql.com/mysql80-community-release-el7.rpm +RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-cluster-community-minimal-release-el7.rpm \ + && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql80-community-release-el7.rpm # Install server and shell 8.0 RUN yum install -y $MYSQL_SHELL_PACKAGE \ diff --git a/mysql-cluster/7.6/docker-entrypoint.sh b/mysql-cluster/7.6/docker-entrypoint.sh index 41f9b5930..02ed82f8c 100755 --- a/mysql-cluster/7.6/docker-entrypoint.sh +++ b/mysql-cluster/7.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 7.6.26-1.2.12-cluster" +echo "[Entrypoint] MySQL Docker Image 7.6.27-1.2.13-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -227,7 +227,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 7.6.26-1.2.12-cluster" + echo "[Entrypoint] Starting MySQL 7.6.27-1.2.13-cluster" fi exec "$@" --user=$MYSQLD_USER else diff --git a/mysql-cluster/7.6/inspec/control.rb b/mysql-cluster/7.6/inspec/control.rb index 681b3a987..a1b906a60 100644 --- a/mysql-cluster/7.6/inspec/control.rb +++ b/mysql-cluster/7.6/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '.*' } + its ('version') { should match '7.6.27.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '.*' } + its ('version') { should match '8.0.34.*' } end end diff --git a/mysql-cluster/8.0/Dockerfile b/mysql-cluster/8.0/Dockerfile index 0a3aa28db..2a10fa1cd 100644 --- a/mysql-cluster/8.0/Dockerfile +++ b/mysql-cluster/8.0/Dockerfile @@ -15,12 +15,12 @@ FROM container-registry.oracle.com/os/oraclelinux:8-slim -ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal -ARG MYSQL_SHELL_PACKAGE=mysql-shell +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.0.34 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.34 # Setup repositories for minimal packages (all versions) -RUN rpm -U https://repo.mysql.com/mysql-cluster-community-minimal-release-el8.rpm \ - && rpm -U https://repo.mysql.com/mysql80-community-release-el8.rpm +RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-cluster-community-minimal-release-el8.rpm \ + && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql80-community-release-el8.rpm # Install server and shell 8.0 RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ diff --git a/mysql-cluster/8.0/docker-entrypoint.sh b/mysql-cluster/8.0/docker-entrypoint.sh index 8315e66e6..030ff37af 100755 --- a/mysql-cluster/8.0/docker-entrypoint.sh +++ b/mysql-cluster/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.33-1.2.12-cluster" +echo "[Entrypoint] MySQL Docker Image 8.0.34-1.2.13-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -227,7 +227,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.33-1.2.12-cluster" + echo "[Entrypoint] Starting MySQL 8.0.34-1.2.13-cluster" fi export MYSQLD_PARENT_PID=$$ ; exec "$@" --user= else diff --git a/mysql-cluster/8.0/inspec/control.rb b/mysql-cluster/8.0/inspec/control.rb index 34b240fbd..0030562e4 100644 --- a/mysql-cluster/8.0/inspec/control.rb +++ b/mysql-cluster/8.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '.*' } + its ('version') { should match '8.0.34.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '.*' } + its ('version') { should match '8.0.34.*' } end end diff --git a/mysql-cluster/8.1/Dockerfile b/mysql-cluster/8.1/Dockerfile new file mode 100644 index 000000000..27ba41c15 --- /dev/null +++ b/mysql-cluster/8.1/Dockerfile @@ -0,0 +1,47 @@ +# Copyright (c) 2017, 2023, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +FROM container-registry.oracle.com/os/oraclelinux:8-slim + +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.1.0 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.1.0 + +# Setup repositories for minimal packages (all versions) +RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-cluster-community-minimal-release-el8.rpm \ + && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql80-community-release-el8.rpm + +# Install server and shell 8.0 +RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ + && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --disablerepo=ol8_appstream \ + --enablerepo=mysql-cluster-innovation-community-minimal $MYSQL_SERVER_PACKAGE \ + && microdnf clean all \ + && mkdir /docker-entrypoint-initdb.d + +COPY prepare-image.sh / +RUN /prepare-image.sh && rm -f /prepare-image.sh + +ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock + +COPY docker-entrypoint.sh /entrypoint.sh +COPY healthcheck.sh /healthcheck.sh +COPY cnf/my.cnf /etc/ +COPY cnf/mysql-cluster.cnf /etc/ + +ENTRYPOINT ["/entrypoint.sh"] +HEALTHCHECK CMD /healthcheck.sh +EXPOSE 3306 33060-33061 2202 1186 +CMD ["mysqld"] + diff --git a/mysql-cluster/8.1/cnf/my.cnf b/mysql-cluster/8.1/cnf/my.cnf new file mode 100644 index 000000000..ec98b2dc1 --- /dev/null +++ b/mysql-cluster/8.1/cnf/my.cnf @@ -0,0 +1,22 @@ +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +[mysqld] +ndbcluster +ndb-connectstring=192.168.0.2 +user=mysql + +[mysql_cluster] +ndb-connectstring=192.168.0.2 diff --git a/mysql-cluster/8.1/cnf/mysql-cluster.cnf b/mysql-cluster/8.1/cnf/mysql-cluster.cnf new file mode 100644 index 000000000..16f79f1c0 --- /dev/null +++ b/mysql-cluster/8.1/cnf/mysql-cluster.cnf @@ -0,0 +1,39 @@ +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +[ndbd default] +NoOfReplicas=2 +DataMemory=80M +IndexMemory=18M + + +[ndb_mgmd] +NodeId=1 +hostname=192.168.0.2 +datadir=/var/lib/mysql + +[ndbd] +NodeId=2 +hostname=192.168.0.3 +datadir=/var/lib/mysql + +[ndbd] +NodeId=3 +hostname=192.168.0.4 +datadir=/var/lib/mysql + +[mysqld] +NodeId=4 +hostname=192.168.0.10 diff --git a/mysql-cluster/8.1/docker-entrypoint.sh b/mysql-cluster/8.1/docker-entrypoint.sh new file mode 100755 index 000000000..30f975a8c --- /dev/null +++ b/mysql-cluster/8.1/docker-entrypoint.sh @@ -0,0 +1,264 @@ +#!/bin/bash +# Copyright (c) 2017, 2021, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +echo "[Entrypoint] MySQL Docker Image 8.1.0-1.2.13-cluster" +# Fetch value from server config +# We use mysqld --verbose --help instead of my_print_defaults because the +# latter only show values present in config files, and not server defaults +_get_config() { + local conf="$1"; shift + "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' +} + +# Generate a random password +_mkpw() { + letter=$(cat /dev/urandom| tr -dc a-zA-Z | dd bs=1 count=16 2> /dev/null ) + number=$(cat /dev/urandom| tr -dc 0-9 | dd bs=1 count=8 2> /dev/null) + special=$(cat /dev/urandom| tr -dc '=+@#%^&*_.,;:?/' | dd bs=1 count=8 2> /dev/null) + + echo $letter$number$special | fold -w 1 | shuf | tr -d '\n' +} + +# If command starts with an option, prepend mysqld +# This allows users to add command-line options without +# needing to specify the "mysqld" command +if [ "${1:0:1}" = '-' ]; then + set -- mysqld "$@" +fi + +# Check if entrypoint (and the container) is running as root +if [ $(id -u) = "0" ]; then + is_root=1 + install_devnull="install /dev/null -m0600 -omysql -gmysql" + MYSQLD_USER=mysql +else + install_devnull="install /dev/null -m0600" + MYSQLD_USER=$(id -u) +fi + +if [ "$1" = 'mysqld' ]; then + # Test that the server can start. We redirect stdout to /dev/null so + # only the error messages are left. + result=0 + output=$("$@" --validate-config) || result=$? + if [ ! "$result" = "0" ]; then + echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' + echo >&2 "[Entrypoint] $output" + exit 1 + fi + + # Get config + DATADIR="$(_get_config 'datadir' "$@")" + SOCKET="$(_get_config 'socket' "$@")" + + if [ ! -d "$DATADIR/mysql" ]; then + # If the password variable is a filename we use the contents of the file. We + # read this first to make sure that a proper error is generated for empty files. + if [ -f "$MYSQL_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + if [ -z "$MYSQL_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' + exit 1 + fi + fi + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] No password option specified for new database.' + echo >&2 '[Entrypoint] A random onetime password will be generated.' + MYSQL_RANDOM_ROOT_PASSWORD=true + MYSQL_ONETIME_PASSWORD=true + fi + if [ ! -d "$DATADIR" ]; then + mkdir -p "$DATADIR" + chown mysql:mysql "$DATADIR" + fi + + # The user can set a default_timezone either in a my.cnf file + # they mount into the container or on command line + # (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`) + # however the timezone tables will only be populated in a later + # stage of this script. By using +00:00 as timezone we override + # the user's choice during initialization. Later the server + # will be restarted using the user's option. + + echo '[Entrypoint] Initializing database' + "$@" --user=$MYSQLD_USER --initialize-insecure --default-time-zone=+00:00 + + echo '[Entrypoint] Database initialized' + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" --default-time-zone=+00:00 + + # To avoid using password on commandline, put it in a temporary file. + # The file is only populated when and if the root password is set. + PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + $install_devnull "$PASSFILE" + # Define the client command used throughout the script + # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") + + if [ ! -z %%STARTUP_WAIT%% ]; + then + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break + fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 + fi + fi + + mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql + + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(_mkpw)" + echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + fi + if [ -z "$MYSQL_ROOT_HOST" ]; then + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';" + else + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ + GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + fi + "${mysql[@]}" <<-EOSQL + DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; + ${ROOTCREATE} + FLUSH PRIVILEGES ; + EOSQL + if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then + # Put the password into the temporary config file + cat >"$PASSFILE" < "$SQL" +ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL + fi + fi + + echo + echo '[Entrypoint] MySQL init process done. Ready for start up.' + echo + fi + + # Used by healthcheck to make sure it doesn't mistakenly report container + # healthy during startup + # Put the password into the temporary config file + touch /var/lib/mysql-files/healthcheck.cnf + cat >"/var/lib/mysql-files/healthcheck.cnf" < Date: Sat, 22 Jul 2023 10:44:23 +0200 Subject: [PATCH 319/386] ET#78035 - [Docker] setup weekly 8.1 pipeline for server Change-Id: Ifb06ee8879a5487909bd53bb5f6ad6545e5eafbd --- mysql-server/VERSION | 2 +- mysql-server/gen_dockerfiles.sh | 60 ++++++++++++++------------------- 2 files changed, 27 insertions(+), 35 deletions(-) diff --git a/mysql-server/VERSION b/mysql-server/VERSION index 315c83d2e..3e9c5cf3a 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -18,7 +18,7 @@ WEEKLY_SHELL_VERSIONS["5.7"]=8.0.35 WEEKLY_SHELL_VERSIONS["8.0"]=8.0.35 WEEKLY_SHELL_VERSIONS["8.2"]=8.2.0 -MULTIARCH_VERSIONS=("8.0" "8.1") +MULTIARCH_VERSIONS=("8.0" "8.1" "8.2") SINGLEARCH_VERSIONS="5.7" LATEST="8.1" LATEST_INNOVATION="8.1" diff --git a/mysql-server/gen_dockerfiles.sh b/mysql-server/gen_dockerfiles.sh index 331009313..8eeafe02b 100755 --- a/mysql-server/gen_dockerfiles.sh +++ b/mysql-server/gen_dockerfiles.sh @@ -14,7 +14,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e - # This script will simply use sed to replace placeholder variables in the # files in template/ with version-specific variants. @@ -34,6 +33,12 @@ SHELL_VERSION=""; [ -n "$9" ] && SHELL_VERSION=$9 MYSQL_CONFIG_PKG_MINIMAL="mysql-community-minimal-release"; [ -n "${10}" ] && MYSQL_CONFIG_PKG_MINIMAL=${10} MYSQL_CONFIG_PKG="mysql80-community-release"; [ -n "${11}" ] && MYSQL_CONFIG_PKG=${11} +# Get the Major Version +MAJOR_VERSION=$(echo $MYSQL_VERSION | cut -d'.' -f'1,2') +if [[ $(awk -v ver="$MAJOR_VERSION" 'BEGIN{ if (ver >= 8.1) print "true" }') == "true" ]]; then + REPO_PATH="innovation" +fi + if [[ ${MYSQL_CONFIG_PKG_MINIMAL} =~ (community) ]]; then CONT_NAME="mysql-server" else @@ -42,43 +47,30 @@ fi # 33060 is the default port for the mysqlx plugin, new to 5.7 declare -A PORTS -PORTS["5.7"]="3306 33060" -PORTS["8.0"]="3306 33060 33061" -PORTS["$LATEST_INNOVATION"]="3306 33060 33061" - -declare -A PASSWORDSET -PASSWORDSET["5.7"]="ALTER USER 'root'@'localhost' IDENTIFIED BY '\${MYSQL_ROOT_PASSWORD}';" -PASSWORDSET["8.0"]=${PASSWORDSET["5.7"]} -PASSWORDSET["$LATEST_INNOVATION"]=${PASSWORDSET["8.0"]} - # MySQL 8.0 supports a call to validate the config, while older versions have it as a side # effect of running --verbose --help declare -A VALIDATE_CONFIG -VALIDATE_CONFIG["5.7"]="output=\$(\"\$@\" --verbose --help 2>\&1 > /dev/null) || result=\$?" -VALIDATE_CONFIG["8.0"]="output=\$(\"\$@\" --validate-config) || result=\$?" -VALIDATE_CONFIG["$LATEST_INNOVATION"]="output=\$(\"\$@\" --validate-config) || result=\$?" - # Data directories that must be created with special ownership and permissions when the image is built declare -A PRECREATE_DIRS -PRECREATE_DIRS["5.7"]="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" -PRECREATE_DIRS["8.0"]="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" -PRECREATE_DIRS["$LATEST_INNOVATION"]="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" +PRECREATE_DIRS="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" declare -A DOCKERFILE_TEMPLATES -DOCKERFILE_TEMPLATES["5.7"]="template/Dockerfile-pre8" -DOCKERFILE_TEMPLATES["8.0"]="template/Dockerfile" -DOCKERFILE_TEMPLATES["$LATEST_INNOVATION"]="template/Dockerfile" -declare -A SPEC_PORTS -SPEC_PORTS["5.7"]="3306/tcp, 33060/tcp" -SPEC_PORTS["8.0"]="3306/tcp, 33060-33061/tcp" -SPEC_PORTS["$LATEST_INNOVATION"]="3306/tcp, 33060-33061/tcp" +declare -A PASSWORDSET +PASSWORDSET="ALTER USER 'root'@'localhost' IDENTIFIED BY '\${MYSQL_ROOT_PASSWORD}';" +declare -A SPEC_PORTS -# Get the Major Version -MAJOR_VERSION=$(echo $MYSQL_VERSION | cut -d'.' -f'1,2') -if [[ $(awk -v ver="$MAJOR_VERSION" 'BEGIN{ if (ver >= 8.1) print "true" }') == "true" ]]; then - REPO_PATH="innovation" +if [[ $MAJOR_VERSION == "5.7" ]]; then + PORTS="3306 33060" + VALIDATE_CONFIG="output=\$(\"\$@\" --verbose --help 2>\&1 > /dev/null) || result=\$?" + DOCKERFILE_TEMPLATES="template/Dockerfile-pre8" + SPEC_PORTS="3306/tcp, 33060/tcp" +else + PORTS="3306 33060 33061" + VALIDATE_CONFIG="output=\$(\"\$@\" --validate-config) || result=\$?" + DOCKERFILE_TEMPLATES="template/Dockerfile" + SPEC_PORTS="3306/tcp, 33060-33061/tcp" fi if [ ! -d "${MAJOR_VERSION}" ]; then @@ -89,7 +81,7 @@ MYSQL_SERVER_PACKAGE=${MYSQL_SERVER_PACKAGE_NAME}-${MYSQL_VERSION} MYSQL_SHELL_PACKAGE=${MYSQL_SHELL_PACKAGE_NAME}-${SHELL_VERSION} # Dockerfiles -sed 's#%%MYSQL_SERVER_PACKAGE%%#'"${MYSQL_SERVER_PACKAGE}"'#g' ${DOCKERFILE_TEMPLATES[${MAJOR_VERSION}]} > tmpfile +sed 's#%%MYSQL_SERVER_PACKAGE%%#'"${MYSQL_SERVER_PACKAGE}"'#g' ${DOCKERFILE_TEMPLATES} > tmpfile sed -i 's#%%REPO%%#'"${REPO}"'#g' tmpfile sed -i 's#%%CONFIG_PACKAGE_NAME%%#'"${CONFIG_PACKAGE_NAME}"'#g' tmpfile sed -i 's#%%CONFIG_PACKAGE_NAME_MINIMAL%%#'"${CONFIG_PACKAGE_NAME_MINIMAL}"'#g' tmpfile @@ -101,7 +93,7 @@ sed -i 's#%%MYSQL_SHELL_PACKAGE%%#'"${MYSQL_SHELL_PACKAGE}"'#g' tmpfile sed -i 's#%%MYSQL_CONFIG_PKG_MINIMAL%%#'"${MYSQL_CONFIG_PKG_MINIMAL}"'#g' tmpfile sed -i 's#%%MYSQL_CONFIG_PKG%%#'"${MYSQL_CONFIG_PKG}"'#g' tmpfile -sed -i 's/%%PORTS%%/'"${PORTS[${MAJOR_VERSION}]}"'/g' tmpfile +sed -i 's/%%PORTS%%/'"${PORTS}"'/g' tmpfile mv tmpfile ${MAJOR_VERSION}/Dockerfile # Dockerfile_spec.rb @@ -111,14 +103,14 @@ sed -i 's#%%MYSQL_SERVER_PACKAGE_NAME%%#'"${MYSQL_SERVER_PACKAGE_NAME}"'#g' tmpF sed -i 's#%%MYSQL_SHELL_PACKAGE_NAME%%#'"${MYSQL_SHELL_PACKAGE_NAME}"'#g' tmpFile sed -i 's#%%MAJOR_VERSION%%#'"${MAJOR_VERSION}"'#g' tmpFile sed -i 's#%%CONT_NAME%%#'"${CONT_NAME}"'#g' tmpFile -sed -i 's#%%PORTS%%#'"${SPEC_PORTS[${MAJOR_VERSION}]}"'#g' tmpFile +sed -i 's#%%PORTS%%#'"${SPEC_PORTS}"'#g' tmpFile mv tmpFile "${MAJOR_VERSION}/inspec/control.rb" # Entrypoint FULL_SERVER_VERSION="$MYSQL_VERSION-${IMAGE_VERSION}" -sed 's#%%PASSWORDSET%%#'"${PASSWORDSET[${MAJOR_VERSION}]}"'#g' template/docker-entrypoint.sh > tmpfile +sed 's#%%PASSWORDSET%%#'"${PASSWORDSET}"'#g' template/docker-entrypoint.sh > tmpfile sed -i 's#%%FULL_SERVER_VERSION%%#'"${FULL_SERVER_VERSION}"'#g' tmpfile -sed -i 's#%%VALIDATE_CONFIG%%#'"${VALIDATE_CONFIG[${MAJOR_VERSION}]}"'#g' tmpfile +sed -i 's#%%VALIDATE_CONFIG%%#'"${VALIDATE_CONFIG}"'#g' tmpfile mv tmpfile ${MAJOR_VERSION}/docker-entrypoint.sh chmod +x ${MAJOR_VERSION}/docker-entrypoint.sh @@ -127,6 +119,6 @@ cp template/healthcheck.sh ${MAJOR_VERSION}/ chmod +x ${MAJOR_VERSION}/healthcheck.sh # Build-time preparation script -sed 's#%%PRECREATE_DIRS%%#'"${PRECREATE_DIRS[${MAJOR_VERSION}]}"'#g' template/prepare-image.sh > tmpfile +sed 's#%%PRECREATE_DIRS%%#'"${PRECREATE_DIRS}"'#g' template/prepare-image.sh > tmpfile mv tmpfile ${MAJOR_VERSION}/prepare-image.sh chmod +x ${MAJOR_VERSION}/prepare-image.sh From 4c40e440e96faef6bfdf1b1f3777bb8f9a0de2e0 Mon Sep 17 00:00:00 2001 From: Nawaz Nazeer Ahamed Date: Mon, 24 Jul 2023 09:41:30 +0200 Subject: [PATCH 320/386] ET#78579 - [Docker] Add 8.2 to multiarch versions Change-Id: I77198317e02440a4f5ef262104e8704412640b46 --- mysql-router/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-router/VERSION b/mysql-router/VERSION index 6dc42e03e..143712dc3 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -13,6 +13,6 @@ MYSQL_SERVER_VERSIONS["8.1"]=8.1.0 WEEKLY_SERVER_VERSIONS["8.0"]=8.0.35 WEEKLY_SERVER_VERSIONS["8.2"]=8.2.0 -MULTIARCH_VERSIONS=("8.0" "8.1") +MULTIARCH_VERSIONS=("8.0" "8.1" "8.2") LATEST="8.1" LATEST_INNOVATION="8.1" From f19b02e619c57564961139fd5b2a693954b7e63c Mon Sep 17 00:00:00 2001 From: Prashant Tekriwal Date: Wed, 30 Aug 2023 18:15:15 +0200 Subject: [PATCH 321/386] ET#78866 - Make server docker pipeline version agnostic Change-Id: I36b832f1f5894d83777f542b16b47e55f935a917 --- mysql-server/VERSION | 15 +++++++-------- mysql-server/build.sh | 15 ++++++++------- mysql-server/manifest.sh | 2 +- mysql-server/tag.sh | 34 ++++++++++++++-------------------- mysql-server/test.sh | 12 ++++++++---- 5 files changed, 38 insertions(+), 40 deletions(-) diff --git a/mysql-server/VERSION b/mysql-server/VERSION index 3e9c5cf3a..1e339488c 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,24 +1,23 @@ IMAGE_VERSION=1.2.13-server +LATEST="8.1" +LATEST_INNOVATION="8.1" declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["5.7"]=5.7.43 MYSQL_SERVER_VERSIONS["8.0"]=8.0.34 -MYSQL_SERVER_VERSIONS["8.1"]=8.1.0 +MYSQL_SERVER_VERSIONS["latest"]=8.1.0 WEEKLY_SERVER_VERSIONS["5.7"]=5.7.44 WEEKLY_SERVER_VERSIONS["8.0"]=8.0.35 -WEEKLY_SERVER_VERSIONS["8.2"]=8.2.0 +WEEKLY_SERVER_VERSIONS["latest"]=8.2.0 declare -A MYSQL_SHELL_VERSIONS WEEKLY_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["5.7"]=8.0.34 MYSQL_SHELL_VERSIONS["8.0"]=8.0.34 -MYSQL_SHELL_VERSIONS["8.1"]=8.1.0 +MYSQL_SHELL_VERSIONS["latest"]=8.1.0 WEEKLY_SHELL_VERSIONS["5.7"]=8.0.35 WEEKLY_SHELL_VERSIONS["8.0"]=8.0.35 -WEEKLY_SHELL_VERSIONS["8.2"]=8.2.0 +WEEKLY_SHELL_VERSIONS["latest"]=8.2.0 -MULTIARCH_VERSIONS=("8.0" "8.1" "8.2") -SINGLEARCH_VERSIONS="5.7" -LATEST="8.1" -LATEST_INNOVATION="8.1" +SINGLEARCH_VERSION="5.7" diff --git a/mysql-server/build.sh b/mysql-server/build.sh index 6338ad0fa..7547a5c1b 100755 --- a/mysql-server/build.sh +++ b/mysql-server/build.sh @@ -35,14 +35,15 @@ else fi for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do - for MULTIARCH_VERSION in "${MULTIARCH_VERSIONS[@]}"; do - if [[ "$MULTIARCH_VERSION" == "$MAJOR_VERSION" ]]; then - docker build --build-arg http_proxy="$http_proxy" --build-arg https_proxy="$http_proxy" --build-arg no_proxy="$no_proxy" -t $IMG_LOC:"$MAJOR_VERSION"-$ARCH "$MAJOR_VERSION" + if [[ "$BUILD_TYPE" =~ (weekly) ]]; then + SERVER_VERSION=${WEEKLY_SERVER_VERSIONS["${MAJOR_VERSION}"]} + else + SERVER_VERSION=${MYSQL_SERVER_VERSIONS["${MAJOR_VERSION}"]} fi - done - for SINGLEARCH_VERSION in $SINGLEARCH_VERSIONS; do - if [[ "$SINGLEARCH_VERSION" == "$MAJOR_VERSION" ]]; then + MAJOR_VERSION=${SERVER_VERSION%.*} + if [ "$SINGLEARCH_VERSION" == "$MAJOR_VERSION" ]; then docker build --build-arg http_proxy="$http_proxy" --build-arg https_proxy="$http_proxy" --build-arg no_proxy="$no_proxy" -t $IMG_LOC:"$MAJOR_VERSION" "$MAJOR_VERSION" + else + docker build --build-arg http_proxy="$http_proxy" --build-arg https_proxy="$http_proxy" --build-arg no_proxy="$no_proxy" -t $IMG_LOC:"$MAJOR_VERSION"-$ARCH "$MAJOR_VERSION" fi - done done diff --git a/mysql-server/manifest.sh b/mysql-server/manifest.sh index 873abf56d..767c7632b 100755 --- a/mysql-server/manifest.sh +++ b/mysql-server/manifest.sh @@ -32,7 +32,7 @@ if [[ "$REPO" =~ (weekly) ]]; then WEEKLY=1 fi -MANIFEST_VERSIONS=$(./tag.sh "" "$MAJOR_VERSIONS" "$WEEKLY") +MANIFEST_VERSIONS=$(./tag.sh "" "$WEEKLY" "${MAJOR_VERSIONS[@]}") echo ${MANIFEST_VERSIONS} for MANIFEST_VERSION in $MANIFEST_VERSIONS; do docker pull "$REPO:$MANIFEST_VERSION-arm64" "$REPO:$MANIFEST_VERSION-amd64" diff --git a/mysql-server/tag.sh b/mysql-server/tag.sh index 0e294fc48..816baaf8e 100755 --- a/mysql-server/tag.sh +++ b/mysql-server/tag.sh @@ -17,31 +17,25 @@ set -e source VERSION SUFFIX='' [ -n "$1" ] && SUFFIX=$1 -MAJOR_VERSIONS=("${!MYSQL_SERVER_VERSIONS[@]}"); [ -n "$2" ] && MAJOR_VERSIONS=("${@:2}") -WEEKLY='' [ -n "$3" ] && WEEKLY=$3 - +WEEKLY='' [ -n "$2" ] && WEEKLY=$2 +MAJOR_VERSIONS=("${!MYSQL_SERVER_VERSIONS[@]}"); [ -n "$3" ] && MAJOR_VERSIONS=("${@:3}") for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do - for MULTIARCH_VERSION in "${MULTIARCH_VERSIONS[@]}"; do - if [ "$WEEKLY" == "1" ]; then - SERVER_VERSION=${WEEKLY_SERVER_VERSIONS["${MAJOR_VERSION}"]} - else - SERVER_VERSION=${MYSQL_SERVER_VERSIONS["${MAJOR_VERSION}"]} - fi - FULL_SERVER_VERSION="${SERVER_VERSION}-${IMAGE_VERSION}" - if [[ "$MULTIARCH_VERSION" == "$MAJOR_VERSION" ]]; then + if [ "$WEEKLY" == "1" ]; then + SERVER_VERSION=${WEEKLY_SERVER_VERSIONS["${MAJOR_VERSION}"]} + else + SERVER_VERSION=${MYSQL_SERVER_VERSIONS["${MAJOR_VERSION}"]} + fi + MAJOR_VERSION=${SERVER_VERSION%.*} + FULL_SERVER_VERSION="${SERVER_VERSION}-${IMAGE_VERSION}" + if [[ "$SINGLEARCH_VERSION" == "$MAJOR_VERSION" ]]; then + TAGS="${MAJOR_VERSION} ${SERVER_VERSION} ${FULL_SERVER_VERSION}" + echo $TAGS + else TAGS="${MAJOR_VERSION}${SUFFIX} ${SERVER_VERSION}${SUFFIX} ${FULL_SERVER_VERSION}${SUFFIX}" if [[ "$MAJOR_VERSION" == "$LATEST" ]]; then TAGS="$TAGS latest${SUFFIX}" fi echo $TAGS - fi - done - - for SINGLEARCH_VERSION in $SINGLEARCH_VERSIONS; do - if [[ "$SINGLEARCH_VERSION" == "$MAJOR_VERSION" ]]; then - TAGS="${MAJOR_VERSION} ${SERVER_VERSION} ${FULL_SERVER_VERSION}" - echo $TAGS - fi - done + fi done diff --git a/mysql-server/test.sh b/mysql-server/test.sh index a0bff3014..f2de68818 100755 --- a/mysql-server/test.sh +++ b/mysql-server/test.sh @@ -34,6 +34,12 @@ BUILD_TYPE=community; [ -n "$2" ] && BUILD_TYPE=$2 MAJOR_VERSIONS=("${!MYSQL_SERVER_VERSIONS[@]}"); [ -n "$3" ] && MAJOR_VERSIONS=("${@:3}") for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do + if [[ "$BUILD_TYPE" =~ (weekly) ]]; then + SERVER_VERSION=${WEEKLY_SERVER_VERSIONS["${MAJOR_VERSION}"]} + else + SERVER_VERSION=${MYSQL_SERVER_VERSIONS["${MAJOR_VERSION}"]} + fi + MAJOR_VERSION=${SERVER_VERSION%.*} if [[ ${BUILD_TYPE} =~ (commercial) ]]; then IMG_LOC="store/oracle/mysql-enterprise-server" CONT_NAME="mysql-enterprise-server-$MAJOR_VERSION" @@ -42,11 +48,9 @@ for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do CONT_NAME="mysql-server-$MAJOR_VERSION" fi ARCH_SUFFIX="" - for MULTIARCH_VERSION in "${MULTIARCH_VERSIONS[@]}"; do - if [[ "$MULTIARCH_VERSION" == "$MAJOR_VERSION" ]]; then + if [ "$SINGLEARCH_VERSION" != "$MAJOR_VERSION" ]; then ARCH_SUFFIX="-$ARCH" - fi - done + fi podman run -d --rm --name $CONT_NAME "$IMG_LOC":"$MAJOR_VERSION$ARCH_SUFFIX" export DOCKER_HOST=unix:///tmp/podman.sock podman system service --time=0 ${DOCKER_HOST} & DOCKER_SOCK_PID="$!" From ed1324fd39df6e57cd7958b9ad26eab9c4f8219e Mon Sep 17 00:00:00 2001 From: Prashant Tekriwal Date: Thu, 31 Aug 2023 13:57:57 +0200 Subject: [PATCH 322/386] ET#78422 - [Docker] Make all RE pipelines version agnostic * ET#78865 - Make cluster docker pipeline version agnostic * ET#78867 - Make router docker pipeline version agnostic Change-Id: Idd19fec17410ba6024413a1f512f2c03cd7f3415 --- mysql-cluster/VERSION | 11 +++++------ mysql-cluster/build.sh | 2 ++ mysql-cluster/tag.sh | 5 ++++- mysql-cluster/test.sh | 2 ++ mysql-router/VERSION | 15 +++++++-------- mysql-router/build.sh | 9 ++++++++- mysql-router/manifest.sh | 2 +- mysql-router/tag.sh | 15 ++++++--------- mysql-router/test.sh | 9 ++++++++- mysql-server/gen_dockerfiles.sh | 6 +++--- 10 files changed, 46 insertions(+), 30 deletions(-) diff --git a/mysql-cluster/VERSION b/mysql-cluster/VERSION index cd1d75451..dd32b777a 100644 --- a/mysql-cluster/VERSION +++ b/mysql-cluster/VERSION @@ -1,22 +1,21 @@ IMAGE_VERSION=1.2.13-cluster +LATEST="8.1" +LATEST_INNOVATION="8.1" declare -A MYSQL_CLUSTER_VERSIONS MYSQL_CLUSTER_VERSIONS["7.5"]=7.5.31 MYSQL_CLUSTER_VERSIONS["7.6"]=7.6.27 MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.34 -MYSQL_CLUSTER_VERSIONS["8.1"]=8.1.0 +MYSQL_CLUSTER_VERSIONS["latest"]=8.1.0 declare -A MYSQL_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["7.5"]=8.0.34 MYSQL_SHELL_VERSIONS["7.6"]=8.0.34 MYSQL_SHELL_VERSIONS["8.0"]=8.0.34 -MYSQL_SHELL_VERSIONS["8.1"]=8.1.0 +MYSQL_SHELL_VERSIONS["latest"]=8.1.0 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["7.5"]="${MYSQL_CLUSTER_VERSIONS["7.5"]}-${IMAGE_VERSION}" FULL_SERVER_VERSIONS["7.6"]="${MYSQL_CLUSTER_VERSIONS["7.6"]}-${IMAGE_VERSION}" FULL_SERVER_VERSIONS["8.0"]="${MYSQL_CLUSTER_VERSIONS["8.0"]}-${IMAGE_VERSION}" -FULL_SERVER_VERSIONS["8.1"]="${MYSQL_CLUSTER_VERSIONS["8.1"]}-${IMAGE_VERSION}" - -LATEST="8.1" -LATEST_INNOVATION="8.1" +FULL_SERVER_VERSIONS["latest"]="${MYSQL_CLUSTER_VERSIONS["latest"]}-${IMAGE_VERSION}" diff --git a/mysql-cluster/build.sh b/mysql-cluster/build.sh index 637aea955..3f756d9c2 100755 --- a/mysql-cluster/build.sh +++ b/mysql-cluster/build.sh @@ -19,5 +19,7 @@ source ./VERSION MAJOR_VERSIONS=("${!MYSQL_CLUSTER_VERSIONS[@]}"); [ -n "$1" ] && MAJOR_VERSIONS=("${@:1}") for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do + CLUSTER_VERSION=${MYSQL_CLUSTER_VERSIONS[$MAJOR_VERSION]} + MAJOR_VERSION=${CLUSTER_VERSION%.*} docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$http_proxy --build-arg no_proxy=$no_proxy -t mysql/mysql-cluster:$MAJOR_VERSION $MAJOR_VERSION done diff --git a/mysql-cluster/tag.sh b/mysql-cluster/tag.sh index ada5bdb79..1db40056c 100755 --- a/mysql-cluster/tag.sh +++ b/mysql-cluster/tag.sh @@ -19,7 +19,10 @@ source VERSION MAJOR_VERSIONS=("${!MYSQL_CLUSTER_VERSIONS[@]}"); [ -n "$1" ] && MAJOR_VERSIONS=("${@:1}") for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do - TAGS="$MAJOR_VERSION ${MYSQL_CLUSTER_VERSIONS[$MAJOR_VERSION]} ${FULL_SERVER_VERSIONS[$MAJOR_VERSION]}" + CLUSTER_VERSION=${MYSQL_CLUSTER_VERSIONS[$MAJOR_VERSION]} + FULL_VERSION=${FULL_SERVER_VERSIONS[$MAJOR_VERSION]} + MAJOR_VERSION=${CLUSTER_VERSION%.*} + TAGS="$MAJOR_VERSION $CLUSTER_VERSION $FULL_VERSION" if [ "$MAJOR_VERSION" = "$LATEST" ]; then TAGS="latest $TAGS" diff --git a/mysql-cluster/test.sh b/mysql-cluster/test.sh index 5ea6a0122..aa1e95a61 100755 --- a/mysql-cluster/test.sh +++ b/mysql-cluster/test.sh @@ -23,6 +23,8 @@ source VERSION MAJOR_VERSIONS=("${!MYSQL_CLUSTER_VERSIONS[@]}"); [ -n "$1" ] && MAJOR_VERSIONS=("${@:1}") for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do + CLUSTER_VERSION=${MYSQL_CLUSTER_VERSIONS[$MAJOR_VERSION]} + MAJOR_VERSION=${CLUSTER_VERSION%.*} podman run -d --rm --name "mysql-cluster-$MAJOR_VERSION" "mysql/mysql-cluster:$MAJOR_VERSION" export DOCKER_HOST=unix:///tmp/podman.sock podman system service --time=0 ${DOCKER_HOST} & DOCKER_SOCK_PID="$!" diff --git a/mysql-router/VERSION b/mysql-router/VERSION index 143712dc3..052774d36 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -1,18 +1,17 @@ IMAGE_VERSION=1.0.13-router +LATEST="8.1" +LATEST_INNOVATION="8.1" + declare -A MYSQL_ROUTER_VERSIONS WEEKLY_ROUTER_VERSIONS MYSQL_ROUTER_VERSIONS["8.0"]=8.0.34 -MYSQL_ROUTER_VERSIONS["8.1"]=8.1.0 +MYSQL_ROUTER_VERSIONS["latest"]=8.1.0 WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.35 -WEEKLY_ROUTER_VERSIONS["8.2"]=8.2.0 +WEEKLY_ROUTER_VERSIONS["latest"]=8.2.0 declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["8.0"]=8.0.34 -MYSQL_SERVER_VERSIONS["8.1"]=8.1.0 +MYSQL_SERVER_VERSIONS["latest"]=8.1.0 WEEKLY_SERVER_VERSIONS["8.0"]=8.0.35 -WEEKLY_SERVER_VERSIONS["8.2"]=8.2.0 - -MULTIARCH_VERSIONS=("8.0" "8.1" "8.2") -LATEST="8.1" -LATEST_INNOVATION="8.1" +WEEKLY_SERVER_VERSIONS["latest"]=8.2.0 diff --git a/mysql-router/build.sh b/mysql-router/build.sh index c79816235..faff82aca 100755 --- a/mysql-router/build.sh +++ b/mysql-router/build.sh @@ -17,8 +17,15 @@ set -e source ./VERSION ARCH=amd64; [ -n "$1" ] && ARCH=$1 -MAJOR_VERSIONS=("${!MYSQL_ROUTER_VERSIONS[@]}"); [ -n "$2" ] && MAJOR_VERSIONS=("${@:2}") +WEEKLY=''; [ -n "$2" ] && WEEKLY=$2 +MAJOR_VERSIONS=("${!MYSQL_ROUTER_VERSIONS[@]}"); [ -n "$3" ] && MAJOR_VERSIONS=("${@:3}") for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do + if [ "$WEEKLY" == "1" ]; then + ROUTER_VERSION=${WEEKLY_ROUTER_VERSIONS["${MAJOR_VERSION}"]} + else + ROUTER_VERSION=${MYSQL_ROUTER_VERSIONS["${MAJOR_VERSION}"]} + fi + MAJOR_VERSION=${ROUTER_VERSION%.*} docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$http_proxy --build-arg no_proxy=$no_proxy -t mysql/mysql-router:$MAJOR_VERSION-$ARCH $MAJOR_VERSION done diff --git a/mysql-router/manifest.sh b/mysql-router/manifest.sh index 25b8da87d..a0415dac7 100755 --- a/mysql-router/manifest.sh +++ b/mysql-router/manifest.sh @@ -33,7 +33,7 @@ if [[ "$REPO" =~ (weekly) ]]; then WEEKLY=1 fi -MANIFEST_VERSIONS=$(./tag.sh "" "$MAJOR_VERSIONS" "$WEEKLY") +MANIFEST_VERSIONS=$(./tag.sh "" "$WEEKLY" "${MAJOR_VERSIONS[@]}") for MANIFEST_VERSION in $MANIFEST_VERSIONS; do docker pull "$REPO:$MANIFEST_VERSION-arm64" "$REPO:$MANIFEST_VERSION-amd64" docker manifest create "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-arm64" "$REPO:$MANIFEST_VERSION-amd64" diff --git a/mysql-router/tag.sh b/mysql-router/tag.sh index 36526657e..5e35f7527 100755 --- a/mysql-router/tag.sh +++ b/mysql-router/tag.sh @@ -5,23 +5,20 @@ set -e source VERSION SUFFIX='' [ -n "$1" ] && SUFFIX=$1 -MAJOR_VERSIONS=("${!MYSQL_ROUTER_VERSIONS[@]}"); [ -n "$2" ] && MAJOR_VERSIONS=("${@:2}") -WEEKLY='' [ -n "$3" ] && WEEKLY=$3 +WEEKLY='' [ -n "$2" ] && WEEKLY=$2 +MAJOR_VERSIONS=("${!MYSQL_ROUTER_VERSIONS[@]}"); [ -n "$3" ] && MAJOR_VERSIONS=("${@:3}") for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do - for MULTIARCH_VERSION in "${MULTIARCH_VERSIONS[@]}"; do if [ "$WEEKLY" == "1" ]; then ROUTER_VERSION=${WEEKLY_ROUTER_VERSIONS["${MAJOR_VERSION}"]} else ROUTER_VERSION=${MYSQL_ROUTER_VERSIONS["${MAJOR_VERSION}"]} fi FULL_ROUTER_VERSION="${ROUTER_VERSION}-${IMAGE_VERSION}" - if [[ "$MULTIARCH_VERSION" == "$MAJOR_VERSION" ]]; then - TAGS="${MAJOR_VERSION}${SUFFIX} ${ROUTER_VERSION}${SUFFIX} ${FULL_ROUTER_VERSION}${SUFFIX}" - if [[ "$MAJOR_VERSION" == "$LATEST" ]]; then + MAJOR_VERSION=${ROUTER_VERSION%.*} + TAGS="${MAJOR_VERSION}${SUFFIX} ${ROUTER_VERSION}${SUFFIX} ${FULL_ROUTER_VERSION}${SUFFIX}" + if [[ "$MAJOR_VERSION" == "$LATEST" ]]; then TAGS="$TAGS latest${SUFFIX}" - fi - echo $TAGS fi - done + echo $TAGS done diff --git a/mysql-router/test.sh b/mysql-router/test.sh index ae01fc845..1dc8e1cdf 100755 --- a/mysql-router/test.sh +++ b/mysql-router/test.sh @@ -21,9 +21,16 @@ set -e source ./VERSION ARCH=amd64; [ -n "$1" ] && ARCH=$1 -MAJOR_VERSIONS=("${!MYSQL_SERVER_VERSIONS[@]}"); [ -n "$2" ] && MAJOR_VERSIONS=("${@:2}") +WEEKLY=''; [ -n "$2" ] && WEEKLY=$2 +MAJOR_VERSIONS=("${!MYSQL_ROUTER_VERSIONS[@]}"); [ -n "$3" ] && MAJOR_VERSIONS=("${@:3}") for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do + if [ "$WEEKLY" == "1" ]; then + ROUTER_VERSION=${WEEKLY_ROUTER_VERSIONS["${MAJOR_VERSION}"]} + else + ROUTER_VERSION=${MYSQL_ROUTER_VERSIONS["${MAJOR_VERSION}"]} + fi + MAJOR_VERSION=${ROUTER_VERSION%.*} podman run -d --rm -e MYSQL_HOST=x -e MYSQL_PORT=9 -e MYSQL_USER=x -e MYSQL_PASSWORD=x -e MYSQL_INNODB_CLUSTER_MEMBERS=1 --name "mysql-router-$MAJOR_VERSION" mysql/mysql-router:$MAJOR_VERSION-$ARCH sleep 5000 export DOCKER_HOST=unix:///tmp/podman.sock podman system service --time=0 ${DOCKER_HOST} & DOCKER_SOCK_PID="$!" diff --git a/mysql-server/gen_dockerfiles.sh b/mysql-server/gen_dockerfiles.sh index 8eeafe02b..f7696d824 100755 --- a/mysql-server/gen_dockerfiles.sh +++ b/mysql-server/gen_dockerfiles.sh @@ -34,9 +34,9 @@ MYSQL_CONFIG_PKG_MINIMAL="mysql-community-minimal-release"; [ -n "${10}" ] && MY MYSQL_CONFIG_PKG="mysql80-community-release"; [ -n "${11}" ] && MYSQL_CONFIG_PKG=${11} # Get the Major Version -MAJOR_VERSION=$(echo $MYSQL_VERSION | cut -d'.' -f'1,2') -if [[ $(awk -v ver="$MAJOR_VERSION" 'BEGIN{ if (ver >= 8.1) print "true" }') == "true" ]]; then - REPO_PATH="innovation" +MAJOR_VERSION=${MYSQL_VERSION%.*} +if [ $MAJOR_VERSION == $LATEST_INNOVATION ]; then + REPO_PATH="innovation" fi if [[ ${MYSQL_CONFIG_PKG_MINIMAL} =~ (community) ]]; then From a08c63766ab7d8000a0ec00949baf6ecd949ae1c Mon Sep 17 00:00:00 2001 From: Karen Langford Date: Mon, 11 Sep 2023 10:44:58 +0200 Subject: [PATCH 323/386] ET#78947: Bump versions for 8.2.0/8.0.35 Docker releases Change-Id: I1a5860efeaf7c690e08ff10549a9fe8943f238e5 --- mysql-cluster/VERSION | 22 +++++++++++----------- mysql-router/VERSION | 14 +++++++------- mysql-server/VERSION | 18 +++++++++--------- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/mysql-cluster/VERSION b/mysql-cluster/VERSION index dd32b777a..f4ec75551 100644 --- a/mysql-cluster/VERSION +++ b/mysql-cluster/VERSION @@ -1,18 +1,18 @@ -IMAGE_VERSION=1.2.13-cluster -LATEST="8.1" -LATEST_INNOVATION="8.1" +IMAGE_VERSION=1.2.14-cluster +LATEST="8.2" +LATEST_INNOVATION="8.2" declare -A MYSQL_CLUSTER_VERSIONS -MYSQL_CLUSTER_VERSIONS["7.5"]=7.5.31 -MYSQL_CLUSTER_VERSIONS["7.6"]=7.6.27 -MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.34 -MYSQL_CLUSTER_VERSIONS["latest"]=8.1.0 +MYSQL_CLUSTER_VERSIONS["7.5"]=7.5.32 +MYSQL_CLUSTER_VERSIONS["7.6"]=7.6.28 +MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.35 +MYSQL_CLUSTER_VERSIONS["latest"]=8.2.0 declare -A MYSQL_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["7.5"]=8.0.34 -MYSQL_SHELL_VERSIONS["7.6"]=8.0.34 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.34 -MYSQL_SHELL_VERSIONS["latest"]=8.1.0 +MYSQL_SHELL_VERSIONS["7.5"]=8.0.35 +MYSQL_SHELL_VERSIONS["7.6"]=8.0.35 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.35 +MYSQL_SHELL_VERSIONS["latest"]=8.2.0 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["7.5"]="${MYSQL_CLUSTER_VERSIONS["7.5"]}-${IMAGE_VERSION}" diff --git a/mysql-router/VERSION b/mysql-router/VERSION index 052774d36..966a8453d 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -1,17 +1,17 @@ -IMAGE_VERSION=1.0.13-router -LATEST="8.1" -LATEST_INNOVATION="8.1" +IMAGE_VERSION=1.0.14-router +LATEST="8.2" +LATEST_INNOVATION="8.2" declare -A MYSQL_ROUTER_VERSIONS WEEKLY_ROUTER_VERSIONS -MYSQL_ROUTER_VERSIONS["8.0"]=8.0.34 -MYSQL_ROUTER_VERSIONS["latest"]=8.1.0 +MYSQL_ROUTER_VERSIONS["8.0"]=8.0.35 +MYSQL_ROUTER_VERSIONS["latest"]=8.2.0 WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.35 WEEKLY_ROUTER_VERSIONS["latest"]=8.2.0 declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["8.0"]=8.0.34 -MYSQL_SERVER_VERSIONS["latest"]=8.1.0 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.35 +MYSQL_SERVER_VERSIONS["latest"]=8.2.0 WEEKLY_SERVER_VERSIONS["8.0"]=8.0.35 WEEKLY_SERVER_VERSIONS["latest"]=8.2.0 diff --git a/mysql-server/VERSION b/mysql-server/VERSION index 1e339488c..1af34fb84 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,20 +1,20 @@ -IMAGE_VERSION=1.2.13-server -LATEST="8.1" -LATEST_INNOVATION="8.1" +IMAGE_VERSION=1.2.14-server +LATEST="8.2" +LATEST_INNOVATION="8.2" declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["5.7"]=5.7.43 -MYSQL_SERVER_VERSIONS["8.0"]=8.0.34 -MYSQL_SERVER_VERSIONS["latest"]=8.1.0 +MYSQL_SERVER_VERSIONS["5.7"]=5.7.44 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.35 +MYSQL_SERVER_VERSIONS["latest"]=8.2.0 WEEKLY_SERVER_VERSIONS["5.7"]=5.7.44 WEEKLY_SERVER_VERSIONS["8.0"]=8.0.35 WEEKLY_SERVER_VERSIONS["latest"]=8.2.0 declare -A MYSQL_SHELL_VERSIONS WEEKLY_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["5.7"]=8.0.34 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.34 -MYSQL_SHELL_VERSIONS["latest"]=8.1.0 +MYSQL_SHELL_VERSIONS["5.7"]=8.0.35 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.35 +MYSQL_SHELL_VERSIONS["latest"]=8.2.0 WEEKLY_SHELL_VERSIONS["5.7"]=8.0.35 WEEKLY_SHELL_VERSIONS["8.0"]=8.0.35 From ac91398028436b28674aa1615d1450588f245965 Mon Sep 17 00:00:00 2001 From: Nawaz Nazeer Ahamed Date: Tue, 19 Sep 2023 10:35:30 +0200 Subject: [PATCH 324/386] Update weekly pipeline - versions Change-Id: Ia62d6a4fc6022bfd36e7e362b3faba3d6864e834 --- mysql-router/VERSION | 8 ++++---- mysql-server/VERSION | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/mysql-router/VERSION b/mysql-router/VERSION index 966a8453d..9bdcd7350 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -6,12 +6,12 @@ declare -A MYSQL_ROUTER_VERSIONS WEEKLY_ROUTER_VERSIONS MYSQL_ROUTER_VERSIONS["8.0"]=8.0.35 MYSQL_ROUTER_VERSIONS["latest"]=8.2.0 -WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.35 -WEEKLY_ROUTER_VERSIONS["latest"]=8.2.0 +WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.36 +WEEKLY_ROUTER_VERSIONS["latest"]=8.3.0 declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["8.0"]=8.0.35 MYSQL_SERVER_VERSIONS["latest"]=8.2.0 -WEEKLY_SERVER_VERSIONS["8.0"]=8.0.35 -WEEKLY_SERVER_VERSIONS["latest"]=8.2.0 +WEEKLY_SERVER_VERSIONS["8.0"]=8.0.36 +WEEKLY_SERVER_VERSIONS["latest"]=8.3.0 diff --git a/mysql-server/VERSION b/mysql-server/VERSION index 1af34fb84..7b9e401b0 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -7,17 +7,17 @@ MYSQL_SERVER_VERSIONS["5.7"]=5.7.44 MYSQL_SERVER_VERSIONS["8.0"]=8.0.35 MYSQL_SERVER_VERSIONS["latest"]=8.2.0 -WEEKLY_SERVER_VERSIONS["5.7"]=5.7.44 -WEEKLY_SERVER_VERSIONS["8.0"]=8.0.35 -WEEKLY_SERVER_VERSIONS["latest"]=8.2.0 +WEEKLY_SERVER_VERSIONS["5.7"]=5.7.45 +WEEKLY_SERVER_VERSIONS["8.0"]=8.0.36 +WEEKLY_SERVER_VERSIONS["latest"]=8.3.0 declare -A MYSQL_SHELL_VERSIONS WEEKLY_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["5.7"]=8.0.35 MYSQL_SHELL_VERSIONS["8.0"]=8.0.35 MYSQL_SHELL_VERSIONS["latest"]=8.2.0 -WEEKLY_SHELL_VERSIONS["5.7"]=8.0.35 -WEEKLY_SHELL_VERSIONS["8.0"]=8.0.35 -WEEKLY_SHELL_VERSIONS["latest"]=8.2.0 +WEEKLY_SHELL_VERSIONS["5.7"]=8.0.36 +WEEKLY_SHELL_VERSIONS["8.0"]=8.0.36 +WEEKLY_SHELL_VERSIONS["latest"]=8.3.0 SINGLEARCH_VERSION="5.7" From b7fd96986620cefa3fc78d278856d2ede43a7bfa Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Thu, 26 Oct 2023 06:26:16 +0000 Subject: [PATCH 325/386] Release version 1.2.14-server * Update weekly pipeline - versions * ET#78947: Bump versions for 8.2.0/8.0.35 Docker releases * ET#78422 - [Docker] Make all RE pipelines version agnostic * ET#78866 - Make server docker pipeline version agnostic * ET#78035 - [Docker] setup weekly 8.1 pipeline for server * Server - Fix test script - container name update * Release version 1.2.13-server * Bumped image version for July cycle * ET#78138 - [Docker] Add support for 8.1 in Docker router & Server * ET#78090 - Added support for 8.1 version * ET#77992 - Update docker main repo - support 5.7 commercial builds * ET#72314 - [Follow-up] Override default user command option in yum * ET#72314 - [Follow-up] Fix docker run cmd usage * ET#72314 - [Follow-up] Fix to use correct positional arguments * ET#72314 - Clean up repo config after build * ET#77897 - Add MAJOR_VERSION tag for docker builds i.e. 8.0 or 5.7 * ET#77853 - Fix router version used in manifest task for weekly builds * Revert "Revert "Fix for ET#77620, 77619, 77611, 70570"" --- mysql-server/8.2/Dockerfile | 45 ++++ mysql-server/8.2/docker-entrypoint.sh | 230 ++++++++++++++++++ mysql-server/8.2/healthcheck.sh | 24 ++ mysql-server/8.2/inspec/control.rb | 20 ++ mysql-server/8.2/prepare-image.sh | 25 ++ .../Dockerfile | 45 ++++ .../docker-entrypoint.sh | 230 ++++++++++++++++++ .../healthcheck.sh | 24 ++ .../inspec/control.rb | 20 ++ .../prepare-image.sh | 25 ++ 10 files changed, 688 insertions(+) create mode 100644 mysql-server/8.2/Dockerfile create mode 100755 mysql-server/8.2/docker-entrypoint.sh create mode 100755 mysql-server/8.2/healthcheck.sh create mode 100644 mysql-server/8.2/inspec/control.rb create mode 100755 mysql-server/8.2/prepare-image.sh create mode 100644 mysql-server/mysql-community-minimal-release/Dockerfile create mode 100755 mysql-server/mysql-community-minimal-release/docker-entrypoint.sh create mode 100755 mysql-server/mysql-community-minimal-release/healthcheck.sh create mode 100644 mysql-server/mysql-community-minimal-release/inspec/control.rb create mode 100755 mysql-server/mysql-community-minimal-release/prepare-image.sh diff --git a/mysql-server/8.2/Dockerfile b/mysql-server/8.2/Dockerfile new file mode 100644 index 000000000..ded012dd8 --- /dev/null +++ b/mysql-server/8.2/Dockerfile @@ -0,0 +1,45 @@ +# Copyright (c) 2017, 2023, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +FROM container-registry.oracle.com/os/oraclelinux:8-slim + +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.2.0 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.2.0 + +# Setup repositories for minimal packages (all versions) +RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el8.rpm \ + && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql80-community-release-el8.rpm + +# Install server and shell 8.0 +RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ + && microdnf install -y --enablerepo=mysql-tools-community $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --disablerepo=ol8_appstream \ + --enablerepo=mysqllatest-community-minimal $MYSQL_SERVER_PACKAGE \ + && microdnf remove mysql-community-minimal-release mysql80-community-release \ + && microdnf clean all \ + && mkdir /docker-entrypoint-initdb.d + +COPY prepare-image.sh / +RUN /prepare-image.sh && rm -f /prepare-image.sh + +ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock + +COPY docker-entrypoint.sh /entrypoint.sh +COPY healthcheck.sh /healthcheck.sh +ENTRYPOINT ["/entrypoint.sh"] +HEALTHCHECK CMD /healthcheck.sh +EXPOSE 3306 33060 33061 +CMD ["mysqld"] + diff --git a/mysql-server/8.2/docker-entrypoint.sh b/mysql-server/8.2/docker-entrypoint.sh new file mode 100755 index 000000000..0de06ba24 --- /dev/null +++ b/mysql-server/8.2/docker-entrypoint.sh @@ -0,0 +1,230 @@ +#!/bin/bash +# Copyright (c) 2017, 2021, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +echo "[Entrypoint] MySQL Docker Image 8.2.0-1.2.14-server" +# Fetch value from server config +# We use mysqld --verbose --help instead of my_print_defaults because the +# latter only show values present in config files, and not server defaults +_get_config() { + local conf="$1"; shift + "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' +} + +# Generate a random password +_mkpw() { + letter=$(cat /dev/urandom| tr -dc a-zA-Z | dd bs=1 count=16 2> /dev/null ) + number=$(cat /dev/urandom| tr -dc 0-9 | dd bs=1 count=8 2> /dev/null) + special=$(cat /dev/urandom| tr -dc '=+@#%^&*_.,;:?/' | dd bs=1 count=8 2> /dev/null) + + echo $letter$number$special | fold -w 1 | shuf | tr -d '\n' +} + +# If command starts with an option, prepend mysqld +# This allows users to add command-line options without +# needing to specify the "mysqld" command +if [ "${1:0:1}" = '-' ]; then + set -- mysqld "$@" +fi + +# Check if entrypoint (and the container) is running as root +if [ $(id -u) = "0" ]; then + is_root=1 + install_devnull="install /dev/null -m0600 -omysql -gmysql" + MYSQLD_USER=mysql +else + install_devnull="install /dev/null -m0600" + MYSQLD_USER=$(id -u) +fi + +if [ "$1" = 'mysqld' ]; then + # Test that the server can start. We redirect stdout to /dev/null so + # only the error messages are left. + result=0 + output=$("$@" --validate-config) || result=$? + if [ ! "$result" = "0" ]; then + echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' + echo >&2 "[Entrypoint] $output" + exit 1 + fi + + # Get config + DATADIR="$(_get_config 'datadir' "$@")" + SOCKET="$(_get_config 'socket' "$@")" + + if [ ! -d "$DATADIR/mysql" ]; then + # If the password variable is a filename we use the contents of the file. We + # read this first to make sure that a proper error is generated for empty files. + if [ -f "$MYSQL_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + if [ -z "$MYSQL_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' + exit 1 + fi + fi + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] No password option specified for new database.' + echo >&2 '[Entrypoint] A random onetime password will be generated.' + MYSQL_RANDOM_ROOT_PASSWORD=true + MYSQL_ONETIME_PASSWORD=true + fi + if [ ! -d "$DATADIR" ]; then + mkdir -p "$DATADIR" + chown mysql:mysql "$DATADIR" + fi + + # The user can set a default_timezone either in a my.cnf file + # they mount into the container or on command line + # (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`) + # however the timezone tables will only be populated in a later + # stage of this script. By using +00:00 as timezone we override + # the user's choice during initialization. Later the server + # will be restarted using the user's option. + + echo '[Entrypoint] Initializing database' + "$@" --user=$MYSQLD_USER --initialize-insecure --default-time-zone=+00:00 + + echo '[Entrypoint] Database initialized' + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" --default-time-zone=+00:00 + + # To avoid using password on commandline, put it in a temporary file. + # The file is only populated when and if the root password is set. + PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + $install_devnull "$PASSFILE" + # Define the client command used throughout the script + # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") + + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break + fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 + fi + + mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql + + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(_mkpw)" + echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + fi + if [ -z "$MYSQL_ROOT_HOST" ]; then + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';" + else + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ + GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + fi + "${mysql[@]}" <<-EOSQL + DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; + ${ROOTCREATE} + FLUSH PRIVILEGES ; + EOSQL + if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then + # Put the password into the temporary config file + cat >"$PASSFILE" < "$SQL" +ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL + fi + + echo + echo '[Entrypoint] MySQL init process done. Ready for start up.' + echo + fi + + # Used by healthcheck to make sure it doesn't mistakenly report container + # healthy during startup + # Put the password into the temporary config file + touch /var/lib/mysql-files/healthcheck.cnf + cat >"/var/lib/mysql-files/healthcheck.cnf" < /etc/dnf/dnf.conf \ + && microdnf install -y --enablerepo=mysql-tools-community $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --disablerepo=ol8_appstream \ + --enablerepo=mysql5-community-minimal $MYSQL_SERVER_PACKAGE \ + && microdnf remove mysql-community-minimal-release mysql80-community-release \ + && microdnf clean all \ + && mkdir /docker-entrypoint-initdb.d + +COPY prepare-image.sh / +RUN /prepare-image.sh && rm -f /prepare-image.sh + +ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock + +COPY docker-entrypoint.sh /entrypoint.sh +COPY healthcheck.sh /healthcheck.sh +ENTRYPOINT ["/entrypoint.sh"] +HEALTHCHECK CMD /healthcheck.sh +EXPOSE 3306 33060 33061 +CMD ["mysqld"] + diff --git a/mysql-server/mysql-community-minimal-release/docker-entrypoint.sh b/mysql-server/mysql-community-minimal-release/docker-entrypoint.sh new file mode 100755 index 000000000..9d640c962 --- /dev/null +++ b/mysql-server/mysql-community-minimal-release/docker-entrypoint.sh @@ -0,0 +1,230 @@ +#!/bin/bash +# Copyright (c) 2017, 2021, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +echo "[Entrypoint] MySQL Docker Image mysql-community-minimal-release-1.2.14-server" +# Fetch value from server config +# We use mysqld --verbose --help instead of my_print_defaults because the +# latter only show values present in config files, and not server defaults +_get_config() { + local conf="$1"; shift + "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' +} + +# Generate a random password +_mkpw() { + letter=$(cat /dev/urandom| tr -dc a-zA-Z | dd bs=1 count=16 2> /dev/null ) + number=$(cat /dev/urandom| tr -dc 0-9 | dd bs=1 count=8 2> /dev/null) + special=$(cat /dev/urandom| tr -dc '=+@#%^&*_.,;:?/' | dd bs=1 count=8 2> /dev/null) + + echo $letter$number$special | fold -w 1 | shuf | tr -d '\n' +} + +# If command starts with an option, prepend mysqld +# This allows users to add command-line options without +# needing to specify the "mysqld" command +if [ "${1:0:1}" = '-' ]; then + set -- mysqld "$@" +fi + +# Check if entrypoint (and the container) is running as root +if [ $(id -u) = "0" ]; then + is_root=1 + install_devnull="install /dev/null -m0600 -omysql -gmysql" + MYSQLD_USER=mysql +else + install_devnull="install /dev/null -m0600" + MYSQLD_USER=$(id -u) +fi + +if [ "$1" = 'mysqld' ]; then + # Test that the server can start. We redirect stdout to /dev/null so + # only the error messages are left. + result=0 + output=$("$@" --validate-config) || result=$? + if [ ! "$result" = "0" ]; then + echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' + echo >&2 "[Entrypoint] $output" + exit 1 + fi + + # Get config + DATADIR="$(_get_config 'datadir' "$@")" + SOCKET="$(_get_config 'socket' "$@")" + + if [ ! -d "$DATADIR/mysql" ]; then + # If the password variable is a filename we use the contents of the file. We + # read this first to make sure that a proper error is generated for empty files. + if [ -f "$MYSQL_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + if [ -z "$MYSQL_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' + exit 1 + fi + fi + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] No password option specified for new database.' + echo >&2 '[Entrypoint] A random onetime password will be generated.' + MYSQL_RANDOM_ROOT_PASSWORD=true + MYSQL_ONETIME_PASSWORD=true + fi + if [ ! -d "$DATADIR" ]; then + mkdir -p "$DATADIR" + chown mysql:mysql "$DATADIR" + fi + + # The user can set a default_timezone either in a my.cnf file + # they mount into the container or on command line + # (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`) + # however the timezone tables will only be populated in a later + # stage of this script. By using +00:00 as timezone we override + # the user's choice during initialization. Later the server + # will be restarted using the user's option. + + echo '[Entrypoint] Initializing database' + "$@" --user=$MYSQLD_USER --initialize-insecure --default-time-zone=+00:00 + + echo '[Entrypoint] Database initialized' + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" --default-time-zone=+00:00 + + # To avoid using password on commandline, put it in a temporary file. + # The file is only populated when and if the root password is set. + PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + $install_devnull "$PASSFILE" + # Define the client command used throughout the script + # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") + + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break + fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 + fi + + mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql + + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(_mkpw)" + echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + fi + if [ -z "$MYSQL_ROOT_HOST" ]; then + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';" + else + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ + GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + fi + "${mysql[@]}" <<-EOSQL + DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; + ${ROOTCREATE} + FLUSH PRIVILEGES ; + EOSQL + if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then + # Put the password into the temporary config file + cat >"$PASSFILE" < "$SQL" +ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL + fi + + echo + echo '[Entrypoint] MySQL init process done. Ready for start up.' + echo + fi + + # Used by healthcheck to make sure it doesn't mistakenly report container + # healthy during startup + # Put the password into the temporary config file + touch /var/lib/mysql-files/healthcheck.cnf + cat >"/var/lib/mysql-files/healthcheck.cnf" < Date: Fri, 27 Oct 2023 12:59:54 +0000 Subject: [PATCH 326/386] Release version 1.2.14-server From f09ad27bf012215e7187fcc0d80ea1fe27d7e311 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Fri, 27 Oct 2023 14:08:26 +0000 Subject: [PATCH 327/386] Release version 1.2.14-server --- mysql-server/5.7/Dockerfile | 4 ++-- mysql-server/5.7/docker-entrypoint.sh | 4 ++-- mysql-server/5.7/inspec/control.rb | 4 ++-- mysql-server/8.0/Dockerfile | 4 ++-- mysql-server/8.0/docker-entrypoint.sh | 4 ++-- mysql-server/8.0/inspec/control.rb | 4 ++-- mysql-server/8.2/Dockerfile | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/mysql-server/5.7/Dockerfile b/mysql-server/5.7/Dockerfile index 80fdb94d1..60d884ee2 100644 --- a/mysql-server/5.7/Dockerfile +++ b/mysql-server/5.7/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM container-registry.oracle.com/os/oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.43 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.34 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.44 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.35 # Setup repositories for minimal packages (all versions) RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el7.rpm \ diff --git a/mysql-server/5.7/docker-entrypoint.sh b/mysql-server/5.7/docker-entrypoint.sh index 6a9e390af..371c599a7 100755 --- a/mysql-server/5.7/docker-entrypoint.sh +++ b/mysql-server/5.7/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 5.7.43-1.2.13-server" +echo "[Entrypoint] MySQL Docker Image 5.7.44-1.2.14-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 5.7.43-1.2.13-server" + echo "[Entrypoint] Starting MySQL 5.7.44-1.2.14-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/5.7/inspec/control.rb b/mysql-server/5.7/inspec/control.rb index 65d913d82..f147c66ef 100644 --- a/mysql-server/5.7/inspec/control.rb +++ b/mysql-server/5.7/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '5.7.43.*' } + its ('version') { should match '5.7.44.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.34.*' } + its ('version') { should match '8.0.35.*' } end end diff --git a/mysql-server/8.0/Dockerfile b/mysql-server/8.0/Dockerfile index f3da793ea..7ce7230cf 100644 --- a/mysql-server/8.0/Dockerfile +++ b/mysql-server/8.0/Dockerfile @@ -15,8 +15,8 @@ FROM container-registry.oracle.com/os/oraclelinux:8-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.34 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.34 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.35 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.35 # Setup repositories for minimal packages (all versions) RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el8.rpm \ diff --git a/mysql-server/8.0/docker-entrypoint.sh b/mysql-server/8.0/docker-entrypoint.sh index f70459cfc..b169c516c 100755 --- a/mysql-server/8.0/docker-entrypoint.sh +++ b/mysql-server/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.34-1.2.13-server" +echo "[Entrypoint] MySQL Docker Image 8.0.35-1.2.14-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.34-1.2.13-server" + echo "[Entrypoint] Starting MySQL 8.0.35-1.2.14-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/8.0/inspec/control.rb b/mysql-server/8.0/inspec/control.rb index b8daaed05..31512a39a 100644 --- a/mysql-server/8.0/inspec/control.rb +++ b/mysql-server/8.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.34.*' } + its ('version') { should match '8.0.35.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.34.*' } + its ('version') { should match '8.0.35.*' } end end diff --git a/mysql-server/8.2/Dockerfile b/mysql-server/8.2/Dockerfile index ded012dd8..a688e8f6d 100644 --- a/mysql-server/8.2/Dockerfile +++ b/mysql-server/8.2/Dockerfile @@ -24,9 +24,9 @@ RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-communit # Install server and shell 8.0 RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ - && microdnf install -y --enablerepo=mysql-tools-community $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ && microdnf install -y --disablerepo=ol8_appstream \ - --enablerepo=mysqllatest-community-minimal $MYSQL_SERVER_PACKAGE \ + --enablerepo=mysql-innovation-community-minimal $MYSQL_SERVER_PACKAGE \ && microdnf remove mysql-community-minimal-release mysql80-community-release \ && microdnf clean all \ && mkdir /docker-entrypoint-initdb.d From c6eb9a59f0973b2bc4efa9c88ad5302d86f5f044 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Mon, 30 Oct 2023 04:52:01 +0000 Subject: [PATCH 328/386] Release version 1.2.14-cluster * ET#78947: Bump versions for 8.2.0/8.0.35 Docker releases * ET#78422 - [Docker] Make all RE pipelines version agnostic --- mysql-cluster/7.5/Dockerfile | 4 +- mysql-cluster/7.5/docker-entrypoint.sh | 4 +- mysql-cluster/7.5/inspec/control.rb | 4 +- mysql-cluster/7.6/Dockerfile | 4 +- mysql-cluster/7.6/docker-entrypoint.sh | 4 +- mysql-cluster/7.6/inspec/control.rb | 4 +- mysql-cluster/8.0/Dockerfile | 6 +- mysql-cluster/8.0/docker-entrypoint.sh | 4 +- mysql-cluster/8.0/inspec/control.rb | 4 +- mysql-cluster/8.2/Dockerfile | 47 +++++ mysql-cluster/8.2/cnf/my.cnf | 22 ++ mysql-cluster/8.2/cnf/mysql-cluster.cnf | 39 ++++ mysql-cluster/8.2/docker-entrypoint.sh | 264 ++++++++++++++++++++++++ mysql-cluster/8.2/healthcheck.sh | 24 +++ mysql-cluster/8.2/inspec/control.rb | 20 ++ mysql-cluster/8.2/prepare-image.sh | 25 +++ 16 files changed, 460 insertions(+), 19 deletions(-) create mode 100644 mysql-cluster/8.2/Dockerfile create mode 100644 mysql-cluster/8.2/cnf/my.cnf create mode 100644 mysql-cluster/8.2/cnf/mysql-cluster.cnf create mode 100755 mysql-cluster/8.2/docker-entrypoint.sh create mode 100755 mysql-cluster/8.2/healthcheck.sh create mode 100644 mysql-cluster/8.2/inspec/control.rb create mode 100755 mysql-cluster/8.2/prepare-image.sh diff --git a/mysql-cluster/7.5/Dockerfile b/mysql-cluster/7.5/Dockerfile index bbd9f538d..be07c11ae 100644 --- a/mysql-cluster/7.5/Dockerfile +++ b/mysql-cluster/7.5/Dockerfile @@ -15,8 +15,8 @@ FROM container-registry.oracle.com/os/oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-7.5.31 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.34 +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-7.5.32 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.35 # Setup repositories for minimal packages (all versions) RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-cluster-community-minimal-release-el7.rpm \ diff --git a/mysql-cluster/7.5/docker-entrypoint.sh b/mysql-cluster/7.5/docker-entrypoint.sh index 381550938..5b53d0a89 100755 --- a/mysql-cluster/7.5/docker-entrypoint.sh +++ b/mysql-cluster/7.5/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 7.5.31-1.2.13-cluster" +echo "[Entrypoint] MySQL Docker Image 7.5.32-1.2.14-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -227,7 +227,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 7.5.31-1.2.13-cluster" + echo "[Entrypoint] Starting MySQL 7.5.32-1.2.14-cluster" fi exec "$@" --user=$MYSQLD_USER else diff --git a/mysql-cluster/7.5/inspec/control.rb b/mysql-cluster/7.5/inspec/control.rb index 70b488911..e76456715 100644 --- a/mysql-cluster/7.5/inspec/control.rb +++ b/mysql-cluster/7.5/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '7.5.31.*' } + its ('version') { should match '7.5.32.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.34.*' } + its ('version') { should match '8.0.35.*' } end end diff --git a/mysql-cluster/7.6/Dockerfile b/mysql-cluster/7.6/Dockerfile index a8d0aed4b..0b85a2fad 100644 --- a/mysql-cluster/7.6/Dockerfile +++ b/mysql-cluster/7.6/Dockerfile @@ -15,8 +15,8 @@ FROM container-registry.oracle.com/os/oraclelinux:7-slim -ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-7.6.27 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.34 +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-7.6.28 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.35 # Setup repositories for minimal packages (all versions) RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-cluster-community-minimal-release-el7.rpm \ diff --git a/mysql-cluster/7.6/docker-entrypoint.sh b/mysql-cluster/7.6/docker-entrypoint.sh index 02ed82f8c..866133d16 100755 --- a/mysql-cluster/7.6/docker-entrypoint.sh +++ b/mysql-cluster/7.6/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 7.6.27-1.2.13-cluster" +echo "[Entrypoint] MySQL Docker Image 7.6.28-1.2.14-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -227,7 +227,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 7.6.27-1.2.13-cluster" + echo "[Entrypoint] Starting MySQL 7.6.28-1.2.14-cluster" fi exec "$@" --user=$MYSQLD_USER else diff --git a/mysql-cluster/7.6/inspec/control.rb b/mysql-cluster/7.6/inspec/control.rb index a1b906a60..b7ba28ca9 100644 --- a/mysql-cluster/7.6/inspec/control.rb +++ b/mysql-cluster/7.6/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '7.6.27.*' } + its ('version') { should match '7.6.28.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.34.*' } + its ('version') { should match '8.0.35.*' } end end diff --git a/mysql-cluster/8.0/Dockerfile b/mysql-cluster/8.0/Dockerfile index 2a10fa1cd..60c28b530 100644 --- a/mysql-cluster/8.0/Dockerfile +++ b/mysql-cluster/8.0/Dockerfile @@ -15,8 +15,8 @@ FROM container-registry.oracle.com/os/oraclelinux:8-slim -ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.0.34 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.34 +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.0.35 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.35 # Setup repositories for minimal packages (all versions) RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-cluster-community-minimal-release-el8.rpm \ @@ -24,7 +24,7 @@ RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-cluster- # Install server and shell 8.0 RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ - && microdnf install -y --enablerepo=mysql-tools-community $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ && microdnf install -y --disablerepo=ol8_appstream \ --enablerepo=mysql-cluster80-community-minimal $MYSQL_SERVER_PACKAGE \ && microdnf clean all \ diff --git a/mysql-cluster/8.0/docker-entrypoint.sh b/mysql-cluster/8.0/docker-entrypoint.sh index 030ff37af..8d2a346b1 100755 --- a/mysql-cluster/8.0/docker-entrypoint.sh +++ b/mysql-cluster/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.34-1.2.13-cluster" +echo "[Entrypoint] MySQL Docker Image 8.0.35-1.2.14-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -227,7 +227,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.34-1.2.13-cluster" + echo "[Entrypoint] Starting MySQL 8.0.35-1.2.14-cluster" fi export MYSQLD_PARENT_PID=$$ ; exec "$@" --user= else diff --git a/mysql-cluster/8.0/inspec/control.rb b/mysql-cluster/8.0/inspec/control.rb index 0030562e4..a2aebfd8a 100644 --- a/mysql-cluster/8.0/inspec/control.rb +++ b/mysql-cluster/8.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.34.*' } + its ('version') { should match '8.0.35.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.34.*' } + its ('version') { should match '8.0.35.*' } end end diff --git a/mysql-cluster/8.2/Dockerfile b/mysql-cluster/8.2/Dockerfile new file mode 100644 index 000000000..79bcb7255 --- /dev/null +++ b/mysql-cluster/8.2/Dockerfile @@ -0,0 +1,47 @@ +# Copyright (c) 2017, 2023, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +FROM container-registry.oracle.com/os/oraclelinux:8-slim + +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.2.0 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.2.0 + +# Setup repositories for minimal packages (all versions) +RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-cluster-community-minimal-release-el8.rpm \ + && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql80-community-release-el8.rpm + +# Install server and shell 8.0 +RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ + && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --disablerepo=ol8_appstream \ + --enablerepo=mysql-cluster-innovation-community-minimal $MYSQL_SERVER_PACKAGE \ + && microdnf clean all \ + && mkdir /docker-entrypoint-initdb.d + +COPY prepare-image.sh / +RUN /prepare-image.sh && rm -f /prepare-image.sh + +ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock + +COPY docker-entrypoint.sh /entrypoint.sh +COPY healthcheck.sh /healthcheck.sh +COPY cnf/my.cnf /etc/ +COPY cnf/mysql-cluster.cnf /etc/ + +ENTRYPOINT ["/entrypoint.sh"] +HEALTHCHECK CMD /healthcheck.sh +EXPOSE 3306 33060-33061 2202 1186 +CMD ["mysqld"] + diff --git a/mysql-cluster/8.2/cnf/my.cnf b/mysql-cluster/8.2/cnf/my.cnf new file mode 100644 index 000000000..ec98b2dc1 --- /dev/null +++ b/mysql-cluster/8.2/cnf/my.cnf @@ -0,0 +1,22 @@ +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +[mysqld] +ndbcluster +ndb-connectstring=192.168.0.2 +user=mysql + +[mysql_cluster] +ndb-connectstring=192.168.0.2 diff --git a/mysql-cluster/8.2/cnf/mysql-cluster.cnf b/mysql-cluster/8.2/cnf/mysql-cluster.cnf new file mode 100644 index 000000000..16f79f1c0 --- /dev/null +++ b/mysql-cluster/8.2/cnf/mysql-cluster.cnf @@ -0,0 +1,39 @@ +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +[ndbd default] +NoOfReplicas=2 +DataMemory=80M +IndexMemory=18M + + +[ndb_mgmd] +NodeId=1 +hostname=192.168.0.2 +datadir=/var/lib/mysql + +[ndbd] +NodeId=2 +hostname=192.168.0.3 +datadir=/var/lib/mysql + +[ndbd] +NodeId=3 +hostname=192.168.0.4 +datadir=/var/lib/mysql + +[mysqld] +NodeId=4 +hostname=192.168.0.10 diff --git a/mysql-cluster/8.2/docker-entrypoint.sh b/mysql-cluster/8.2/docker-entrypoint.sh new file mode 100755 index 000000000..9c130f143 --- /dev/null +++ b/mysql-cluster/8.2/docker-entrypoint.sh @@ -0,0 +1,264 @@ +#!/bin/bash +# Copyright (c) 2017, 2021, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +echo "[Entrypoint] MySQL Docker Image " +# Fetch value from server config +# We use mysqld --verbose --help instead of my_print_defaults because the +# latter only show values present in config files, and not server defaults +_get_config() { + local conf="$1"; shift + "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' +} + +# Generate a random password +_mkpw() { + letter=$(cat /dev/urandom| tr -dc a-zA-Z | dd bs=1 count=16 2> /dev/null ) + number=$(cat /dev/urandom| tr -dc 0-9 | dd bs=1 count=8 2> /dev/null) + special=$(cat /dev/urandom| tr -dc '=+@#%^&*_.,;:?/' | dd bs=1 count=8 2> /dev/null) + + echo $letter$number$special | fold -w 1 | shuf | tr -d '\n' +} + +# If command starts with an option, prepend mysqld +# This allows users to add command-line options without +# needing to specify the "mysqld" command +if [ "${1:0:1}" = '-' ]; then + set -- mysqld "$@" +fi + +# Check if entrypoint (and the container) is running as root +if [ $(id -u) = "0" ]; then + is_root=1 + install_devnull="install /dev/null -m0600 -omysql -gmysql" + MYSQLD_USER=mysql +else + install_devnull="install /dev/null -m0600" + MYSQLD_USER=$(id -u) +fi + +if [ "$1" = 'mysqld' ]; then + # Test that the server can start. We redirect stdout to /dev/null so + # only the error messages are left. + result=0 + output=$("$@" --validate-config) || result=$? + if [ ! "$result" = "0" ]; then + echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' + echo >&2 "[Entrypoint] $output" + exit 1 + fi + + # Get config + DATADIR="$(_get_config 'datadir' "$@")" + SOCKET="$(_get_config 'socket' "$@")" + + if [ ! -d "$DATADIR/mysql" ]; then + # If the password variable is a filename we use the contents of the file. We + # read this first to make sure that a proper error is generated for empty files. + if [ -f "$MYSQL_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + if [ -z "$MYSQL_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' + exit 1 + fi + fi + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] No password option specified for new database.' + echo >&2 '[Entrypoint] A random onetime password will be generated.' + MYSQL_RANDOM_ROOT_PASSWORD=true + MYSQL_ONETIME_PASSWORD=true + fi + if [ ! -d "$DATADIR" ]; then + mkdir -p "$DATADIR" + chown mysql:mysql "$DATADIR" + fi + + # The user can set a default_timezone either in a my.cnf file + # they mount into the container or on command line + # (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`) + # however the timezone tables will only be populated in a later + # stage of this script. By using +00:00 as timezone we override + # the user's choice during initialization. Later the server + # will be restarted using the user's option. + + echo '[Entrypoint] Initializing database' + "$@" --user=$MYSQLD_USER --initialize-insecure --default-time-zone=+00:00 + + echo '[Entrypoint] Database initialized' + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" --default-time-zone=+00:00 + + # To avoid using password on commandline, put it in a temporary file. + # The file is only populated when and if the root password is set. + PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + $install_devnull "$PASSFILE" + # Define the client command used throughout the script + # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") + + if [ ! -z %%STARTUP_WAIT%% ]; + then + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break + fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 + fi + fi + + mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql + + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(_mkpw)" + echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + fi + if [ -z "$MYSQL_ROOT_HOST" ]; then + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';" + else + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ + GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + fi + "${mysql[@]}" <<-EOSQL + DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; + ${ROOTCREATE} + FLUSH PRIVILEGES ; + EOSQL + if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then + # Put the password into the temporary config file + cat >"$PASSFILE" < "$SQL" +ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL + fi + fi + + echo + echo '[Entrypoint] MySQL init process done. Ready for start up.' + echo + fi + + # Used by healthcheck to make sure it doesn't mistakenly report container + # healthy during startup + # Put the password into the temporary config file + touch /var/lib/mysql-files/healthcheck.cnf + cat >"/var/lib/mysql-files/healthcheck.cnf" < Date: Mon, 30 Oct 2023 05:17:49 +0000 Subject: [PATCH 329/386] Release version 1.0.14-router * Update weekly pipeline - versions * ET#78947: Bump versions for 8.2.0/8.0.35 Docker releases * ET#78422 - [Docker] Make all RE pipelines version agnostic * ET#78579 - [Docker] Add 8.2 to multiarch versions --- mysql-router/8.0/Dockerfile | 8 +-- mysql-router/8.0/inspec/control.rb | 4 +- mysql-router/8.2/Dockerfile | 39 +++++++++++ mysql-router/8.2/README.md | 88 +++++++++++++++++++++++++ mysql-router/8.2/inspec/control.rb | 20 ++++++ mysql-router/8.2/run.sh | 101 +++++++++++++++++++++++++++++ 6 files changed, 254 insertions(+), 6 deletions(-) create mode 100644 mysql-router/8.2/Dockerfile create mode 100644 mysql-router/8.2/README.md create mode 100644 mysql-router/8.2/inspec/control.rb create mode 100755 mysql-router/8.2/run.sh diff --git a/mysql-router/8.0/Dockerfile b/mysql-router/8.0/Dockerfile index 82cd25b28..92a1e1f2f 100644 --- a/mysql-router/8.0/Dockerfile +++ b/mysql-router/8.0/Dockerfile @@ -14,11 +14,11 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM container-registry.oracle.com/os/oraclelinux:8-slim -ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.34 -ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.34 +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.35 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.35 ARG CONFIG_PACKAGE_NAME=mysql80-community-release-el8.rpm ARG REPO_NAME_SERVER=mysql80-community -ARG REPO_NAME_TOOLS=mysql-tools-community +ARG REPO_NAME_TOOLS=mysql-tools-innovation-community RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ @@ -27,7 +27,7 @@ RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ && microdnf install -y --disablerepo=\* \ --enablerepo=mysql80-community $MYSQL_CLIENT_PACKAGE \ && microdnf install -y --disablerepo=\* \ - --enablerepo=mysql-tools-community $MYSQL_ROUTER_PACKAGE \ + --enablerepo=mysql-tools-innovation-community $MYSQL_ROUTER_PACKAGE \ && microdnf clean all COPY run.sh /run.sh diff --git a/mysql-router/8.0/inspec/control.rb b/mysql-router/8.0/inspec/control.rb index 446c5862b..21a8251bb 100644 --- a/mysql-router/8.0/inspec/control.rb +++ b/mysql-router/8.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-client') do it { should be_installed } - its ('version') { should match '8.0.34.*' } + its ('version') { should match '8.0.35.*' } end describe package('mysql-router-community') do it { should be_installed } - its ('version') { should match '8.0.34.*' } + its ('version') { should match '8.0.35.*' } end end diff --git a/mysql-router/8.2/Dockerfile b/mysql-router/8.2/Dockerfile new file mode 100644 index 000000000..fac89eae1 --- /dev/null +++ b/mysql-router/8.2/Dockerfile @@ -0,0 +1,39 @@ +# Copyright (c) 2018, 2023, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +FROM container-registry.oracle.com/os/oraclelinux:8-slim + +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.2.0 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.2.0 +ARG CONFIG_PACKAGE_NAME=mysql80-community-release-el8.rpm +ARG REPO_NAME_SERVER=mysql-innovation-community +ARG REPO_NAME_TOOLS=mysql-tools-innovation-community + +RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ + && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ + -c "MySQL Router" mysqlrouter \ + && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/$CONFIG_PACKAGE_NAME \ + && microdnf install -y --disablerepo=\* \ + --enablerepo=mysql-innovation-community $MYSQL_CLIENT_PACKAGE \ + && microdnf install -y --disablerepo=\* \ + --enablerepo=mysql-tools-innovation-community $MYSQL_ROUTER_PACKAGE \ + && microdnf clean all + +COPY run.sh /run.sh +HEALTHCHECK \ + CMD mysqladmin --port 6446 --protocol TCP ping 2>&1 | grep Access || exit 1 +EXPOSE 6446 6447 6448 6449 8443 +USER 999:999 +ENTRYPOINT ["/run.sh"] +CMD ["mysqlrouter"] diff --git a/mysql-router/8.2/README.md b/mysql-router/8.2/README.md new file mode 100644 index 000000000..0f2711ba5 --- /dev/null +++ b/mysql-router/8.2/README.md @@ -0,0 +1,88 @@ +![logo](https://www.mysql.com/common/logos/logo-mysql-170x115.png) + +# What is MySQL Router? + +MySQL Router is part of InnoDB cluster, and is lightweight middleware that +provides transparent routing between your application and back-end MySQL +Servers. It can be used for a wide variety of use cases, such as providing high +availability and scalability by effectively routing database traffic to +appropriate back-end MySQL Servers. The pluggable architecture also enables +developers to extend MySQL Router for custom use cases. + +# Supported Tags and Respective Dockerfile Links + +* MySQL Router 8.0 (tag: [`latest`, `8.0`](https://github.com/mysql/mysql-docker/blob/mysql-router/8.0/Dockerfile)) ([mysql-router/8.0/Dockerfile](https://github.com/mysql/mysql-docker/blob/mysql-router/8.0/Dockerfile)) + +Images are updated when new MySQL Server maintenance releases and development milestones are published. Please note that non-GA releases are for preview purposes only and should not be used in production setups. + +# How to Use the MySQL Router Images + +The image currently uses the following mandatory variables: + +| Variable | Description | +| ------------------------ | ------------------------------------------- | +| MYSQL_HOST | MySQL host to connect to | +| MYSQL_PORT | Port to use | +| MYSQL_USER | User to connect with | +| MYSQL_PASSWORD | Password to connect with | + +Running in a container requires a working InnoDB cluster. + +The image uses the following optional variables: + +| Variable | Description | +| ------------------------------------ | ------------------------------------------- | +| MYSQL_INNODB_CLUSTER_MEMBERS | Wait for at least this number of cluster instances to be ONLINE | +| MYSQL_CREATE_ROUTER_USER | Whether to create a new account for the Router to use when it's running. Defaults to 1, set to 0 to disable. | +| MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS | Additional command line options applied while bootstrapping + +If supplied the run script waits for the given mysql host to be up, the InnoDB cluster to have +MYSQL_INNODB_CLUSTER_MEMBERS members and then uses the given server for its +bootstrap mode +[Bootstrapping](https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-deploying-bootstrapping.html). + +The image can be run via: + +``` +docker run -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -e MYSQL_INNODB_CLUSTER_MEMBERS=3 -ti mysql/mysql-router +``` + +Additional command line options for running MySQL Router after bootstrap can be passed a command options. For instance you can use a config file from your home directory like this: + +``` +docker run -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -ti -v $HOME/router-extra.conf:/tmp/router-extra.conf mysql/mysql-router mysqlrouter --extra-config=/tmp/router-extra.conf +``` + +It can be verified by typing: + +``` +docker ps +``` + +The following output should be displayed: + +``` +4954b1c80be1 mysql-router:8.0 "/run.sh mysqlrouter" About a minute ago Up About a minute (healthy) 6447/tcp, 6448/tcp, 0.0.0.0:6446->6446/tcp, 6449/tcp innodbcluster_mysql-router_1 +``` + +By default the container will run as user 999:999 which maps to mysqlrouter:mysqlrouter inside the container. + +# Exposed Ports + +The following TCP ports are exposed by the MySQL Router container: + +| Port | Description +| ----- | --------------------------------------------------------------------------------------- | +| 6446 | R/W connection port. Clients that connect to this port will be forwarded to the PRIMARY | +| 6447 | R/O connection port. Clients that connect to this port will be forwarded to a SECONDARY | +| 6448 | X Protocol R/W connection port. R/W port for X protocol client connections | +| 6449 | X Protocol R/O connection port. R/O port for X protocol client connections | +| 8443 | HTTPS REST interface port. | + +For more information about the REST interface API, see: + +https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-rest-api-reference.html + +For full usage documentation, see: + +https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-installation-docker.html diff --git a/mysql-router/8.2/inspec/control.rb b/mysql-router/8.2/inspec/control.rb new file mode 100644 index 000000000..7df5082a3 --- /dev/null +++ b/mysql-router/8.2/inspec/control.rb @@ -0,0 +1,20 @@ +control 'container' do + impact 0.5 + describe podman.containers do + its('status') { should cmp /Up/ } + its('commands') { should cmp /sleep/ } + its('images') { should cmp /mysql-router:8.2/ } + its('names') { should include "mysql-router-8.2" } + end +end +control 'packages' do + impact 0.5 + describe package('mysql-community-client') do + it { should be_installed } + its ('version') { should match '8.2.0.*' } + end + describe package('mysql-router-community') do + it { should be_installed } + its ('version') { should match '8.2.0.*' } + end +end diff --git a/mysql-router/8.2/run.sh b/mysql-router/8.2/run.sh new file mode 100755 index 000000000..f806c1afe --- /dev/null +++ b/mysql-router/8.2/run.sh @@ -0,0 +1,101 @@ +#!/bin/bash +# Copyright (c) 2018, 2021, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +if [ "$1" = 'mysqlrouter' ]; then + if [[ -z $MYSQL_HOST || -z $MYSQL_PORT || -z $MYSQL_USER || -z $MYSQL_PASSWORD ]]; then + echo "We require all of" + echo " MYSQL_HOST" + echo " MYSQL_PORT" + echo " MYSQL_USER" + echo " MYSQL_PASSWORD" + echo "to be set." + echo "In addition you can set" + echo " MYSQL_INNODB_CLUSTER_MEMBERS " + echo " MYSQL_CREATE_ROUTER_USER" + echo " MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS" + echo "Exiting." + exit 1 + fi + + PASSFILE=$(mktemp) + echo "$MYSQL_PASSWORD" > "$PASSFILE" + if [ -z $MYSQL_CREATE_ROUTER_USER ]; then + echo "$MYSQL_PASSWORD" >> "$PASSFILE" + MYSQL_CREATE_ROUTER_USER=1 + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is not set, Router will generate a new account to be used at runtime." + echo "[Entrypoint] Set it to 0 to reuse $MYSQL_USER instead." + elif [ "$MYSQL_CREATE_ROUTER_USER" = "0" ]; then + echo "$MYSQL_PASSWORD" >> "$PASSFILE" + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is 0, Router will reuse $MYSQL_USER account at runtime" + else + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is not 0, Router will generate a new account to be used at runtime" + fi + + DEFAULTS_EXTRA_FILE=$(mktemp) + cat >"$DEFAULTS_EXTRA_FILE" < "/dev/tcp/$MYSQL_HOST/$MYSQL_PORT") >/dev/null 2>&1; do + echo "[Entrypoint] Waiting for mysql server $MYSQL_HOST ($attempt_num/$max_tries)" + sleep $(( attempt_num++ )) + if (( attempt_num == max_tries )); then + exit 1 + fi + done + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST:$MYSQL_PORT. Checking for cluster state." + if ! [[ "$(mysql --defaults-extra-file="$DEFAULTS_EXTRA_FILE" -u "$MYSQL_USER" -h "$MYSQL_HOST" -P "$MYSQL_PORT" -e "show status;" 2> /dev/null)" ]]; then + echo "[Entrypoint] ERROR: Can not connect to database. Exiting." + exit 1 + fi + if [[ -n $MYSQL_INNODB_CLUSTER_MEMBERS ]]; then + attempt_num=0 + echo $attempt_num + echo $max_tries + until [ "$(mysql --defaults-extra-file="$DEFAULTS_EXTRA_FILE" -u "$MYSQL_USER" -h "$MYSQL_HOST" -P "$MYSQL_PORT" -N performance_schema -e "select count(MEMBER_STATE) >= $MYSQL_INNODB_CLUSTER_MEMBERS from replication_group_members where MEMBER_STATE = 'ONLINE';" 2> /dev/null)" -eq 1 ]; do + echo "[Entrypoint] Waiting for $MYSQL_INNODB_CLUSTER_MEMBERS cluster instances to become available via $MYSQL_HOST ($attempt_num/$max_tries)" + sleep $(( attempt_num++ )) + if (( attempt_num == max_tries )); then + exit 1 + fi + done + echo "[Entrypoint] Successfully contacted cluster with $MYSQL_INNODB_CLUSTER_MEMBERS members. Bootstrapping." + fi + if [ $(id -u) = "0" ]; then + opt_user=--user=mysqlrouter + fi + if [ "$MYSQL_CREATE_ROUTER_USER" = "0" ]; then + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap reusing account \"$MYSQL_USER\"." + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force --account-create=never --account=$MYSQL_USER $opt_user $MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS < "$PASSFILE" || exit 1 + else + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap." + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force $opt_user $MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS < "$PASSFILE" || exit 1 + fi + + sed -i -e 's/logging_folder=.*$/logging_folder=/' /tmp/mysqlrouter/mysqlrouter.conf + echo "[Entrypoint] Starting mysql-router." + exec "$@" --config /tmp/mysqlrouter/mysqlrouter.conf + + rm -f "$PASSFILE" + rm -f "$DEFAULTS_EXTRA_FILE" + unset DEFAULTS_EXTRA_FILE +else + exec "$@" +fi From 6eb9d74ef2d885a6b88518b2e99a3441f5e08162 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Mon, 30 Oct 2023 06:45:24 +0000 Subject: [PATCH 330/386] Release version 1.0.14-router --- mysql-router/8.0/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-router/8.0/Dockerfile b/mysql-router/8.0/Dockerfile index 92a1e1f2f..373ad965d 100644 --- a/mysql-router/8.0/Dockerfile +++ b/mysql-router/8.0/Dockerfile @@ -18,7 +18,7 @@ ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.35 ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.35 ARG CONFIG_PACKAGE_NAME=mysql80-community-release-el8.rpm ARG REPO_NAME_SERVER=mysql80-community -ARG REPO_NAME_TOOLS=mysql-tools-innovation-community +ARG REPO_NAME_TOOLS=mysql-tools-community RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ @@ -27,7 +27,7 @@ RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ && microdnf install -y --disablerepo=\* \ --enablerepo=mysql80-community $MYSQL_CLIENT_PACKAGE \ && microdnf install -y --disablerepo=\* \ - --enablerepo=mysql-tools-innovation-community $MYSQL_ROUTER_PACKAGE \ + --enablerepo=mysql-tools-community $MYSQL_ROUTER_PACKAGE \ && microdnf clean all COPY run.sh /run.sh From 00512631354d013a3386fcb23e72a5f62de621e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Schl=C3=BCter?= Date: Wed, 8 Nov 2023 14:32:18 +0100 Subject: [PATCH 331/386] Fix bug#i35964936 MySQL Router container image does not expose 6450 port for read/write splitting Change-Id: Iac2c9a5caeefb41b650e4367c8caa4eb5bd1206c --- mysql-router/template/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-router/template/Dockerfile b/mysql-router/template/Dockerfile index 71c7aa23a..f599f37e1 100644 --- a/mysql-router/template/Dockerfile +++ b/mysql-router/template/Dockerfile @@ -33,7 +33,7 @@ RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ COPY run.sh /run.sh HEALTHCHECK \ CMD mysqladmin --port 6446 --protocol TCP ping 2>&1 | grep Access || exit 1 -EXPOSE 6446 6447 6448 6449 8443 +EXPOSE 6446 6447 6448 6449 6450 8443 USER 999:999 ENTRYPOINT ["/run.sh"] CMD ["mysqlrouter"] From 7befd2088b8c79198c960b121675f79611f97219 Mon Sep 17 00:00:00 2001 From: Nawaz Nazeer Ahamed Date: Fri, 1 Dec 2023 04:41:34 +0100 Subject: [PATCH 332/386] ET#79502 - Remove 5.7 references - EOL Change-Id: I708128cf59fe7c3a1948428c8caa1b6f33eeee1e --- mysql-server/5.7/Dockerfile | 45 ----- mysql-server/5.7/docker-entrypoint.sh | 230 -------------------------- mysql-server/5.7/healthcheck.sh | 24 --- mysql-server/5.7/inspec/control.rb | 20 --- mysql-server/5.7/prepare-image.sh | 25 --- mysql-server/VERSION | 28 ++-- mysql-server/build.sh | 6 +- mysql-server/gen_dockerfiles.sh | 16 +- mysql-server/tag.sh | 13 +- mysql-server/template/Dockerfile-pre8 | 45 ----- mysql-server/test.sh | 6 +- 11 files changed, 23 insertions(+), 435 deletions(-) delete mode 100644 mysql-server/5.7/Dockerfile delete mode 100755 mysql-server/5.7/docker-entrypoint.sh delete mode 100755 mysql-server/5.7/healthcheck.sh delete mode 100644 mysql-server/5.7/inspec/control.rb delete mode 100755 mysql-server/5.7/prepare-image.sh delete mode 100644 mysql-server/template/Dockerfile-pre8 diff --git a/mysql-server/5.7/Dockerfile b/mysql-server/5.7/Dockerfile deleted file mode 100644 index 60d884ee2..000000000 --- a/mysql-server/5.7/Dockerfile +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (c) 2017, 2022, Oracle and/or its affiliates. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -FROM container-registry.oracle.com/os/oraclelinux:7-slim - -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-5.7.44 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.35 - -# Setup repositories for minimal packages (all versions) -RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el7.rpm \ - && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql80-community-release-el7.rpm - -# Install server and shell 8.0 -RUN yum install -y $MYSQL_SHELL_PACKAGE --enablerepo=mysql-tools-community \ - && yum install -y $MYSQL_SERVER_PACKAGE --enablerepo=mysql57-community-minimal \ - && yum remove -y mysql-community-minimal-release mysql80-community-release \ - && yum clean all \ - && mkdir /docker-entrypoint-initdb.d - -# Ensure mysqld logs go to stderr -RUN sed -i 's/^log-error=/#&/' /etc/my.cnf - -COPY prepare-image.sh / -RUN /prepare-image.sh && rm -f /prepare-image.sh - -ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock - -COPY docker-entrypoint.sh /entrypoint.sh -COPY healthcheck.sh /healthcheck.sh -ENTRYPOINT ["/entrypoint.sh"] -HEALTHCHECK CMD /healthcheck.sh -EXPOSE 3306 33060 -CMD ["mysqld"] - diff --git a/mysql-server/5.7/docker-entrypoint.sh b/mysql-server/5.7/docker-entrypoint.sh deleted file mode 100755 index 371c599a7..000000000 --- a/mysql-server/5.7/docker-entrypoint.sh +++ /dev/null @@ -1,230 +0,0 @@ -#!/bin/bash -# Copyright (c) 2017, 2021, Oracle and/or its affiliates. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -set -e - -echo "[Entrypoint] MySQL Docker Image 5.7.44-1.2.14-server" -# Fetch value from server config -# We use mysqld --verbose --help instead of my_print_defaults because the -# latter only show values present in config files, and not server defaults -_get_config() { - local conf="$1"; shift - "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' -} - -# Generate a random password -_mkpw() { - letter=$(cat /dev/urandom| tr -dc a-zA-Z | dd bs=1 count=16 2> /dev/null ) - number=$(cat /dev/urandom| tr -dc 0-9 | dd bs=1 count=8 2> /dev/null) - special=$(cat /dev/urandom| tr -dc '=+@#%^&*_.,;:?/' | dd bs=1 count=8 2> /dev/null) - - echo $letter$number$special | fold -w 1 | shuf | tr -d '\n' -} - -# If command starts with an option, prepend mysqld -# This allows users to add command-line options without -# needing to specify the "mysqld" command -if [ "${1:0:1}" = '-' ]; then - set -- mysqld "$@" -fi - -# Check if entrypoint (and the container) is running as root -if [ $(id -u) = "0" ]; then - is_root=1 - install_devnull="install /dev/null -m0600 -omysql -gmysql" - MYSQLD_USER=mysql -else - install_devnull="install /dev/null -m0600" - MYSQLD_USER=$(id -u) -fi - -if [ "$1" = 'mysqld' ]; then - # Test that the server can start. We redirect stdout to /dev/null so - # only the error messages are left. - result=0 - output=$("$@" --verbose --help 2>&1 > /dev/null) || result=$? - if [ ! "$result" = "0" ]; then - echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' - echo >&2 "[Entrypoint] $output" - exit 1 - fi - - # Get config - DATADIR="$(_get_config 'datadir' "$@")" - SOCKET="$(_get_config 'socket' "$@")" - - if [ ! -d "$DATADIR/mysql" ]; then - # If the password variable is a filename we use the contents of the file. We - # read this first to make sure that a proper error is generated for empty files. - if [ -f "$MYSQL_ROOT_PASSWORD" ]; then - MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" - if [ -z "$MYSQL_ROOT_PASSWORD" ]; then - echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' - exit 1 - fi - fi - if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - echo >&2 '[Entrypoint] No password option specified for new database.' - echo >&2 '[Entrypoint] A random onetime password will be generated.' - MYSQL_RANDOM_ROOT_PASSWORD=true - MYSQL_ONETIME_PASSWORD=true - fi - if [ ! -d "$DATADIR" ]; then - mkdir -p "$DATADIR" - chown mysql:mysql "$DATADIR" - fi - - # The user can set a default_timezone either in a my.cnf file - # they mount into the container or on command line - # (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`) - # however the timezone tables will only be populated in a later - # stage of this script. By using +00:00 as timezone we override - # the user's choice during initialization. Later the server - # will be restarted using the user's option. - - echo '[Entrypoint] Initializing database' - "$@" --user=$MYSQLD_USER --initialize-insecure --default-time-zone=+00:00 - - echo '[Entrypoint] Database initialized' - "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" --default-time-zone=+00:00 - - # To avoid using password on commandline, put it in a temporary file. - # The file is only populated when and if the root password is set. - PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) - $install_devnull "$PASSFILE" - # Define the client command used throughout the script - # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly - mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") - - for i in {30..0}; do - if mysqladmin --socket="$SOCKET" ping &>/dev/null; then - break - fi - echo '[Entrypoint] Waiting for server...' - sleep 1 - done - if [ "$i" = 0 ]; then - echo >&2 '[Entrypoint] Timeout during MySQL init.' - exit 1 - fi - - mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql - - if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - MYSQL_ROOT_PASSWORD="$(_mkpw)" - echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" - fi - if [ -z "$MYSQL_ROOT_HOST" ]; then - ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';" - else - ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ - CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ - GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ - GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" - fi - "${mysql[@]}" <<-EOSQL - DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); - CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; - ${ROOTCREATE} - FLUSH PRIVILEGES ; - EOSQL - if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then - # Put the password into the temporary config file - cat >"$PASSFILE" < "$SQL" -ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; -ALTER USER 'root'@'localhost' PASSWORD EXPIRE; -EOF - else - cat << EOF > "$SQL" -ALTER USER 'root'@'localhost' PASSWORD EXPIRE; -EOF - fi - set -- "$@" --init-file="$SQL" - unset SQL - fi - - echo - echo '[Entrypoint] MySQL init process done. Ready for start up.' - echo - fi - - # Used by healthcheck to make sure it doesn't mistakenly report container - # healthy during startup - # Put the password into the temporary config file - touch /var/lib/mysql-files/healthcheck.cnf - cat >"/var/lib/mysql-files/healthcheck.cnf" <\&1 > /dev/null) || result=\$?" - DOCKERFILE_TEMPLATES="template/Dockerfile-pre8" - SPEC_PORTS="3306/tcp, 33060/tcp" -else - PORTS="3306 33060 33061" - VALIDATE_CONFIG="output=\$(\"\$@\" --validate-config) || result=\$?" - DOCKERFILE_TEMPLATES="template/Dockerfile" - SPEC_PORTS="3306/tcp, 33060-33061/tcp" -fi + +PORTS="3306 33060 33061" +VALIDATE_CONFIG="output=\$(\"\$@\" --validate-config) || result=\$?" +DOCKERFILE_TEMPLATES="template/Dockerfile" +SPEC_PORTS="3306/tcp, 33060-33061/tcp" if [ ! -d "${MAJOR_VERSION}" ]; then mkdir -p "${MAJOR_VERSION}/inspec" diff --git a/mysql-server/tag.sh b/mysql-server/tag.sh index 816baaf8e..2059b0255 100755 --- a/mysql-server/tag.sh +++ b/mysql-server/tag.sh @@ -28,14 +28,9 @@ for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do fi MAJOR_VERSION=${SERVER_VERSION%.*} FULL_SERVER_VERSION="${SERVER_VERSION}-${IMAGE_VERSION}" - if [[ "$SINGLEARCH_VERSION" == "$MAJOR_VERSION" ]]; then - TAGS="${MAJOR_VERSION} ${SERVER_VERSION} ${FULL_SERVER_VERSION}" - echo $TAGS - else - TAGS="${MAJOR_VERSION}${SUFFIX} ${SERVER_VERSION}${SUFFIX} ${FULL_SERVER_VERSION}${SUFFIX}" - if [[ "$MAJOR_VERSION" == "$LATEST" ]]; then - TAGS="$TAGS latest${SUFFIX}" - fi - echo $TAGS + TAGS="${MAJOR_VERSION}${SUFFIX} ${SERVER_VERSION}${SUFFIX} ${FULL_SERVER_VERSION}${SUFFIX}" + if [[ "$MAJOR_VERSION" == "$LATEST" ]]; then + TAGS="$TAGS latest${SUFFIX}" fi + echo $TAGS done diff --git a/mysql-server/template/Dockerfile-pre8 b/mysql-server/template/Dockerfile-pre8 deleted file mode 100644 index 53a7d387e..000000000 --- a/mysql-server/template/Dockerfile-pre8 +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (c) 2017, 2022, Oracle and/or its affiliates. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -FROM container-registry.oracle.com/os/oraclelinux:7-slim - -ARG MYSQL_SERVER_PACKAGE=%%MYSQL_SERVER_PACKAGE%% -ARG MYSQL_SHELL_PACKAGE=%%MYSQL_SHELL_PACKAGE%% - -# Setup repositories for minimal packages (all versions) -RUN rpm -U %%REPO%%/%%CONFIG_PACKAGE_NAME_MINIMAL%% \ - && rpm -U %%REPO%%/%%CONFIG_PACKAGE_NAME%% - -# Install server and shell 8.0 -RUN yum install -y $MYSQL_SHELL_PACKAGE --enablerepo=%%REPO_NAME_TOOLS%% \ - && yum install -y $MYSQL_SERVER_PACKAGE --enablerepo=%%REPO_NAME_SERVER%% \ - && yum remove -y %%MYSQL_CONFIG_PKG_MINIMAL%% %%MYSQL_CONFIG_PKG%% \ - && yum clean all \ - && mkdir /docker-entrypoint-initdb.d - -# Ensure mysqld logs go to stderr -RUN sed -i 's/^log-error=/#&/' /etc/my.cnf - -COPY prepare-image.sh / -RUN /prepare-image.sh && rm -f /prepare-image.sh - -ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock - -COPY docker-entrypoint.sh /entrypoint.sh -COPY healthcheck.sh /healthcheck.sh -ENTRYPOINT ["/entrypoint.sh"] -HEALTHCHECK CMD /healthcheck.sh -EXPOSE %%PORTS%% -CMD ["mysqld"] - diff --git a/mysql-server/test.sh b/mysql-server/test.sh index f2de68818..2c3841556 100755 --- a/mysql-server/test.sh +++ b/mysql-server/test.sh @@ -47,10 +47,8 @@ for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do IMG_LOC="mysql/mysql-server" CONT_NAME="mysql-server-$MAJOR_VERSION" fi - ARCH_SUFFIX="" - if [ "$SINGLEARCH_VERSION" != "$MAJOR_VERSION" ]; then - ARCH_SUFFIX="-$ARCH" - fi + + ARCH_SUFFIX="-$ARCH" podman run -d --rm --name $CONT_NAME "$IMG_LOC":"$MAJOR_VERSION$ARCH_SUFFIX" export DOCKER_HOST=unix:///tmp/podman.sock podman system service --time=0 ${DOCKER_HOST} & DOCKER_SOCK_PID="$!" From d36cbb8ce37647556cd9258b7833906d424d7f97 Mon Sep 17 00:00:00 2001 From: Karen Langford Date: Mon, 4 Dec 2023 23:18:25 +0100 Subject: [PATCH 333/386] ET#79710: Bump versions for 8.3.0/8.0.36 Docker releases, removed 7.5/7.6 Cluster Change-Id: I96bdaf8844d5cbff096bb70581949b1b6fa85908 --- mysql-cluster/VERSION | 20 +++++++------------- mysql-router/VERSION | 22 +++++++++++----------- 2 files changed, 18 insertions(+), 24 deletions(-) diff --git a/mysql-cluster/VERSION b/mysql-cluster/VERSION index f4ec75551..ab119d3c7 100644 --- a/mysql-cluster/VERSION +++ b/mysql-cluster/VERSION @@ -1,21 +1,15 @@ -IMAGE_VERSION=1.2.14-cluster -LATEST="8.2" -LATEST_INNOVATION="8.2" +IMAGE_VERSION=1.2.15-cluster +LATEST="8.3" +LATEST_INNOVATION="8.3" declare -A MYSQL_CLUSTER_VERSIONS -MYSQL_CLUSTER_VERSIONS["7.5"]=7.5.32 -MYSQL_CLUSTER_VERSIONS["7.6"]=7.6.28 -MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.35 -MYSQL_CLUSTER_VERSIONS["latest"]=8.2.0 +MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.36 +MYSQL_CLUSTER_VERSIONS["latest"]=8.3.0 declare -A MYSQL_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["7.5"]=8.0.35 -MYSQL_SHELL_VERSIONS["7.6"]=8.0.35 -MYSQL_SHELL_VERSIONS["8.0"]=8.0.35 -MYSQL_SHELL_VERSIONS["latest"]=8.2.0 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.36 +MYSQL_SHELL_VERSIONS["latest"]=8.3.0 declare -A FULL_SERVER_VERSIONS -FULL_SERVER_VERSIONS["7.5"]="${MYSQL_CLUSTER_VERSIONS["7.5"]}-${IMAGE_VERSION}" -FULL_SERVER_VERSIONS["7.6"]="${MYSQL_CLUSTER_VERSIONS["7.6"]}-${IMAGE_VERSION}" FULL_SERVER_VERSIONS["8.0"]="${MYSQL_CLUSTER_VERSIONS["8.0"]}-${IMAGE_VERSION}" FULL_SERVER_VERSIONS["latest"]="${MYSQL_CLUSTER_VERSIONS["latest"]}-${IMAGE_VERSION}" diff --git a/mysql-router/VERSION b/mysql-router/VERSION index 9bdcd7350..bff0336c5 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -1,17 +1,17 @@ -IMAGE_VERSION=1.0.14-router -LATEST="8.2" -LATEST_INNOVATION="8.2" +IMAGE_VERSION=1.0.15-router +LATEST="8.3" +LATEST_INNOVATION="8.3" declare -A MYSQL_ROUTER_VERSIONS WEEKLY_ROUTER_VERSIONS -MYSQL_ROUTER_VERSIONS["8.0"]=8.0.35 -MYSQL_ROUTER_VERSIONS["latest"]=8.2.0 +MYSQL_ROUTER_VERSIONS["8.0"]=8.0.36 +MYSQL_ROUTER_VERSIONS["latest"]=8.3.0 -WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.36 -WEEKLY_ROUTER_VERSIONS["latest"]=8.3.0 +WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.37 +WEEKLY_ROUTER_VERSIONS["latest"]=8.4.0 declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["8.0"]=8.0.35 -MYSQL_SERVER_VERSIONS["latest"]=8.2.0 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.36 +MYSQL_SERVER_VERSIONS["latest"]=8.3.0 -WEEKLY_SERVER_VERSIONS["8.0"]=8.0.36 -WEEKLY_SERVER_VERSIONS["latest"]=8.3.0 +WEEKLY_SERVER_VERSIONS["8.0"]=8.0.37 +WEEKLY_SERVER_VERSIONS["latest"]=8.4.0 From 54a2b44702d98a5c51144a870ea4ab9a6b7fc8be Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Tue, 16 Jan 2024 03:18:56 +0000 Subject: [PATCH 334/386] Release version 1.2.15-server * ET#79502 - Remove 5.7 references - EOL --- mysql-server/8.0/Dockerfile | 4 +- mysql-server/8.0/docker-entrypoint.sh | 4 +- mysql-server/8.0/inspec/control.rb | 4 +- mysql-server/8.3/Dockerfile | 45 +++++ mysql-server/8.3/docker-entrypoint.sh | 230 ++++++++++++++++++++++++++ mysql-server/8.3/healthcheck.sh | 24 +++ mysql-server/8.3/inspec/control.rb | 20 +++ mysql-server/8.3/prepare-image.sh | 25 +++ 8 files changed, 350 insertions(+), 6 deletions(-) create mode 100644 mysql-server/8.3/Dockerfile create mode 100755 mysql-server/8.3/docker-entrypoint.sh create mode 100755 mysql-server/8.3/healthcheck.sh create mode 100644 mysql-server/8.3/inspec/control.rb create mode 100755 mysql-server/8.3/prepare-image.sh diff --git a/mysql-server/8.0/Dockerfile b/mysql-server/8.0/Dockerfile index 7ce7230cf..f2abedaf3 100644 --- a/mysql-server/8.0/Dockerfile +++ b/mysql-server/8.0/Dockerfile @@ -15,8 +15,8 @@ FROM container-registry.oracle.com/os/oraclelinux:8-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.35 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.35 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.36 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.36 # Setup repositories for minimal packages (all versions) RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el8.rpm \ diff --git a/mysql-server/8.0/docker-entrypoint.sh b/mysql-server/8.0/docker-entrypoint.sh index b169c516c..db8968ac3 100755 --- a/mysql-server/8.0/docker-entrypoint.sh +++ b/mysql-server/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.35-1.2.14-server" +echo "[Entrypoint] MySQL Docker Image 8.0.36-1.2.15-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.35-1.2.14-server" + echo "[Entrypoint] Starting MySQL 8.0.36-1.2.15-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/8.0/inspec/control.rb b/mysql-server/8.0/inspec/control.rb index 31512a39a..bcc40fabe 100644 --- a/mysql-server/8.0/inspec/control.rb +++ b/mysql-server/8.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.35.*' } + its ('version') { should match '8.0.36.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.35.*' } + its ('version') { should match '8.0.36.*' } end end diff --git a/mysql-server/8.3/Dockerfile b/mysql-server/8.3/Dockerfile new file mode 100644 index 000000000..530132313 --- /dev/null +++ b/mysql-server/8.3/Dockerfile @@ -0,0 +1,45 @@ +# Copyright (c) 2017, 2023, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +FROM container-registry.oracle.com/os/oraclelinux:8-slim + +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.3.0 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.3.0 + +# Setup repositories for minimal packages (all versions) +RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el8.rpm \ + && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql80-community-release-el8.rpm + +# Install server and shell 8.0 +RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ + && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --disablerepo=ol8_appstream \ + --enablerepo=mysql-innovation-community-minimal $MYSQL_SERVER_PACKAGE \ + && microdnf remove mysql-community-minimal-release mysql80-community-release \ + && microdnf clean all \ + && mkdir /docker-entrypoint-initdb.d + +COPY prepare-image.sh / +RUN /prepare-image.sh && rm -f /prepare-image.sh + +ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock + +COPY docker-entrypoint.sh /entrypoint.sh +COPY healthcheck.sh /healthcheck.sh +ENTRYPOINT ["/entrypoint.sh"] +HEALTHCHECK CMD /healthcheck.sh +EXPOSE 3306 33060 33061 +CMD ["mysqld"] + diff --git a/mysql-server/8.3/docker-entrypoint.sh b/mysql-server/8.3/docker-entrypoint.sh new file mode 100755 index 000000000..1111b900e --- /dev/null +++ b/mysql-server/8.3/docker-entrypoint.sh @@ -0,0 +1,230 @@ +#!/bin/bash +# Copyright (c) 2017, 2021, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +echo "[Entrypoint] MySQL Docker Image 8.3.0-1.2.15-server" +# Fetch value from server config +# We use mysqld --verbose --help instead of my_print_defaults because the +# latter only show values present in config files, and not server defaults +_get_config() { + local conf="$1"; shift + "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' +} + +# Generate a random password +_mkpw() { + letter=$(cat /dev/urandom| tr -dc a-zA-Z | dd bs=1 count=16 2> /dev/null ) + number=$(cat /dev/urandom| tr -dc 0-9 | dd bs=1 count=8 2> /dev/null) + special=$(cat /dev/urandom| tr -dc '=+@#%^&*_.,;:?/' | dd bs=1 count=8 2> /dev/null) + + echo $letter$number$special | fold -w 1 | shuf | tr -d '\n' +} + +# If command starts with an option, prepend mysqld +# This allows users to add command-line options without +# needing to specify the "mysqld" command +if [ "${1:0:1}" = '-' ]; then + set -- mysqld "$@" +fi + +# Check if entrypoint (and the container) is running as root +if [ $(id -u) = "0" ]; then + is_root=1 + install_devnull="install /dev/null -m0600 -omysql -gmysql" + MYSQLD_USER=mysql +else + install_devnull="install /dev/null -m0600" + MYSQLD_USER=$(id -u) +fi + +if [ "$1" = 'mysqld' ]; then + # Test that the server can start. We redirect stdout to /dev/null so + # only the error messages are left. + result=0 + output=$("$@" --validate-config) || result=$? + if [ ! "$result" = "0" ]; then + echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' + echo >&2 "[Entrypoint] $output" + exit 1 + fi + + # Get config + DATADIR="$(_get_config 'datadir' "$@")" + SOCKET="$(_get_config 'socket' "$@")" + + if [ ! -d "$DATADIR/mysql" ]; then + # If the password variable is a filename we use the contents of the file. We + # read this first to make sure that a proper error is generated for empty files. + if [ -f "$MYSQL_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + if [ -z "$MYSQL_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' + exit 1 + fi + fi + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] No password option specified for new database.' + echo >&2 '[Entrypoint] A random onetime password will be generated.' + MYSQL_RANDOM_ROOT_PASSWORD=true + MYSQL_ONETIME_PASSWORD=true + fi + if [ ! -d "$DATADIR" ]; then + mkdir -p "$DATADIR" + chown mysql:mysql "$DATADIR" + fi + + # The user can set a default_timezone either in a my.cnf file + # they mount into the container or on command line + # (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`) + # however the timezone tables will only be populated in a later + # stage of this script. By using +00:00 as timezone we override + # the user's choice during initialization. Later the server + # will be restarted using the user's option. + + echo '[Entrypoint] Initializing database' + "$@" --user=$MYSQLD_USER --initialize-insecure --default-time-zone=+00:00 + + echo '[Entrypoint] Database initialized' + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" --default-time-zone=+00:00 + + # To avoid using password on commandline, put it in a temporary file. + # The file is only populated when and if the root password is set. + PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + $install_devnull "$PASSFILE" + # Define the client command used throughout the script + # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") + + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break + fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 + fi + + mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql + + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(_mkpw)" + echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + fi + if [ -z "$MYSQL_ROOT_HOST" ]; then + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';" + else + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ + GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + fi + "${mysql[@]}" <<-EOSQL + DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; + ${ROOTCREATE} + FLUSH PRIVILEGES ; + EOSQL + if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then + # Put the password into the temporary config file + cat >"$PASSFILE" < "$SQL" +ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL + fi + + echo + echo '[Entrypoint] MySQL init process done. Ready for start up.' + echo + fi + + # Used by healthcheck to make sure it doesn't mistakenly report container + # healthy during startup + # Put the password into the temporary config file + touch /var/lib/mysql-files/healthcheck.cnf + cat >"/var/lib/mysql-files/healthcheck.cnf" < Date: Tue, 16 Jan 2024 03:44:57 +0000 Subject: [PATCH 335/386] Release version 1.2.15-cluster * ET#79710: Bump versions for 8.3.0/8.0.36 Docker releases, removed 7.5/7.6 Cluster --- mysql-cluster/8.0/Dockerfile | 4 +- mysql-cluster/8.0/docker-entrypoint.sh | 4 +- mysql-cluster/8.0/inspec/control.rb | 4 +- mysql-cluster/8.3/Dockerfile | 47 +++++ mysql-cluster/8.3/cnf/my.cnf | 22 ++ mysql-cluster/8.3/cnf/mysql-cluster.cnf | 39 ++++ mysql-cluster/8.3/docker-entrypoint.sh | 264 ++++++++++++++++++++++++ mysql-cluster/8.3/healthcheck.sh | 24 +++ mysql-cluster/8.3/inspec/control.rb | 20 ++ mysql-cluster/8.3/prepare-image.sh | 25 +++ 10 files changed, 447 insertions(+), 6 deletions(-) create mode 100644 mysql-cluster/8.3/Dockerfile create mode 100644 mysql-cluster/8.3/cnf/my.cnf create mode 100644 mysql-cluster/8.3/cnf/mysql-cluster.cnf create mode 100755 mysql-cluster/8.3/docker-entrypoint.sh create mode 100755 mysql-cluster/8.3/healthcheck.sh create mode 100644 mysql-cluster/8.3/inspec/control.rb create mode 100755 mysql-cluster/8.3/prepare-image.sh diff --git a/mysql-cluster/8.0/Dockerfile b/mysql-cluster/8.0/Dockerfile index 60c28b530..cbec5fc3c 100644 --- a/mysql-cluster/8.0/Dockerfile +++ b/mysql-cluster/8.0/Dockerfile @@ -15,8 +15,8 @@ FROM container-registry.oracle.com/os/oraclelinux:8-slim -ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.0.35 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.35 +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.0.36 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.36 # Setup repositories for minimal packages (all versions) RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-cluster-community-minimal-release-el8.rpm \ diff --git a/mysql-cluster/8.0/docker-entrypoint.sh b/mysql-cluster/8.0/docker-entrypoint.sh index 8d2a346b1..2546f2202 100755 --- a/mysql-cluster/8.0/docker-entrypoint.sh +++ b/mysql-cluster/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.35-1.2.14-cluster" +echo "[Entrypoint] MySQL Docker Image 8.0.36-1.2.15-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -227,7 +227,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.35-1.2.14-cluster" + echo "[Entrypoint] Starting MySQL 8.0.36-1.2.15-cluster" fi export MYSQLD_PARENT_PID=$$ ; exec "$@" --user= else diff --git a/mysql-cluster/8.0/inspec/control.rb b/mysql-cluster/8.0/inspec/control.rb index a2aebfd8a..41432094d 100644 --- a/mysql-cluster/8.0/inspec/control.rb +++ b/mysql-cluster/8.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.35.*' } + its ('version') { should match '8.0.36.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.35.*' } + its ('version') { should match '8.0.36.*' } end end diff --git a/mysql-cluster/8.3/Dockerfile b/mysql-cluster/8.3/Dockerfile new file mode 100644 index 000000000..d915a6a1f --- /dev/null +++ b/mysql-cluster/8.3/Dockerfile @@ -0,0 +1,47 @@ +# Copyright (c) 2017, 2023, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +FROM container-registry.oracle.com/os/oraclelinux:8-slim + +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.3.0 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.3.0 + +# Setup repositories for minimal packages (all versions) +RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-cluster-community-minimal-release-el8.rpm \ + && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql80-community-release-el8.rpm + +# Install server and shell 8.0 +RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ + && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --disablerepo=ol8_appstream \ + --enablerepo=mysql-cluster-innovation-community-minimal $MYSQL_SERVER_PACKAGE \ + && microdnf clean all \ + && mkdir /docker-entrypoint-initdb.d + +COPY prepare-image.sh / +RUN /prepare-image.sh && rm -f /prepare-image.sh + +ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock + +COPY docker-entrypoint.sh /entrypoint.sh +COPY healthcheck.sh /healthcheck.sh +COPY cnf/my.cnf /etc/ +COPY cnf/mysql-cluster.cnf /etc/ + +ENTRYPOINT ["/entrypoint.sh"] +HEALTHCHECK CMD /healthcheck.sh +EXPOSE 3306 33060-33061 2202 1186 +CMD ["mysqld"] + diff --git a/mysql-cluster/8.3/cnf/my.cnf b/mysql-cluster/8.3/cnf/my.cnf new file mode 100644 index 000000000..ec98b2dc1 --- /dev/null +++ b/mysql-cluster/8.3/cnf/my.cnf @@ -0,0 +1,22 @@ +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +[mysqld] +ndbcluster +ndb-connectstring=192.168.0.2 +user=mysql + +[mysql_cluster] +ndb-connectstring=192.168.0.2 diff --git a/mysql-cluster/8.3/cnf/mysql-cluster.cnf b/mysql-cluster/8.3/cnf/mysql-cluster.cnf new file mode 100644 index 000000000..16f79f1c0 --- /dev/null +++ b/mysql-cluster/8.3/cnf/mysql-cluster.cnf @@ -0,0 +1,39 @@ +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +[ndbd default] +NoOfReplicas=2 +DataMemory=80M +IndexMemory=18M + + +[ndb_mgmd] +NodeId=1 +hostname=192.168.0.2 +datadir=/var/lib/mysql + +[ndbd] +NodeId=2 +hostname=192.168.0.3 +datadir=/var/lib/mysql + +[ndbd] +NodeId=3 +hostname=192.168.0.4 +datadir=/var/lib/mysql + +[mysqld] +NodeId=4 +hostname=192.168.0.10 diff --git a/mysql-cluster/8.3/docker-entrypoint.sh b/mysql-cluster/8.3/docker-entrypoint.sh new file mode 100755 index 000000000..9c130f143 --- /dev/null +++ b/mysql-cluster/8.3/docker-entrypoint.sh @@ -0,0 +1,264 @@ +#!/bin/bash +# Copyright (c) 2017, 2021, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +echo "[Entrypoint] MySQL Docker Image " +# Fetch value from server config +# We use mysqld --verbose --help instead of my_print_defaults because the +# latter only show values present in config files, and not server defaults +_get_config() { + local conf="$1"; shift + "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' +} + +# Generate a random password +_mkpw() { + letter=$(cat /dev/urandom| tr -dc a-zA-Z | dd bs=1 count=16 2> /dev/null ) + number=$(cat /dev/urandom| tr -dc 0-9 | dd bs=1 count=8 2> /dev/null) + special=$(cat /dev/urandom| tr -dc '=+@#%^&*_.,;:?/' | dd bs=1 count=8 2> /dev/null) + + echo $letter$number$special | fold -w 1 | shuf | tr -d '\n' +} + +# If command starts with an option, prepend mysqld +# This allows users to add command-line options without +# needing to specify the "mysqld" command +if [ "${1:0:1}" = '-' ]; then + set -- mysqld "$@" +fi + +# Check if entrypoint (and the container) is running as root +if [ $(id -u) = "0" ]; then + is_root=1 + install_devnull="install /dev/null -m0600 -omysql -gmysql" + MYSQLD_USER=mysql +else + install_devnull="install /dev/null -m0600" + MYSQLD_USER=$(id -u) +fi + +if [ "$1" = 'mysqld' ]; then + # Test that the server can start. We redirect stdout to /dev/null so + # only the error messages are left. + result=0 + output=$("$@" --validate-config) || result=$? + if [ ! "$result" = "0" ]; then + echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' + echo >&2 "[Entrypoint] $output" + exit 1 + fi + + # Get config + DATADIR="$(_get_config 'datadir' "$@")" + SOCKET="$(_get_config 'socket' "$@")" + + if [ ! -d "$DATADIR/mysql" ]; then + # If the password variable is a filename we use the contents of the file. We + # read this first to make sure that a proper error is generated for empty files. + if [ -f "$MYSQL_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + if [ -z "$MYSQL_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' + exit 1 + fi + fi + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] No password option specified for new database.' + echo >&2 '[Entrypoint] A random onetime password will be generated.' + MYSQL_RANDOM_ROOT_PASSWORD=true + MYSQL_ONETIME_PASSWORD=true + fi + if [ ! -d "$DATADIR" ]; then + mkdir -p "$DATADIR" + chown mysql:mysql "$DATADIR" + fi + + # The user can set a default_timezone either in a my.cnf file + # they mount into the container or on command line + # (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`) + # however the timezone tables will only be populated in a later + # stage of this script. By using +00:00 as timezone we override + # the user's choice during initialization. Later the server + # will be restarted using the user's option. + + echo '[Entrypoint] Initializing database' + "$@" --user=$MYSQLD_USER --initialize-insecure --default-time-zone=+00:00 + + echo '[Entrypoint] Database initialized' + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" --default-time-zone=+00:00 + + # To avoid using password on commandline, put it in a temporary file. + # The file is only populated when and if the root password is set. + PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + $install_devnull "$PASSFILE" + # Define the client command used throughout the script + # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") + + if [ ! -z %%STARTUP_WAIT%% ]; + then + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break + fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 + fi + fi + + mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql + + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(_mkpw)" + echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + fi + if [ -z "$MYSQL_ROOT_HOST" ]; then + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';" + else + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ + GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + fi + "${mysql[@]}" <<-EOSQL + DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; + ${ROOTCREATE} + FLUSH PRIVILEGES ; + EOSQL + if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then + # Put the password into the temporary config file + cat >"$PASSFILE" < "$SQL" +ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL + fi + fi + + echo + echo '[Entrypoint] MySQL init process done. Ready for start up.' + echo + fi + + # Used by healthcheck to make sure it doesn't mistakenly report container + # healthy during startup + # Put the password into the temporary config file + touch /var/lib/mysql-files/healthcheck.cnf + cat >"/var/lib/mysql-files/healthcheck.cnf" < Date: Tue, 16 Jan 2024 04:12:18 +0000 Subject: [PATCH 336/386] Release version 1.0.15-router * ET#79710: Bump versions for 8.3.0/8.0.36 Docker releases, removed 7.5/7.6 Cluster * Fix bug#i35964936 MySQL Router container image does not expose 6450 port for read/write splitting --- mysql-router/8.0/Dockerfile | 6 +- mysql-router/8.0/inspec/control.rb | 4 +- mysql-router/8.3/Dockerfile | 39 +++++++++++ mysql-router/8.3/README.md | 88 +++++++++++++++++++++++++ mysql-router/8.3/inspec/control.rb | 20 ++++++ mysql-router/8.3/run.sh | 101 +++++++++++++++++++++++++++++ 6 files changed, 253 insertions(+), 5 deletions(-) create mode 100644 mysql-router/8.3/Dockerfile create mode 100644 mysql-router/8.3/README.md create mode 100644 mysql-router/8.3/inspec/control.rb create mode 100755 mysql-router/8.3/run.sh diff --git a/mysql-router/8.0/Dockerfile b/mysql-router/8.0/Dockerfile index 373ad965d..c9289daf5 100644 --- a/mysql-router/8.0/Dockerfile +++ b/mysql-router/8.0/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM container-registry.oracle.com/os/oraclelinux:8-slim -ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.35 -ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.35 +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.36 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.36 ARG CONFIG_PACKAGE_NAME=mysql80-community-release-el8.rpm ARG REPO_NAME_SERVER=mysql80-community ARG REPO_NAME_TOOLS=mysql-tools-community @@ -33,7 +33,7 @@ RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ COPY run.sh /run.sh HEALTHCHECK \ CMD mysqladmin --port 6446 --protocol TCP ping 2>&1 | grep Access || exit 1 -EXPOSE 6446 6447 6448 6449 8443 +EXPOSE 6446 6447 6448 6449 6450 8443 USER 999:999 ENTRYPOINT ["/run.sh"] CMD ["mysqlrouter"] diff --git a/mysql-router/8.0/inspec/control.rb b/mysql-router/8.0/inspec/control.rb index 21a8251bb..6d95df20c 100644 --- a/mysql-router/8.0/inspec/control.rb +++ b/mysql-router/8.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-client') do it { should be_installed } - its ('version') { should match '8.0.35.*' } + its ('version') { should match '8.0.36.*' } end describe package('mysql-router-community') do it { should be_installed } - its ('version') { should match '8.0.35.*' } + its ('version') { should match '8.0.36.*' } end end diff --git a/mysql-router/8.3/Dockerfile b/mysql-router/8.3/Dockerfile new file mode 100644 index 000000000..51338541c --- /dev/null +++ b/mysql-router/8.3/Dockerfile @@ -0,0 +1,39 @@ +# Copyright (c) 2018, 2023, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +FROM container-registry.oracle.com/os/oraclelinux:8-slim + +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.3.0 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.3.0 +ARG CONFIG_PACKAGE_NAME=mysql80-community-release-el8.rpm +ARG REPO_NAME_SERVER=mysql-innovation-community +ARG REPO_NAME_TOOLS=mysql-tools-innovation-community + +RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ + && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ + -c "MySQL Router" mysqlrouter \ + && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/$CONFIG_PACKAGE_NAME \ + && microdnf install -y --disablerepo=\* \ + --enablerepo=mysql-innovation-community $MYSQL_CLIENT_PACKAGE \ + && microdnf install -y --disablerepo=\* \ + --enablerepo=mysql-tools-innovation-community $MYSQL_ROUTER_PACKAGE \ + && microdnf clean all + +COPY run.sh /run.sh +HEALTHCHECK \ + CMD mysqladmin --port 6446 --protocol TCP ping 2>&1 | grep Access || exit 1 +EXPOSE 6446 6447 6448 6449 6450 8443 +USER 999:999 +ENTRYPOINT ["/run.sh"] +CMD ["mysqlrouter"] diff --git a/mysql-router/8.3/README.md b/mysql-router/8.3/README.md new file mode 100644 index 000000000..0f2711ba5 --- /dev/null +++ b/mysql-router/8.3/README.md @@ -0,0 +1,88 @@ +![logo](https://www.mysql.com/common/logos/logo-mysql-170x115.png) + +# What is MySQL Router? + +MySQL Router is part of InnoDB cluster, and is lightweight middleware that +provides transparent routing between your application and back-end MySQL +Servers. It can be used for a wide variety of use cases, such as providing high +availability and scalability by effectively routing database traffic to +appropriate back-end MySQL Servers. The pluggable architecture also enables +developers to extend MySQL Router for custom use cases. + +# Supported Tags and Respective Dockerfile Links + +* MySQL Router 8.0 (tag: [`latest`, `8.0`](https://github.com/mysql/mysql-docker/blob/mysql-router/8.0/Dockerfile)) ([mysql-router/8.0/Dockerfile](https://github.com/mysql/mysql-docker/blob/mysql-router/8.0/Dockerfile)) + +Images are updated when new MySQL Server maintenance releases and development milestones are published. Please note that non-GA releases are for preview purposes only and should not be used in production setups. + +# How to Use the MySQL Router Images + +The image currently uses the following mandatory variables: + +| Variable | Description | +| ------------------------ | ------------------------------------------- | +| MYSQL_HOST | MySQL host to connect to | +| MYSQL_PORT | Port to use | +| MYSQL_USER | User to connect with | +| MYSQL_PASSWORD | Password to connect with | + +Running in a container requires a working InnoDB cluster. + +The image uses the following optional variables: + +| Variable | Description | +| ------------------------------------ | ------------------------------------------- | +| MYSQL_INNODB_CLUSTER_MEMBERS | Wait for at least this number of cluster instances to be ONLINE | +| MYSQL_CREATE_ROUTER_USER | Whether to create a new account for the Router to use when it's running. Defaults to 1, set to 0 to disable. | +| MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS | Additional command line options applied while bootstrapping + +If supplied the run script waits for the given mysql host to be up, the InnoDB cluster to have +MYSQL_INNODB_CLUSTER_MEMBERS members and then uses the given server for its +bootstrap mode +[Bootstrapping](https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-deploying-bootstrapping.html). + +The image can be run via: + +``` +docker run -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -e MYSQL_INNODB_CLUSTER_MEMBERS=3 -ti mysql/mysql-router +``` + +Additional command line options for running MySQL Router after bootstrap can be passed a command options. For instance you can use a config file from your home directory like this: + +``` +docker run -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -ti -v $HOME/router-extra.conf:/tmp/router-extra.conf mysql/mysql-router mysqlrouter --extra-config=/tmp/router-extra.conf +``` + +It can be verified by typing: + +``` +docker ps +``` + +The following output should be displayed: + +``` +4954b1c80be1 mysql-router:8.0 "/run.sh mysqlrouter" About a minute ago Up About a minute (healthy) 6447/tcp, 6448/tcp, 0.0.0.0:6446->6446/tcp, 6449/tcp innodbcluster_mysql-router_1 +``` + +By default the container will run as user 999:999 which maps to mysqlrouter:mysqlrouter inside the container. + +# Exposed Ports + +The following TCP ports are exposed by the MySQL Router container: + +| Port | Description +| ----- | --------------------------------------------------------------------------------------- | +| 6446 | R/W connection port. Clients that connect to this port will be forwarded to the PRIMARY | +| 6447 | R/O connection port. Clients that connect to this port will be forwarded to a SECONDARY | +| 6448 | X Protocol R/W connection port. R/W port for X protocol client connections | +| 6449 | X Protocol R/O connection port. R/O port for X protocol client connections | +| 8443 | HTTPS REST interface port. | + +For more information about the REST interface API, see: + +https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-rest-api-reference.html + +For full usage documentation, see: + +https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-installation-docker.html diff --git a/mysql-router/8.3/inspec/control.rb b/mysql-router/8.3/inspec/control.rb new file mode 100644 index 000000000..7b00c4120 --- /dev/null +++ b/mysql-router/8.3/inspec/control.rb @@ -0,0 +1,20 @@ +control 'container' do + impact 0.5 + describe podman.containers do + its('status') { should cmp /Up/ } + its('commands') { should cmp /sleep/ } + its('images') { should cmp /mysql-router:8.3/ } + its('names') { should include "mysql-router-8.3" } + end +end +control 'packages' do + impact 0.5 + describe package('mysql-community-client') do + it { should be_installed } + its ('version') { should match '8.3.0.*' } + end + describe package('mysql-router-community') do + it { should be_installed } + its ('version') { should match '8.3.0.*' } + end +end diff --git a/mysql-router/8.3/run.sh b/mysql-router/8.3/run.sh new file mode 100755 index 000000000..f806c1afe --- /dev/null +++ b/mysql-router/8.3/run.sh @@ -0,0 +1,101 @@ +#!/bin/bash +# Copyright (c) 2018, 2021, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +if [ "$1" = 'mysqlrouter' ]; then + if [[ -z $MYSQL_HOST || -z $MYSQL_PORT || -z $MYSQL_USER || -z $MYSQL_PASSWORD ]]; then + echo "We require all of" + echo " MYSQL_HOST" + echo " MYSQL_PORT" + echo " MYSQL_USER" + echo " MYSQL_PASSWORD" + echo "to be set." + echo "In addition you can set" + echo " MYSQL_INNODB_CLUSTER_MEMBERS " + echo " MYSQL_CREATE_ROUTER_USER" + echo " MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS" + echo "Exiting." + exit 1 + fi + + PASSFILE=$(mktemp) + echo "$MYSQL_PASSWORD" > "$PASSFILE" + if [ -z $MYSQL_CREATE_ROUTER_USER ]; then + echo "$MYSQL_PASSWORD" >> "$PASSFILE" + MYSQL_CREATE_ROUTER_USER=1 + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is not set, Router will generate a new account to be used at runtime." + echo "[Entrypoint] Set it to 0 to reuse $MYSQL_USER instead." + elif [ "$MYSQL_CREATE_ROUTER_USER" = "0" ]; then + echo "$MYSQL_PASSWORD" >> "$PASSFILE" + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is 0, Router will reuse $MYSQL_USER account at runtime" + else + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is not 0, Router will generate a new account to be used at runtime" + fi + + DEFAULTS_EXTRA_FILE=$(mktemp) + cat >"$DEFAULTS_EXTRA_FILE" < "/dev/tcp/$MYSQL_HOST/$MYSQL_PORT") >/dev/null 2>&1; do + echo "[Entrypoint] Waiting for mysql server $MYSQL_HOST ($attempt_num/$max_tries)" + sleep $(( attempt_num++ )) + if (( attempt_num == max_tries )); then + exit 1 + fi + done + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST:$MYSQL_PORT. Checking for cluster state." + if ! [[ "$(mysql --defaults-extra-file="$DEFAULTS_EXTRA_FILE" -u "$MYSQL_USER" -h "$MYSQL_HOST" -P "$MYSQL_PORT" -e "show status;" 2> /dev/null)" ]]; then + echo "[Entrypoint] ERROR: Can not connect to database. Exiting." + exit 1 + fi + if [[ -n $MYSQL_INNODB_CLUSTER_MEMBERS ]]; then + attempt_num=0 + echo $attempt_num + echo $max_tries + until [ "$(mysql --defaults-extra-file="$DEFAULTS_EXTRA_FILE" -u "$MYSQL_USER" -h "$MYSQL_HOST" -P "$MYSQL_PORT" -N performance_schema -e "select count(MEMBER_STATE) >= $MYSQL_INNODB_CLUSTER_MEMBERS from replication_group_members where MEMBER_STATE = 'ONLINE';" 2> /dev/null)" -eq 1 ]; do + echo "[Entrypoint] Waiting for $MYSQL_INNODB_CLUSTER_MEMBERS cluster instances to become available via $MYSQL_HOST ($attempt_num/$max_tries)" + sleep $(( attempt_num++ )) + if (( attempt_num == max_tries )); then + exit 1 + fi + done + echo "[Entrypoint] Successfully contacted cluster with $MYSQL_INNODB_CLUSTER_MEMBERS members. Bootstrapping." + fi + if [ $(id -u) = "0" ]; then + opt_user=--user=mysqlrouter + fi + if [ "$MYSQL_CREATE_ROUTER_USER" = "0" ]; then + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap reusing account \"$MYSQL_USER\"." + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force --account-create=never --account=$MYSQL_USER $opt_user $MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS < "$PASSFILE" || exit 1 + else + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap." + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force $opt_user $MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS < "$PASSFILE" || exit 1 + fi + + sed -i -e 's/logging_folder=.*$/logging_folder=/' /tmp/mysqlrouter/mysqlrouter.conf + echo "[Entrypoint] Starting mysql-router." + exec "$@" --config /tmp/mysqlrouter/mysqlrouter.conf + + rm -f "$PASSFILE" + rm -f "$DEFAULTS_EXTRA_FILE" + unset DEFAULTS_EXTRA_FILE +else + exec "$@" +fi From 41366543f5f4f011f05ab0208284ae77640b2402 Mon Sep 17 00:00:00 2001 From: Nawaz Nazeer Ahamed Date: Fri, 23 Feb 2024 08:38:20 +0100 Subject: [PATCH 337/386] ET#80446 - Switch base image and add support for EL9 platform Change-Id: I2b4480c9b5fb27c7da3ce01ab5b3ed7bf939a23b --- mysql-cluster/gen_dockerfiles.sh | 4 ++-- mysql-cluster/template/Dockerfile | 4 ++-- mysql-router/gen_dockerfiles.sh | 5 +---- mysql-router/template/Dockerfile | 2 +- mysql-server/gen_dockerfiles.sh | 4 ++-- mysql-server/template/Dockerfile | 6 +++--- 6 files changed, 11 insertions(+), 14 deletions(-) diff --git a/mysql-cluster/gen_dockerfiles.sh b/mysql-cluster/gen_dockerfiles.sh index 56979a5a2..821645b04 100755 --- a/mysql-cluster/gen_dockerfiles.sh +++ b/mysql-cluster/gen_dockerfiles.sh @@ -24,8 +24,8 @@ source ./VERSION REPO=https://repo.mysql.com; [ -n "$1" ] && REPO=$1 MYSQL_VERSION=""; [ -n "$2" ] && MYSQL_VERSION=$2 SHELL_VERSION=""; [ -n "$3" ] && SHELL_VERSION=$3 -CONFIG_PACKAGE_NAME=mysql80-community-release-el8.rpm; [ -n "$4" ] && CONFIG_PACKAGE_NAME=$4 -CONFIG_PACKAGE_NAME_MINIMAL=mysql-cluster-community-minimal-release-el8.rpm; [ -n "$5" ] && CONFIG_PACKAGE_NAME_MINIMAL=$5 +CONFIG_PACKAGE_NAME=mysql80-community-release-el9.rpm; [ -n "$4" ] && CONFIG_PACKAGE_NAME=$4 +CONFIG_PACKAGE_NAME_MINIMAL=mysql-cluster-community-minimal-release-el9.rpm; [ -n "$5" ] && CONFIG_PACKAGE_NAME_MINIMAL=$5 REPO_NAME_SERVER=mysql-cluster80-community-minimal; [ -n "$6" ] && REPO_NAME_SERVER=$6 REPO_NAME_TOOLS=mysql-tools-community; [ -n "$7" ] && REPO_NAME_TOOLS=$7 diff --git a/mysql-cluster/template/Dockerfile b/mysql-cluster/template/Dockerfile index 0c71f0811..e017eae24 100644 --- a/mysql-cluster/template/Dockerfile +++ b/mysql-cluster/template/Dockerfile @@ -13,7 +13,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -FROM container-registry.oracle.com/os/oraclelinux:8-slim +FROM container-registry.oracle.com/os/oraclelinux:9-slim ARG MYSQL_SERVER_PACKAGE=%%MYSQL_SERVER_PACKAGE%% ARG MYSQL_SHELL_PACKAGE=%%MYSQL_SHELL_PACKAGE%% @@ -25,7 +25,7 @@ RUN rpm -U %%REPO%%/%%CONFIG_PACKAGE_NAME_MINIMAL%% \ # Install server and shell 8.0 RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ && microdnf install -y --enablerepo=%%REPO_NAME_TOOLS%% $MYSQL_SHELL_PACKAGE \ - && microdnf install -y --disablerepo=ol8_appstream \ + && microdnf install -y --disablerepo=ol9_appstream \ --enablerepo=%%REPO_NAME_SERVER%% $MYSQL_SERVER_PACKAGE \ && microdnf clean all \ && mkdir /docker-entrypoint-initdb.d diff --git a/mysql-router/gen_dockerfiles.sh b/mysql-router/gen_dockerfiles.sh index 5071f585e..f623794e7 100755 --- a/mysql-router/gen_dockerfiles.sh +++ b/mysql-router/gen_dockerfiles.sh @@ -5,7 +5,7 @@ set -e source ./VERSION REPO=https://repo.mysql.com; [ -n "$1" ] && REPO=$1 -CONFIG_PACKAGE_NAME=mysql80-community-release-el8.rpm; [ -n "$2" ] && CONFIG_PACKAGE_NAME=$2 +CONFIG_PACKAGE_NAME=mysql80-community-release-el9.rpm; [ -n "$2" ] && CONFIG_PACKAGE_NAME=$2 MYSQL_CLIENT_PACKAGE_NAME=mysql-community-client; [ -n "$3" ] && MYSQL_CLIENT_PACKAGE_NAME=$3 MYSQL_ROUTER_PACKAGE_NAME=mysql-router-community; [ -n "$4" ] && MYSQL_ROUTER_PACKAGE_NAME=$4 MYSQL_CLIENT_VERSION=mysql-community-client; [ -n "$5" ] && MYSQL_CLIENT_VERSION=$5 @@ -23,9 +23,6 @@ echo `ls` if [ ! -d "${MAJOR_VERSION}" ]; then mkdir -p "${MAJOR_VERSION}/inspec" fi -echo `ls -lrt` -echo 'inside 8.1' -echo `ls -lrt 8.1` sed 's#%%MYSQL_CLIENT_PACKAGE%%#'"${MYSQL_CLIENT_PACKAGE}"'#g' template/Dockerfile > tmpFile sed -i 's#%%MYSQL_ROUTER_PACKAGE%%#'"${MYSQL_ROUTER_PACKAGE}"'#g' tmpFile diff --git a/mysql-router/template/Dockerfile b/mysql-router/template/Dockerfile index f599f37e1..bf04676ed 100644 --- a/mysql-router/template/Dockerfile +++ b/mysql-router/template/Dockerfile @@ -12,7 +12,7 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -FROM container-registry.oracle.com/os/oraclelinux:8-slim +FROM container-registry.oracle.com/os/oraclelinux:9-slim ARG MYSQL_CLIENT_PACKAGE=%%MYSQL_CLIENT_PACKAGE%% ARG MYSQL_ROUTER_PACKAGE=%%MYSQL_ROUTER_PACKAGE%% diff --git a/mysql-server/gen_dockerfiles.sh b/mysql-server/gen_dockerfiles.sh index 83c0b7d79..8605d269f 100755 --- a/mysql-server/gen_dockerfiles.sh +++ b/mysql-server/gen_dockerfiles.sh @@ -20,8 +20,8 @@ set -e source ./VERSION REPO=https://repo.mysql.com; [ -n "$1" ] && REPO=$1 -CONFIG_PACKAGE_NAME=mysql80-community-release-el8.rpm; [ -n "$2" ] && CONFIG_PACKAGE_NAME=$2 -CONFIG_PACKAGE_NAME_MINIMAL=mysql-community-minimal-release-el8.rpm; [ -n "$3" ] && CONFIG_PACKAGE_NAME_MINIMAL=$3 +CONFIG_PACKAGE_NAME=mysql80-community-release-el9.rpm; [ -n "$2" ] && CONFIG_PACKAGE_NAME=$2 +CONFIG_PACKAGE_NAME_MINIMAL=mysql-community-minimal-release-el9.rpm; [ -n "$3" ] && CONFIG_PACKAGE_NAME_MINIMAL=$3 REPO_NAME_SERVER=mysql80-community-minimal; [ -n "$4" ] && REPO_NAME_SERVER=$4 REPO_NAME_TOOLS=mysql-tools-community; [ -n "$5" ] && REPO_NAME_TOOLS=$5 diff --git a/mysql-server/template/Dockerfile b/mysql-server/template/Dockerfile index c0cc05021..b5b4b6d5e 100644 --- a/mysql-server/template/Dockerfile +++ b/mysql-server/template/Dockerfile @@ -13,7 +13,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -FROM container-registry.oracle.com/os/oraclelinux:8-slim +FROM container-registry.oracle.com/os/oraclelinux:9-slim ARG MYSQL_SERVER_PACKAGE=%%MYSQL_SERVER_PACKAGE%% ARG MYSQL_SHELL_PACKAGE=%%MYSQL_SHELL_PACKAGE%% @@ -25,9 +25,9 @@ RUN rpm -U %%REPO%%/%%CONFIG_PACKAGE_NAME_MINIMAL%% \ # Install server and shell 8.0 RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ && microdnf install -y --enablerepo=%%REPO_NAME_TOOLS%% $MYSQL_SHELL_PACKAGE \ - && microdnf install -y --disablerepo=ol8_appstream \ + && microdnf install -y --disablerepo=ol9_appstream \ --enablerepo=%%REPO_NAME_SERVER%% $MYSQL_SERVER_PACKAGE \ - && microdnf remove %%MYSQL_CONFIG_PKG_MINIMAL%% %%MYSQL_CONFIG_PKG%% \ + && microdnf remove -y %%MYSQL_CONFIG_PKG_MINIMAL%% %%MYSQL_CONFIG_PKG%% \ && microdnf clean all \ && mkdir /docker-entrypoint-initdb.d From 5c1d0e88221c509b25893fbe641e36bfd9656f9b Mon Sep 17 00:00:00 2001 From: Nawaz Nazeer Ahamed Date: Mon, 26 Feb 2024 08:32:33 +0100 Subject: [PATCH 338/386] ET#80557 - Add support for 8.4 LTS release Change-Id: I29aa2e8878742ed3de9ed5a6664e2335b4eedd90 --- mysql-server/VERSION | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/mysql-server/VERSION b/mysql-server/VERSION index 0f8707c98..c27ad1532 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,17 +1,20 @@ IMAGE_VERSION=1.2.15-server -LATEST="8.3" -LATEST_INNOVATION="8.3" +LATEST="8.4" +LATEST_LTS="8.4" +LATEST_INNOVATION="9.0" declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["8.0"]=8.0.36 -MYSQL_SERVER_VERSIONS["latest"]=8.3.0 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.37 +MYSQL_SERVER_VERSIONS["latest-lts"]=8.4.0 WEEKLY_SERVER_VERSIONS["8.0"]=8.0.37 -WEEKLY_SERVER_VERSIONS["latest"]=8.4.0 +WEEKLY_SERVER_VERSIONS["latest-lts"]=8.4.1 +WEEKLY_SERVER_VERSIONS["latest-innovation"]=9.0.0 declare -A MYSQL_SHELL_VERSIONS WEEKLY_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["8.0"]=8.0.36 -MYSQL_SHELL_VERSIONS["latest"]=8.3.0 +MYSQL_SHELL_VERSIONS["latest-lts"]=8.4.0 WEEKLY_SHELL_VERSIONS["8.0"]=8.0.37 -WEEKLY_SHELL_VERSIONS["latest"]=8.4.0 \ No newline at end of file +WEEKLY_SHELL_VERSIONS["latest-lts"]=8.4.1 +WEEKLY_SHELL_VERSIONS["latest-innovation"]=9.0.0 From 499c57285292016d1ee36739191c42c33947c392 Mon Sep 17 00:00:00 2001 From: Nawaz Nazeer Ahamed Date: Thu, 7 Mar 2024 09:58:20 +0100 Subject: [PATCH 339/386] ET#80681 - Update Server, Cluster & Router docker files to support 8.4 LTS release Change-Id: I0930a52aab04ad15b4e1bbc126d10cf1e8ce7b57 --- mysql-cluster/VERSION | 17 +++++++++-------- mysql-router/VERSION | 25 ++++++++++++++----------- mysql-router/template/Dockerfile | 2 +- mysql-server/VERSION | 16 ++++++++-------- 4 files changed, 32 insertions(+), 28 deletions(-) diff --git a/mysql-cluster/VERSION b/mysql-cluster/VERSION index ab119d3c7..8ca45eda9 100644 --- a/mysql-cluster/VERSION +++ b/mysql-cluster/VERSION @@ -1,15 +1,16 @@ -IMAGE_VERSION=1.2.15-cluster -LATEST="8.3" -LATEST_INNOVATION="8.3" +IMAGE_VERSION=1.2.16-cluster +LATEST="8.4" +LATEST_LTS="8.4" +LATEST_INNOVATION="9.0" declare -A MYSQL_CLUSTER_VERSIONS -MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.36 -MYSQL_CLUSTER_VERSIONS["latest"]=8.3.0 +MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.37 +MYSQL_CLUSTER_VERSIONS["latest-lts-84"]=8.4.0 declare -A MYSQL_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["8.0"]=8.0.36 -MYSQL_SHELL_VERSIONS["latest"]=8.3.0 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.37 +MYSQL_SHELL_VERSIONS["latest-lts-84"]=8.4.0 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["8.0"]="${MYSQL_CLUSTER_VERSIONS["8.0"]}-${IMAGE_VERSION}" -FULL_SERVER_VERSIONS["latest"]="${MYSQL_CLUSTER_VERSIONS["latest"]}-${IMAGE_VERSION}" +FULL_SERVER_VERSIONS["latest-lts-84"]="${MYSQL_CLUSTER_VERSIONS["latest-lts-84"]}-${IMAGE_VERSION}" diff --git a/mysql-router/VERSION b/mysql-router/VERSION index bff0336c5..e8bb2088d 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -1,17 +1,20 @@ -IMAGE_VERSION=1.0.15-router -LATEST="8.3" -LATEST_INNOVATION="8.3" +IMAGE_VERSION=1.0.16-router +LATEST="8.4" +LATEST_LTS="8.4" +LATEST_INNOVATION="9.0" declare -A MYSQL_ROUTER_VERSIONS WEEKLY_ROUTER_VERSIONS -MYSQL_ROUTER_VERSIONS["8.0"]=8.0.36 -MYSQL_ROUTER_VERSIONS["latest"]=8.3.0 +MYSQL_ROUTER_VERSIONS["8.0"]=8.0.37 +MYSQL_ROUTER_VERSIONS["latest-lts-84"]=8.4.0 -WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.37 -WEEKLY_ROUTER_VERSIONS["latest"]=8.4.0 +WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.38 +WEEKLY_ROUTER_VERSIONS["latest-lts-84"]=8.4.1 +WEEKLY_ROUTER_VERSIONS["latest-innovation"]=9.0.0 declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["8.0"]=8.0.36 -MYSQL_SERVER_VERSIONS["latest"]=8.3.0 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.37 +MYSQL_SERVER_VERSIONS["latest-lts-84"]=8.4.0 -WEEKLY_SERVER_VERSIONS["8.0"]=8.0.37 -WEEKLY_SERVER_VERSIONS["latest"]=8.4.0 +WEEKLY_SERVER_VERSIONS["8.0"]=8.0.38 +WEEKLY_SERVER_VERSIONS["latest-lts-84"]=8.4.1 +WEEKLY_SERVER_VERSIONS["latest-innovation"]=9.0.0 diff --git a/mysql-router/template/Dockerfile b/mysql-router/template/Dockerfile index bf04676ed..0f9990893 100644 --- a/mysql-router/template/Dockerfile +++ b/mysql-router/template/Dockerfile @@ -24,7 +24,7 @@ RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ -c "MySQL Router" mysqlrouter \ && rpm -U %%REPO%%/$CONFIG_PACKAGE_NAME \ - && microdnf install -y --disablerepo=\* \ + && microdnf install -y \ --enablerepo=%%REPO_NAME_SERVER%% $MYSQL_CLIENT_PACKAGE \ && microdnf install -y --disablerepo=\* \ --enablerepo=%%REPO_NAME_TOOLS%% $MYSQL_ROUTER_PACKAGE \ diff --git a/mysql-server/VERSION b/mysql-server/VERSION index c27ad1532..ddd286d1d 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,20 +1,20 @@ -IMAGE_VERSION=1.2.15-server +IMAGE_VERSION=1.2.16-server LATEST="8.4" LATEST_LTS="8.4" LATEST_INNOVATION="9.0" declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["8.0"]=8.0.37 -MYSQL_SERVER_VERSIONS["latest-lts"]=8.4.0 +MYSQL_SERVER_VERSIONS["latest-lts-84"]=8.4.0 -WEEKLY_SERVER_VERSIONS["8.0"]=8.0.37 -WEEKLY_SERVER_VERSIONS["latest-lts"]=8.4.1 +WEEKLY_SERVER_VERSIONS["8.0"]=8.0.38 +WEEKLY_SERVER_VERSIONS["latest-lts-84"]=8.4.1 WEEKLY_SERVER_VERSIONS["latest-innovation"]=9.0.0 declare -A MYSQL_SHELL_VERSIONS WEEKLY_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["8.0"]=8.0.36 -MYSQL_SHELL_VERSIONS["latest-lts"]=8.4.0 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.37 +MYSQL_SHELL_VERSIONS["latest-lts-84"]=8.4.0 -WEEKLY_SHELL_VERSIONS["8.0"]=8.0.37 -WEEKLY_SHELL_VERSIONS["latest-lts"]=8.4.1 +WEEKLY_SHELL_VERSIONS["8.0"]=8.0.38 +WEEKLY_SHELL_VERSIONS["latest-lts-84"]=8.4.1 WEEKLY_SHELL_VERSIONS["latest-innovation"]=9.0.0 From 7cbc9bb3a364fc9da4e4277cb712f1b36ccf4b72 Mon Sep 17 00:00:00 2001 From: Prashant Tekriwal Date: Thu, 21 Mar 2024 19:00:48 +0100 Subject: [PATCH 340/386] Fix the VERSION file and gen_dockerfiles.sh * Make 'key' values in VERSION file consistent * gen_dockerfiles.sh - Remove 7.x references, also no need of associative arrays with 'series' as the key, since all of them have same values instead use just plain variables Change-Id: I9c02ed30e16dab24fcce750488f50e65633d8a18 --- mysql-cluster/VERSION | 11 ++++-- mysql-cluster/gen_dockerfiles.sh | 58 +++++++------------------------- 2 files changed, 20 insertions(+), 49 deletions(-) diff --git a/mysql-cluster/VERSION b/mysql-cluster/VERSION index 8ca45eda9..8de69356a 100644 --- a/mysql-cluster/VERSION +++ b/mysql-cluster/VERSION @@ -3,14 +3,19 @@ LATEST="8.4" LATEST_LTS="8.4" LATEST_INNOVATION="9.0" +# The value of key should be series +# i.e. 8.0, 8.4, innovation, 9.7, etc. +# do not use any other value for key +# like 'latest-8.4' or 'lts-84', etch + declare -A MYSQL_CLUSTER_VERSIONS MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.37 -MYSQL_CLUSTER_VERSIONS["latest-lts-84"]=8.4.0 +MYSQL_CLUSTER_VERSIONS["8.4"]=8.4.0 declare -A MYSQL_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["8.0"]=8.0.37 -MYSQL_SHELL_VERSIONS["latest-lts-84"]=8.4.0 +MYSQL_SHELL_VERSIONS["8.4"]=8.4.0 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["8.0"]="${MYSQL_CLUSTER_VERSIONS["8.0"]}-${IMAGE_VERSION}" -FULL_SERVER_VERSIONS["latest-lts-84"]="${MYSQL_CLUSTER_VERSIONS["latest-lts-84"]}-${IMAGE_VERSION}" +FULL_SERVER_VERSIONS["8.4"]="${MYSQL_CLUSTER_VERSIONS["8.4"]}-${IMAGE_VERSION}" diff --git a/mysql-cluster/gen_dockerfiles.sh b/mysql-cluster/gen_dockerfiles.sh index 821645b04..a20b1af62 100755 --- a/mysql-cluster/gen_dockerfiles.sh +++ b/mysql-cluster/gen_dockerfiles.sh @@ -33,50 +33,20 @@ REPO_NAME_TOOLS=mysql-tools-community; [ -n "$7" ] && REPO_NAME_TOOLS=$7 MYSQL_SERVER_PACKAGE_NAME="mysql-cluster-community-server-minimal"; [ -n "$8" ] && MYSQL_SERVER_PACKAGE_NAME=$8 MYSQL_SHELL_PACKAGE_NAME="mysql-shell"; [ -n "$9" ] && MYSQL_SHELL_PACKAGE_NAME=$9 -declare -A PORTS -PORTS["7.5"]="3306 33060 2202 1186" -PORTS["7.6"]="3306 33060 2202 1186" -PORTS["8.0"]="3306 33060-33061 2202 1186" -PORTS["$LATEST_INNOVATION"]="3306 33060-33061 2202 1186" +PORTS="3306 33060-33061 2202 1186" -declare -A PASSWORDSET -PASSWORDSET["7.5"]="ALTER USER 'root'@'localhost' IDENTIFIED BY '\${MYSQL_ROOT_PASSWORD}';" -PASSWORDSET["7.6"]=${PASSWORDSET["7.5"]} -PASSWORDSET["8.0"]=${PASSWORDSET["7.6"]} -PASSWORDSET["$LATEST_INNOVATION"]=${PASSWORDSET["7.6"]} +PASSWORDSET="ALTER USER 'root'@'localhost' IDENTIFIED BY '\${MYSQL_ROOT_PASSWORD}';" -declare -A DATABASE_INIT -DATABASE_INIT["7.5"]="\"\$@\" --user=\$MYSQLD_USER --initialize-insecure" -DATABASE_INIT["7.6"]="\"\$@\" --user=\$MYSQLD_USER --initialize-insecure" -DATABASE_INIT["8.0"]="\"\$@\" --user=\$MYSQLD_USER --initialize-insecure" -DATABASE_INIT["$LATEST_INNOVATION"]="\"\$@\" --user=\$MYSQLD_USER --initialize-insecure" - -declare -A STARTUP -STARTUP["7.5"]="exec \"\$@\" --user=\$MYSQLD_USER" -STARTUP["7.6"]="exec \"\$@\" --user=\$MYSQLD_USER" -STARTUP["8.0"]="export MYSQLD_PARENT_PID=\$\$ ; exec \"\$@\" --user=$MYSQLD_USER" -STARTUP["$LATEST_INNOVATION"]="export MYSQLD_PARENT_PID=\$\$ ; exec \"\$@\" --user=$MYSQLD_USER" - - -declare -A STARTUP_WAIT -STARTUP_WAIT["7.5"]="\"\"" -STARTUP_WAIT["7.6"]="\"\"" +DATABASE_INIT="\"\$@\" --user=\$MYSQLD_USER --initialize-insecure" +STARTUP="export MYSQLD_PARENT_PID=\$\$ ; exec \"\$@\" --user=$MYSQLD_USER" # MySQL 8.0 supports a call to validate the config, while older versions have it as a side # effect of running --verbose --help -declare -A VALIDATE_CONFIG -VALIDATE_CONFIG["7.5"]="output=\$(\"\$@\" --verbose --help 2>\&1 > /dev/null) || result=\$?" -VALIDATE_CONFIG["7.6"]="output=\$(\"\$@\" --verbose --help 2>\&1 > /dev/null) || result=\$?" -VALIDATE_CONFIG["8.0"]="output=\$(\"\$@\" --validate-config) || result=\$?" -VALIDATE_CONFIG["$LATEST_INNOVATION"]="output=\$(\"\$@\" --validate-config) || result=\$?" +VALIDATE_CONFIG="output=\$(\"\$@\" --validate-config) || result=\$?" # Data directories that must be created with special ownership and permissions when the image is built -declare -A PRECREATE_DIRS -PRECREATE_DIRS["7.5"]="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" -PRECREATE_DIRS["7.6"]="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" -PRECREATE_DIRS["8.0"]="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" -PRECREATE_DIRS["$LATEST_INNOVATION"]="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" +PRECREATE_DIRS="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" process_version() { MAJOR_VERSION=$1 @@ -104,7 +74,7 @@ process_version() { sed -i 's#%%REPO_NAME_SERVER%%#'"${REPO_NAME_SERVER}"'#g' tmpfile sed -i 's#%%REPO_NAME_TOOLS%%#'"${REPO_NAME_TOOLS}"'#g' tmpfile sed -i 's#%%MYSQL_SHELL_PACKAGE%%#'"${MYSQL_SHELL_PACKAGE}"'#g' tmpfile - sed -i 's/%%PORTS%%/'"${PORTS[${MAJOR_VERSION}]}"'/g' tmpfile + sed -i 's/%%PORTS%%/'"${PORTS}"'/g' tmpfile mv tmpfile ${MAJOR_VERSION}/Dockerfile # Dockerfile_spec.rb @@ -119,18 +89,14 @@ process_version() { sed -i 's#%%MAJOR_VERSION%%#'"${MAJOR_VERSION}"'#g' tmpFile sed -i 's#%%MYSQL_SHELL_VERSION%%#'"${SHELL_VERSION}"'#g' tmpFile - if [[ "${MAJOR_VERSION}" =~ 7\.(5|6) ]]; then - sed -i 's#%%PORTS%%#'"1186/tcp, 2202/tcp, 3306/tcp, 33060/tcp"'#g' tmpFile - else - sed -i 's#%%PORTS%%#'"1186/tcp, 2202/tcp, 3306/tcp, 33060-33061/tcp"'#g' tmpFile - fi + sed -i 's#%%PORTS%%#'"1186/tcp, 2202/tcp, 3306/tcp, 33060-33061/tcp"'#g' tmpFile mv tmpFile "${MAJOR_VERSION}/inspec/control.rb" # Entrypoint - sed 's#%%PASSWORDSET%%#'"${PASSWORDSET[${MAJOR_VERSION}]}"'#g' template/docker-entrypoint.sh > tmpfile - sed -i 's#%%STARTUP%%#'"${STARTUP[${MAJOR_VERSION}]}"'#g' tmpfile + sed 's#%%PASSWORDSET%%#'"${PASSWORDSET}"'#g' template/docker-entrypoint.sh > tmpfile + sed -i 's#%%STARTUP%%#'"${STARTUP}"'#g' tmpfile sed -i 's#%%FULL_SERVER_VERSION%%#'"${FULL_SERVER_VERSIONS[${MAJOR_VERSION}]}"'#g' tmpfile - sed -i 's#%%VALIDATE_CONFIG%%#'"${VALIDATE_CONFIG[${MAJOR_VERSION}]}"'#g' tmpfile + sed -i 's#%%VALIDATE_CONFIG%%#'"${VALIDATE_CONFIG}"'#g' tmpfile mv tmpfile ${MAJOR_VERSION}/docker-entrypoint.sh chmod +x ${MAJOR_VERSION}/docker-entrypoint.sh @@ -139,7 +105,7 @@ process_version() { chmod +x ${MAJOR_VERSION}/healthcheck.sh # Build-time preparation script - sed 's#%%PRECREATE_DIRS%%#'"${PRECREATE_DIRS[${MAJOR_VERSION}]}"'#g' template/prepare-image.sh > tmpfile + sed 's#%%PRECREATE_DIRS%%#'"${PRECREATE_DIRS}"'#g' template/prepare-image.sh > tmpfile mv tmpfile ${MAJOR_VERSION}/prepare-image.sh chmod +x ${MAJOR_VERSION}/prepare-image.sh From edd6422d13dab972ca5fdc53fc72664e806a096e Mon Sep 17 00:00:00 2001 From: Prashant Tekriwal Date: Fri, 22 Mar 2024 06:38:00 +0100 Subject: [PATCH 341/386] Fix the VERSION file for server and router * Make 'key' values in VERSION file consistent for both router and server codes Change-Id: I9e36f24a97d45559261617903d26e6c3b819051c --- mysql-router/VERSION | 12 ++++++------ mysql-server/VERSION | 17 +++++++++++------ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/mysql-router/VERSION b/mysql-router/VERSION index e8bb2088d..64d218b8b 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -5,16 +5,16 @@ LATEST_INNOVATION="9.0" declare -A MYSQL_ROUTER_VERSIONS WEEKLY_ROUTER_VERSIONS MYSQL_ROUTER_VERSIONS["8.0"]=8.0.37 -MYSQL_ROUTER_VERSIONS["latest-lts-84"]=8.4.0 +MYSQL_ROUTER_VERSIONS["8.4"]=8.4.0 WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.38 -WEEKLY_ROUTER_VERSIONS["latest-lts-84"]=8.4.1 -WEEKLY_ROUTER_VERSIONS["latest-innovation"]=9.0.0 +WEEKLY_ROUTER_VERSIONS["8.4"]=8.4.1 +WEEKLY_ROUTER_VERSIONS["innovation"]=9.0.0 declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["8.0"]=8.0.37 -MYSQL_SERVER_VERSIONS["latest-lts-84"]=8.4.0 +MYSQL_SERVER_VERSIONS["8.4"]=8.4.0 WEEKLY_SERVER_VERSIONS["8.0"]=8.0.38 -WEEKLY_SERVER_VERSIONS["latest-lts-84"]=8.4.1 -WEEKLY_SERVER_VERSIONS["latest-innovation"]=9.0.0 +WEEKLY_SERVER_VERSIONS["8.4"]=8.4.1 +WEEKLY_SERVER_VERSIONS["innovation"]=9.0.0 diff --git a/mysql-server/VERSION b/mysql-server/VERSION index ddd286d1d..448a93993 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -3,18 +3,23 @@ LATEST="8.4" LATEST_LTS="8.4" LATEST_INNOVATION="9.0" +# The value of key should be series +# i.e. 8.0, 8.4, innovation, 9.7, etc. +# do not use any other value for key +# like 'latest-8.4' or 'lts-84', etch + declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["8.0"]=8.0.37 -MYSQL_SERVER_VERSIONS["latest-lts-84"]=8.4.0 +MYSQL_SERVER_VERSIONS["8.4"]=8.4.0 WEEKLY_SERVER_VERSIONS["8.0"]=8.0.38 -WEEKLY_SERVER_VERSIONS["latest-lts-84"]=8.4.1 -WEEKLY_SERVER_VERSIONS["latest-innovation"]=9.0.0 +WEEKLY_SERVER_VERSIONS["8.4"]=8.4.1 +WEEKLY_SERVER_VERSIONS["innovation"]=9.0.0 declare -A MYSQL_SHELL_VERSIONS WEEKLY_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["8.0"]=8.0.37 -MYSQL_SHELL_VERSIONS["latest-lts-84"]=8.4.0 +MYSQL_SHELL_VERSIONS["8.4"]=8.4.0 WEEKLY_SHELL_VERSIONS["8.0"]=8.0.38 -WEEKLY_SHELL_VERSIONS["latest-lts-84"]=8.4.1 -WEEKLY_SHELL_VERSIONS["latest-innovation"]=9.0.0 +WEEKLY_SHELL_VERSIONS["8.4"]=8.4.1 +WEEKLY_SHELL_VERSIONS["innovation"]=9.0.0 From a87dea0e9f09db12d3399fb5c3481204626807e2 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Tue, 30 Apr 2024 18:02:44 +0000 Subject: [PATCH 342/386] Release version 1.2.16-server * Fix the VERSION file for server and router * ET#80681 - Update Server, Cluster & Router docker files to support 8.4 LTS release * ET#80557 - Add support for 8.4 LTS release * ET#80446 - Switch base image and add support for EL9 platform --- mysql-server/8.0/Dockerfile | 14 +- mysql-server/8.0/docker-entrypoint.sh | 4 +- mysql-server/8.0/inspec/control.rb | 4 +- mysql-server/8.4/Dockerfile | 45 +++++ mysql-server/8.4/docker-entrypoint.sh | 230 ++++++++++++++++++++++++++ mysql-server/8.4/healthcheck.sh | 24 +++ mysql-server/8.4/inspec/control.rb | 20 +++ mysql-server/8.4/prepare-image.sh | 25 +++ 8 files changed, 355 insertions(+), 11 deletions(-) create mode 100644 mysql-server/8.4/Dockerfile create mode 100755 mysql-server/8.4/docker-entrypoint.sh create mode 100755 mysql-server/8.4/healthcheck.sh create mode 100644 mysql-server/8.4/inspec/control.rb create mode 100755 mysql-server/8.4/prepare-image.sh diff --git a/mysql-server/8.0/Dockerfile b/mysql-server/8.0/Dockerfile index f2abedaf3..c82b314ec 100644 --- a/mysql-server/8.0/Dockerfile +++ b/mysql-server/8.0/Dockerfile @@ -13,21 +13,21 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -FROM container-registry.oracle.com/os/oraclelinux:8-slim +FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.36 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.36 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.37 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.37 # Setup repositories for minimal packages (all versions) -RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el8.rpm \ - && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql80-community-release-el8.rpm +RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ + && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm # Install server and shell 8.0 RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ && microdnf install -y --enablerepo=mysql-tools-community $MYSQL_SHELL_PACKAGE \ - && microdnf install -y --disablerepo=ol8_appstream \ + && microdnf install -y --disablerepo=ol9_appstream \ --enablerepo=mysql80-community-minimal $MYSQL_SERVER_PACKAGE \ - && microdnf remove mysql-community-minimal-release mysql80-community-release \ + && microdnf remove -y mysql-community-minimal-release mysql80-community-release \ && microdnf clean all \ && mkdir /docker-entrypoint-initdb.d diff --git a/mysql-server/8.0/docker-entrypoint.sh b/mysql-server/8.0/docker-entrypoint.sh index db8968ac3..f8a1c6e5f 100755 --- a/mysql-server/8.0/docker-entrypoint.sh +++ b/mysql-server/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.36-1.2.15-server" +echo "[Entrypoint] MySQL Docker Image 8.0.37-1.2.16-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.36-1.2.15-server" + echo "[Entrypoint] Starting MySQL 8.0.37-1.2.16-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/8.0/inspec/control.rb b/mysql-server/8.0/inspec/control.rb index bcc40fabe..2476df29d 100644 --- a/mysql-server/8.0/inspec/control.rb +++ b/mysql-server/8.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.36.*' } + its ('version') { should match '8.0.37.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.36.*' } + its ('version') { should match '8.0.37.*' } end end diff --git a/mysql-server/8.4/Dockerfile b/mysql-server/8.4/Dockerfile new file mode 100644 index 000000000..f17075a8d --- /dev/null +++ b/mysql-server/8.4/Dockerfile @@ -0,0 +1,45 @@ +# Copyright (c) 2017, 2023, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +FROM container-registry.oracle.com/os/oraclelinux:9-slim + +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.4.0 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.4.0 + +# Setup repositories for minimal packages (all versions) +RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ + && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm + +# Install server and shell 8.0 +RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ + && microdnf install -y --enablerepo=mysql-tools-8.4-lts-community $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --disablerepo=ol9_appstream \ + --enablerepo=mysql-8.4-lts-community-minimal $MYSQL_SERVER_PACKAGE \ + && microdnf remove -y mysql-community-minimal-release mysql80-community-release \ + && microdnf clean all \ + && mkdir /docker-entrypoint-initdb.d + +COPY prepare-image.sh / +RUN /prepare-image.sh && rm -f /prepare-image.sh + +ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock + +COPY docker-entrypoint.sh /entrypoint.sh +COPY healthcheck.sh /healthcheck.sh +ENTRYPOINT ["/entrypoint.sh"] +HEALTHCHECK CMD /healthcheck.sh +EXPOSE 3306 33060 33061 +CMD ["mysqld"] + diff --git a/mysql-server/8.4/docker-entrypoint.sh b/mysql-server/8.4/docker-entrypoint.sh new file mode 100755 index 000000000..6e8d65678 --- /dev/null +++ b/mysql-server/8.4/docker-entrypoint.sh @@ -0,0 +1,230 @@ +#!/bin/bash +# Copyright (c) 2017, 2021, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +echo "[Entrypoint] MySQL Docker Image 8.4.0-1.2.16-server" +# Fetch value from server config +# We use mysqld --verbose --help instead of my_print_defaults because the +# latter only show values present in config files, and not server defaults +_get_config() { + local conf="$1"; shift + "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' +} + +# Generate a random password +_mkpw() { + letter=$(cat /dev/urandom| tr -dc a-zA-Z | dd bs=1 count=16 2> /dev/null ) + number=$(cat /dev/urandom| tr -dc 0-9 | dd bs=1 count=8 2> /dev/null) + special=$(cat /dev/urandom| tr -dc '=+@#%^&*_.,;:?/' | dd bs=1 count=8 2> /dev/null) + + echo $letter$number$special | fold -w 1 | shuf | tr -d '\n' +} + +# If command starts with an option, prepend mysqld +# This allows users to add command-line options without +# needing to specify the "mysqld" command +if [ "${1:0:1}" = '-' ]; then + set -- mysqld "$@" +fi + +# Check if entrypoint (and the container) is running as root +if [ $(id -u) = "0" ]; then + is_root=1 + install_devnull="install /dev/null -m0600 -omysql -gmysql" + MYSQLD_USER=mysql +else + install_devnull="install /dev/null -m0600" + MYSQLD_USER=$(id -u) +fi + +if [ "$1" = 'mysqld' ]; then + # Test that the server can start. We redirect stdout to /dev/null so + # only the error messages are left. + result=0 + output=$("$@" --validate-config) || result=$? + if [ ! "$result" = "0" ]; then + echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' + echo >&2 "[Entrypoint] $output" + exit 1 + fi + + # Get config + DATADIR="$(_get_config 'datadir' "$@")" + SOCKET="$(_get_config 'socket' "$@")" + + if [ ! -d "$DATADIR/mysql" ]; then + # If the password variable is a filename we use the contents of the file. We + # read this first to make sure that a proper error is generated for empty files. + if [ -f "$MYSQL_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + if [ -z "$MYSQL_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' + exit 1 + fi + fi + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] No password option specified for new database.' + echo >&2 '[Entrypoint] A random onetime password will be generated.' + MYSQL_RANDOM_ROOT_PASSWORD=true + MYSQL_ONETIME_PASSWORD=true + fi + if [ ! -d "$DATADIR" ]; then + mkdir -p "$DATADIR" + chown mysql:mysql "$DATADIR" + fi + + # The user can set a default_timezone either in a my.cnf file + # they mount into the container or on command line + # (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`) + # however the timezone tables will only be populated in a later + # stage of this script. By using +00:00 as timezone we override + # the user's choice during initialization. Later the server + # will be restarted using the user's option. + + echo '[Entrypoint] Initializing database' + "$@" --user=$MYSQLD_USER --initialize-insecure --default-time-zone=+00:00 + + echo '[Entrypoint] Database initialized' + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" --default-time-zone=+00:00 + + # To avoid using password on commandline, put it in a temporary file. + # The file is only populated when and if the root password is set. + PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + $install_devnull "$PASSFILE" + # Define the client command used throughout the script + # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") + + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break + fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 + fi + + mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql + + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(_mkpw)" + echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + fi + if [ -z "$MYSQL_ROOT_HOST" ]; then + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';" + else + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ + GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + fi + "${mysql[@]}" <<-EOSQL + DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; + ${ROOTCREATE} + FLUSH PRIVILEGES ; + EOSQL + if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then + # Put the password into the temporary config file + cat >"$PASSFILE" < "$SQL" +ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL + fi + + echo + echo '[Entrypoint] MySQL init process done. Ready for start up.' + echo + fi + + # Used by healthcheck to make sure it doesn't mistakenly report container + # healthy during startup + # Put the password into the temporary config file + touch /var/lib/mysql-files/healthcheck.cnf + cat >"/var/lib/mysql-files/healthcheck.cnf" < Date: Tue, 30 Apr 2024 21:48:52 +0000 Subject: [PATCH 343/386] Release version 1.2.16-server --- mysql-server/8.0/Dockerfile | 2 +- mysql-server/8.4/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-server/8.0/Dockerfile b/mysql-server/8.0/Dockerfile index c82b314ec..676deb4de 100644 --- a/mysql-server/8.0/Dockerfile +++ b/mysql-server/8.0/Dockerfile @@ -27,7 +27,7 @@ RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ && microdnf install -y --enablerepo=mysql-tools-community $MYSQL_SHELL_PACKAGE \ && microdnf install -y --disablerepo=ol9_appstream \ --enablerepo=mysql80-community-minimal $MYSQL_SERVER_PACKAGE \ - && microdnf remove -y mysql-community-minimal-release mysql80-community-release \ + && microdnf remove -y mysql-community-minimal-release mysql84-community-release \ && microdnf clean all \ && mkdir /docker-entrypoint-initdb.d diff --git a/mysql-server/8.4/Dockerfile b/mysql-server/8.4/Dockerfile index f17075a8d..2c1655174 100644 --- a/mysql-server/8.4/Dockerfile +++ b/mysql-server/8.4/Dockerfile @@ -27,7 +27,7 @@ RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ && microdnf install -y --enablerepo=mysql-tools-8.4-lts-community $MYSQL_SHELL_PACKAGE \ && microdnf install -y --disablerepo=ol9_appstream \ --enablerepo=mysql-8.4-lts-community-minimal $MYSQL_SERVER_PACKAGE \ - && microdnf remove -y mysql-community-minimal-release mysql80-community-release \ + && microdnf remove -y mysql-community-minimal-release mysql84-community-release \ && microdnf clean all \ && mkdir /docker-entrypoint-initdb.d From 0b8ee6bac8d9318b6e0937544eebbb8651961faf Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 1 May 2024 04:27:01 +0000 Subject: [PATCH 344/386] Release version 1.0.16-router * Fix the VERSION file for server and router * ET#80681 - Update Server, Cluster & Router docker files to support 8.4 LTS release * ET#80446 - Switch base image and add support for EL9 platform --- mysql-router/8.0/Dockerfile | 10 +-- mysql-router/8.0/inspec/control.rb | 4 +- mysql-router/8.4/Dockerfile | 39 +++++++++++ mysql-router/8.4/README.md | 88 +++++++++++++++++++++++++ mysql-router/8.4/inspec/control.rb | 20 ++++++ mysql-router/8.4/run.sh | 101 +++++++++++++++++++++++++++++ 6 files changed, 255 insertions(+), 7 deletions(-) create mode 100644 mysql-router/8.4/Dockerfile create mode 100644 mysql-router/8.4/README.md create mode 100644 mysql-router/8.4/inspec/control.rb create mode 100755 mysql-router/8.4/run.sh diff --git a/mysql-router/8.0/Dockerfile b/mysql-router/8.0/Dockerfile index c9289daf5..8ad3af4d8 100644 --- a/mysql-router/8.0/Dockerfile +++ b/mysql-router/8.0/Dockerfile @@ -12,11 +12,11 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -FROM container-registry.oracle.com/os/oraclelinux:8-slim +FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.36 -ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.36 -ARG CONFIG_PACKAGE_NAME=mysql80-community-release-el8.rpm +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.37 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.37 +ARG CONFIG_PACKAGE_NAME=mysql84-community-release-el9.rpm ARG REPO_NAME_SERVER=mysql80-community ARG REPO_NAME_TOOLS=mysql-tools-community @@ -24,7 +24,7 @@ RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ -c "MySQL Router" mysqlrouter \ && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/$CONFIG_PACKAGE_NAME \ - && microdnf install -y --disablerepo=\* \ + && microdnf install -y \ --enablerepo=mysql80-community $MYSQL_CLIENT_PACKAGE \ && microdnf install -y --disablerepo=\* \ --enablerepo=mysql-tools-community $MYSQL_ROUTER_PACKAGE \ diff --git a/mysql-router/8.0/inspec/control.rb b/mysql-router/8.0/inspec/control.rb index 6d95df20c..6bdc2f102 100644 --- a/mysql-router/8.0/inspec/control.rb +++ b/mysql-router/8.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-client') do it { should be_installed } - its ('version') { should match '8.0.36.*' } + its ('version') { should match '8.0.37.*' } end describe package('mysql-router-community') do it { should be_installed } - its ('version') { should match '8.0.36.*' } + its ('version') { should match '8.0.37.*' } end end diff --git a/mysql-router/8.4/Dockerfile b/mysql-router/8.4/Dockerfile new file mode 100644 index 000000000..70d720d7c --- /dev/null +++ b/mysql-router/8.4/Dockerfile @@ -0,0 +1,39 @@ +# Copyright (c) 2018, 2023, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +FROM container-registry.oracle.com/os/oraclelinux:9-slim + +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.4.0 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.4.0 +ARG CONFIG_PACKAGE_NAME=mysql84-community-release-el9.rpm +ARG REPO_NAME_SERVER=mysql-8.4-lts-community +ARG REPO_NAME_TOOLS=mysql-tools-8.4-lts-community + +RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ + && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ + -c "MySQL Router" mysqlrouter \ + && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/$CONFIG_PACKAGE_NAME \ + && microdnf install -y \ + --enablerepo=mysql-8.4-lts-community $MYSQL_CLIENT_PACKAGE \ + && microdnf install -y --disablerepo=\* \ + --enablerepo=mysql-tools-8.4-lts-community $MYSQL_ROUTER_PACKAGE \ + && microdnf clean all + +COPY run.sh /run.sh +HEALTHCHECK \ + CMD mysqladmin --port 6446 --protocol TCP ping 2>&1 | grep Access || exit 1 +EXPOSE 6446 6447 6448 6449 6450 8443 +USER 999:999 +ENTRYPOINT ["/run.sh"] +CMD ["mysqlrouter"] diff --git a/mysql-router/8.4/README.md b/mysql-router/8.4/README.md new file mode 100644 index 000000000..0f2711ba5 --- /dev/null +++ b/mysql-router/8.4/README.md @@ -0,0 +1,88 @@ +![logo](https://www.mysql.com/common/logos/logo-mysql-170x115.png) + +# What is MySQL Router? + +MySQL Router is part of InnoDB cluster, and is lightweight middleware that +provides transparent routing between your application and back-end MySQL +Servers. It can be used for a wide variety of use cases, such as providing high +availability and scalability by effectively routing database traffic to +appropriate back-end MySQL Servers. The pluggable architecture also enables +developers to extend MySQL Router for custom use cases. + +# Supported Tags and Respective Dockerfile Links + +* MySQL Router 8.0 (tag: [`latest`, `8.0`](https://github.com/mysql/mysql-docker/blob/mysql-router/8.0/Dockerfile)) ([mysql-router/8.0/Dockerfile](https://github.com/mysql/mysql-docker/blob/mysql-router/8.0/Dockerfile)) + +Images are updated when new MySQL Server maintenance releases and development milestones are published. Please note that non-GA releases are for preview purposes only and should not be used in production setups. + +# How to Use the MySQL Router Images + +The image currently uses the following mandatory variables: + +| Variable | Description | +| ------------------------ | ------------------------------------------- | +| MYSQL_HOST | MySQL host to connect to | +| MYSQL_PORT | Port to use | +| MYSQL_USER | User to connect with | +| MYSQL_PASSWORD | Password to connect with | + +Running in a container requires a working InnoDB cluster. + +The image uses the following optional variables: + +| Variable | Description | +| ------------------------------------ | ------------------------------------------- | +| MYSQL_INNODB_CLUSTER_MEMBERS | Wait for at least this number of cluster instances to be ONLINE | +| MYSQL_CREATE_ROUTER_USER | Whether to create a new account for the Router to use when it's running. Defaults to 1, set to 0 to disable. | +| MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS | Additional command line options applied while bootstrapping + +If supplied the run script waits for the given mysql host to be up, the InnoDB cluster to have +MYSQL_INNODB_CLUSTER_MEMBERS members and then uses the given server for its +bootstrap mode +[Bootstrapping](https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-deploying-bootstrapping.html). + +The image can be run via: + +``` +docker run -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -e MYSQL_INNODB_CLUSTER_MEMBERS=3 -ti mysql/mysql-router +``` + +Additional command line options for running MySQL Router after bootstrap can be passed a command options. For instance you can use a config file from your home directory like this: + +``` +docker run -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -ti -v $HOME/router-extra.conf:/tmp/router-extra.conf mysql/mysql-router mysqlrouter --extra-config=/tmp/router-extra.conf +``` + +It can be verified by typing: + +``` +docker ps +``` + +The following output should be displayed: + +``` +4954b1c80be1 mysql-router:8.0 "/run.sh mysqlrouter" About a minute ago Up About a minute (healthy) 6447/tcp, 6448/tcp, 0.0.0.0:6446->6446/tcp, 6449/tcp innodbcluster_mysql-router_1 +``` + +By default the container will run as user 999:999 which maps to mysqlrouter:mysqlrouter inside the container. + +# Exposed Ports + +The following TCP ports are exposed by the MySQL Router container: + +| Port | Description +| ----- | --------------------------------------------------------------------------------------- | +| 6446 | R/W connection port. Clients that connect to this port will be forwarded to the PRIMARY | +| 6447 | R/O connection port. Clients that connect to this port will be forwarded to a SECONDARY | +| 6448 | X Protocol R/W connection port. R/W port for X protocol client connections | +| 6449 | X Protocol R/O connection port. R/O port for X protocol client connections | +| 8443 | HTTPS REST interface port. | + +For more information about the REST interface API, see: + +https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-rest-api-reference.html + +For full usage documentation, see: + +https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-installation-docker.html diff --git a/mysql-router/8.4/inspec/control.rb b/mysql-router/8.4/inspec/control.rb new file mode 100644 index 000000000..5c772d168 --- /dev/null +++ b/mysql-router/8.4/inspec/control.rb @@ -0,0 +1,20 @@ +control 'container' do + impact 0.5 + describe podman.containers do + its('status') { should cmp /Up/ } + its('commands') { should cmp /sleep/ } + its('images') { should cmp /mysql-router:8.4/ } + its('names') { should include "mysql-router-8.4" } + end +end +control 'packages' do + impact 0.5 + describe package('mysql-community-client') do + it { should be_installed } + its ('version') { should match '8.4.0.*' } + end + describe package('mysql-router-community') do + it { should be_installed } + its ('version') { should match '8.4.0.*' } + end +end diff --git a/mysql-router/8.4/run.sh b/mysql-router/8.4/run.sh new file mode 100755 index 000000000..f806c1afe --- /dev/null +++ b/mysql-router/8.4/run.sh @@ -0,0 +1,101 @@ +#!/bin/bash +# Copyright (c) 2018, 2021, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +if [ "$1" = 'mysqlrouter' ]; then + if [[ -z $MYSQL_HOST || -z $MYSQL_PORT || -z $MYSQL_USER || -z $MYSQL_PASSWORD ]]; then + echo "We require all of" + echo " MYSQL_HOST" + echo " MYSQL_PORT" + echo " MYSQL_USER" + echo " MYSQL_PASSWORD" + echo "to be set." + echo "In addition you can set" + echo " MYSQL_INNODB_CLUSTER_MEMBERS " + echo " MYSQL_CREATE_ROUTER_USER" + echo " MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS" + echo "Exiting." + exit 1 + fi + + PASSFILE=$(mktemp) + echo "$MYSQL_PASSWORD" > "$PASSFILE" + if [ -z $MYSQL_CREATE_ROUTER_USER ]; then + echo "$MYSQL_PASSWORD" >> "$PASSFILE" + MYSQL_CREATE_ROUTER_USER=1 + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is not set, Router will generate a new account to be used at runtime." + echo "[Entrypoint] Set it to 0 to reuse $MYSQL_USER instead." + elif [ "$MYSQL_CREATE_ROUTER_USER" = "0" ]; then + echo "$MYSQL_PASSWORD" >> "$PASSFILE" + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is 0, Router will reuse $MYSQL_USER account at runtime" + else + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is not 0, Router will generate a new account to be used at runtime" + fi + + DEFAULTS_EXTRA_FILE=$(mktemp) + cat >"$DEFAULTS_EXTRA_FILE" < "/dev/tcp/$MYSQL_HOST/$MYSQL_PORT") >/dev/null 2>&1; do + echo "[Entrypoint] Waiting for mysql server $MYSQL_HOST ($attempt_num/$max_tries)" + sleep $(( attempt_num++ )) + if (( attempt_num == max_tries )); then + exit 1 + fi + done + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST:$MYSQL_PORT. Checking for cluster state." + if ! [[ "$(mysql --defaults-extra-file="$DEFAULTS_EXTRA_FILE" -u "$MYSQL_USER" -h "$MYSQL_HOST" -P "$MYSQL_PORT" -e "show status;" 2> /dev/null)" ]]; then + echo "[Entrypoint] ERROR: Can not connect to database. Exiting." + exit 1 + fi + if [[ -n $MYSQL_INNODB_CLUSTER_MEMBERS ]]; then + attempt_num=0 + echo $attempt_num + echo $max_tries + until [ "$(mysql --defaults-extra-file="$DEFAULTS_EXTRA_FILE" -u "$MYSQL_USER" -h "$MYSQL_HOST" -P "$MYSQL_PORT" -N performance_schema -e "select count(MEMBER_STATE) >= $MYSQL_INNODB_CLUSTER_MEMBERS from replication_group_members where MEMBER_STATE = 'ONLINE';" 2> /dev/null)" -eq 1 ]; do + echo "[Entrypoint] Waiting for $MYSQL_INNODB_CLUSTER_MEMBERS cluster instances to become available via $MYSQL_HOST ($attempt_num/$max_tries)" + sleep $(( attempt_num++ )) + if (( attempt_num == max_tries )); then + exit 1 + fi + done + echo "[Entrypoint] Successfully contacted cluster with $MYSQL_INNODB_CLUSTER_MEMBERS members. Bootstrapping." + fi + if [ $(id -u) = "0" ]; then + opt_user=--user=mysqlrouter + fi + if [ "$MYSQL_CREATE_ROUTER_USER" = "0" ]; then + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap reusing account \"$MYSQL_USER\"." + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force --account-create=never --account=$MYSQL_USER $opt_user $MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS < "$PASSFILE" || exit 1 + else + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap." + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force $opt_user $MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS < "$PASSFILE" || exit 1 + fi + + sed -i -e 's/logging_folder=.*$/logging_folder=/' /tmp/mysqlrouter/mysqlrouter.conf + echo "[Entrypoint] Starting mysql-router." + exec "$@" --config /tmp/mysqlrouter/mysqlrouter.conf + + rm -f "$PASSFILE" + rm -f "$DEFAULTS_EXTRA_FILE" + unset DEFAULTS_EXTRA_FILE +else + exec "$@" +fi From 6434232b64a32073f945d8c2f393bf7044a29258 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 1 May 2024 05:29:26 +0000 Subject: [PATCH 345/386] Release version 1.2.16-cluster * Fix the VERSION file and gen_dockerfiles.sh * ET#80681 - Update Server, Cluster & Router docker files to support 8.4 LTS release * ET#80446 - Switch base image and add support for EL9 platform --- mysql-cluster/8.0/Dockerfile | 14 +- mysql-cluster/8.0/docker-entrypoint.sh | 4 +- mysql-cluster/8.0/inspec/control.rb | 4 +- mysql-cluster/8.4/Dockerfile | 47 +++++ mysql-cluster/8.4/cnf/my.cnf | 22 ++ mysql-cluster/8.4/cnf/mysql-cluster.cnf | 39 ++++ mysql-cluster/8.4/docker-entrypoint.sh | 264 ++++++++++++++++++++++++ mysql-cluster/8.4/healthcheck.sh | 24 +++ mysql-cluster/8.4/inspec/control.rb | 20 ++ mysql-cluster/8.4/prepare-image.sh | 25 +++ 10 files changed, 452 insertions(+), 11 deletions(-) create mode 100644 mysql-cluster/8.4/Dockerfile create mode 100644 mysql-cluster/8.4/cnf/my.cnf create mode 100644 mysql-cluster/8.4/cnf/mysql-cluster.cnf create mode 100755 mysql-cluster/8.4/docker-entrypoint.sh create mode 100755 mysql-cluster/8.4/healthcheck.sh create mode 100644 mysql-cluster/8.4/inspec/control.rb create mode 100755 mysql-cluster/8.4/prepare-image.sh diff --git a/mysql-cluster/8.0/Dockerfile b/mysql-cluster/8.0/Dockerfile index cbec5fc3c..297bea38d 100644 --- a/mysql-cluster/8.0/Dockerfile +++ b/mysql-cluster/8.0/Dockerfile @@ -13,19 +13,19 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -FROM container-registry.oracle.com/os/oraclelinux:8-slim +FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.0.36 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.36 +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.0.37 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.37 # Setup repositories for minimal packages (all versions) -RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-cluster-community-minimal-release-el8.rpm \ - && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql80-community-release-el8.rpm +RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-cluster-community-minimal-release-el9.rpm \ + && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql80-community-release-el9.rpm # Install server and shell 8.0 RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ - && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ - && microdnf install -y --disablerepo=ol8_appstream \ + && microdnf install -y --enablerepo=mysql-tools-community $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --disablerepo=ol9_appstream \ --enablerepo=mysql-cluster80-community-minimal $MYSQL_SERVER_PACKAGE \ && microdnf clean all \ && mkdir /docker-entrypoint-initdb.d diff --git a/mysql-cluster/8.0/docker-entrypoint.sh b/mysql-cluster/8.0/docker-entrypoint.sh index 2546f2202..dd0d16372 100755 --- a/mysql-cluster/8.0/docker-entrypoint.sh +++ b/mysql-cluster/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.36-1.2.15-cluster" +echo "[Entrypoint] MySQL Docker Image 8.0.37-1.2.16-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -227,7 +227,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.36-1.2.15-cluster" + echo "[Entrypoint] Starting MySQL 8.0.37-1.2.16-cluster" fi export MYSQLD_PARENT_PID=$$ ; exec "$@" --user= else diff --git a/mysql-cluster/8.0/inspec/control.rb b/mysql-cluster/8.0/inspec/control.rb index 41432094d..fbbab474b 100644 --- a/mysql-cluster/8.0/inspec/control.rb +++ b/mysql-cluster/8.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.36.*' } + its ('version') { should match '8.0.37.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.36.*' } + its ('version') { should match '8.0.37.*' } end end diff --git a/mysql-cluster/8.4/Dockerfile b/mysql-cluster/8.4/Dockerfile new file mode 100644 index 000000000..cbd0300ed --- /dev/null +++ b/mysql-cluster/8.4/Dockerfile @@ -0,0 +1,47 @@ +# Copyright (c) 2017, 2023, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +FROM container-registry.oracle.com/os/oraclelinux:9-slim + +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.4.0 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.4.0 + +# Setup repositories for minimal packages (all versions) +RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-cluster-community-minimal-release-el9.rpm \ + && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm + +# Install server and shell 8.0 +RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ + && microdnf install -y --enablerepo=mysql-tools-8.4-lts-community $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --disablerepo=ol9_appstream \ + --enablerepo=mysql-cluster-8.4-lts-community-minimal $MYSQL_SERVER_PACKAGE \ + && microdnf clean all \ + && mkdir /docker-entrypoint-initdb.d + +COPY prepare-image.sh / +RUN /prepare-image.sh && rm -f /prepare-image.sh + +ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock + +COPY docker-entrypoint.sh /entrypoint.sh +COPY healthcheck.sh /healthcheck.sh +COPY cnf/my.cnf /etc/ +COPY cnf/mysql-cluster.cnf /etc/ + +ENTRYPOINT ["/entrypoint.sh"] +HEALTHCHECK CMD /healthcheck.sh +EXPOSE 3306 33060-33061 2202 1186 +CMD ["mysqld"] + diff --git a/mysql-cluster/8.4/cnf/my.cnf b/mysql-cluster/8.4/cnf/my.cnf new file mode 100644 index 000000000..ec98b2dc1 --- /dev/null +++ b/mysql-cluster/8.4/cnf/my.cnf @@ -0,0 +1,22 @@ +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +[mysqld] +ndbcluster +ndb-connectstring=192.168.0.2 +user=mysql + +[mysql_cluster] +ndb-connectstring=192.168.0.2 diff --git a/mysql-cluster/8.4/cnf/mysql-cluster.cnf b/mysql-cluster/8.4/cnf/mysql-cluster.cnf new file mode 100644 index 000000000..16f79f1c0 --- /dev/null +++ b/mysql-cluster/8.4/cnf/mysql-cluster.cnf @@ -0,0 +1,39 @@ +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +[ndbd default] +NoOfReplicas=2 +DataMemory=80M +IndexMemory=18M + + +[ndb_mgmd] +NodeId=1 +hostname=192.168.0.2 +datadir=/var/lib/mysql + +[ndbd] +NodeId=2 +hostname=192.168.0.3 +datadir=/var/lib/mysql + +[ndbd] +NodeId=3 +hostname=192.168.0.4 +datadir=/var/lib/mysql + +[mysqld] +NodeId=4 +hostname=192.168.0.10 diff --git a/mysql-cluster/8.4/docker-entrypoint.sh b/mysql-cluster/8.4/docker-entrypoint.sh new file mode 100755 index 000000000..58310cdc5 --- /dev/null +++ b/mysql-cluster/8.4/docker-entrypoint.sh @@ -0,0 +1,264 @@ +#!/bin/bash +# Copyright (c) 2017, 2021, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +echo "[Entrypoint] MySQL Docker Image 8.4.0-1.2.16-cluster" +# Fetch value from server config +# We use mysqld --verbose --help instead of my_print_defaults because the +# latter only show values present in config files, and not server defaults +_get_config() { + local conf="$1"; shift + "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' +} + +# Generate a random password +_mkpw() { + letter=$(cat /dev/urandom| tr -dc a-zA-Z | dd bs=1 count=16 2> /dev/null ) + number=$(cat /dev/urandom| tr -dc 0-9 | dd bs=1 count=8 2> /dev/null) + special=$(cat /dev/urandom| tr -dc '=+@#%^&*_.,;:?/' | dd bs=1 count=8 2> /dev/null) + + echo $letter$number$special | fold -w 1 | shuf | tr -d '\n' +} + +# If command starts with an option, prepend mysqld +# This allows users to add command-line options without +# needing to specify the "mysqld" command +if [ "${1:0:1}" = '-' ]; then + set -- mysqld "$@" +fi + +# Check if entrypoint (and the container) is running as root +if [ $(id -u) = "0" ]; then + is_root=1 + install_devnull="install /dev/null -m0600 -omysql -gmysql" + MYSQLD_USER=mysql +else + install_devnull="install /dev/null -m0600" + MYSQLD_USER=$(id -u) +fi + +if [ "$1" = 'mysqld' ]; then + # Test that the server can start. We redirect stdout to /dev/null so + # only the error messages are left. + result=0 + output=$("$@" --validate-config) || result=$? + if [ ! "$result" = "0" ]; then + echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' + echo >&2 "[Entrypoint] $output" + exit 1 + fi + + # Get config + DATADIR="$(_get_config 'datadir' "$@")" + SOCKET="$(_get_config 'socket' "$@")" + + if [ ! -d "$DATADIR/mysql" ]; then + # If the password variable is a filename we use the contents of the file. We + # read this first to make sure that a proper error is generated for empty files. + if [ -f "$MYSQL_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + if [ -z "$MYSQL_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' + exit 1 + fi + fi + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] No password option specified for new database.' + echo >&2 '[Entrypoint] A random onetime password will be generated.' + MYSQL_RANDOM_ROOT_PASSWORD=true + MYSQL_ONETIME_PASSWORD=true + fi + if [ ! -d "$DATADIR" ]; then + mkdir -p "$DATADIR" + chown mysql:mysql "$DATADIR" + fi + + # The user can set a default_timezone either in a my.cnf file + # they mount into the container or on command line + # (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`) + # however the timezone tables will only be populated in a later + # stage of this script. By using +00:00 as timezone we override + # the user's choice during initialization. Later the server + # will be restarted using the user's option. + + echo '[Entrypoint] Initializing database' + "$@" --user=$MYSQLD_USER --initialize-insecure --default-time-zone=+00:00 + + echo '[Entrypoint] Database initialized' + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" --default-time-zone=+00:00 + + # To avoid using password on commandline, put it in a temporary file. + # The file is only populated when and if the root password is set. + PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + $install_devnull "$PASSFILE" + # Define the client command used throughout the script + # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") + + if [ ! -z %%STARTUP_WAIT%% ]; + then + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break + fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 + fi + fi + + mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql + + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(_mkpw)" + echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + fi + if [ -z "$MYSQL_ROOT_HOST" ]; then + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';" + else + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ + GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + fi + "${mysql[@]}" <<-EOSQL + DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; + ${ROOTCREATE} + FLUSH PRIVILEGES ; + EOSQL + if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then + # Put the password into the temporary config file + cat >"$PASSFILE" < "$SQL" +ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL + fi + fi + + echo + echo '[Entrypoint] MySQL init process done. Ready for start up.' + echo + fi + + # Used by healthcheck to make sure it doesn't mistakenly report container + # healthy during startup + # Put the password into the temporary config file + touch /var/lib/mysql-files/healthcheck.cnf + cat >"/var/lib/mysql-files/healthcheck.cnf" < Date: Thu, 30 May 2024 08:07:58 +0200 Subject: [PATCH 346/386] ET#81519 - Set weekly innovation version to 9.1.0 and remove any unused code Change-Id: I8d4853dbed2bd8857c041bf66e5748ebd0be4243 --- mysql-cluster/VERSION | 23 +++++++++++++++++++++-- mysql-router/VERSION | 31 +++++++++++++++++++++++++++---- mysql-server/VERSION | 28 +++++++++++++++++++++++----- mysql-server/gen_dockerfiles.sh | 3 --- 4 files changed, 71 insertions(+), 14 deletions(-) diff --git a/mysql-cluster/VERSION b/mysql-cluster/VERSION index 8de69356a..fb2ae5ece 100644 --- a/mysql-cluster/VERSION +++ b/mysql-cluster/VERSION @@ -1,7 +1,23 @@ IMAGE_VERSION=1.2.16-cluster -LATEST="8.4" + +# LATEST is always set to the +# current highest release, which is, +# either 'innovation' or an LTS series +# i.e. 9.7, or 10.7 + +LATEST="innovation" + + + +# LATEST_LTS is set to the highest +# LTS series currently being released +# i.e. when 9.7 release will come it +# will be set to 9.7 up till 10.7 and +# then 10.7 and so on + LATEST_LTS="8.4" -LATEST_INNOVATION="9.0" + + # The value of key should be series # i.e. 8.0, 8.4, innovation, 9.7, etc. @@ -11,11 +27,14 @@ LATEST_INNOVATION="9.0" declare -A MYSQL_CLUSTER_VERSIONS MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.37 MYSQL_CLUSTER_VERSIONS["8.4"]=8.4.0 +MYSQL_CLUSTER_VERSIONS["innovation"]=9.0.0 declare -A MYSQL_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["8.0"]=8.0.37 MYSQL_SHELL_VERSIONS["8.4"]=8.4.0 +MYSQL_SHELL_VERSIONS["innovation"]=9.0.0 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["8.0"]="${MYSQL_CLUSTER_VERSIONS["8.0"]}-${IMAGE_VERSION}" FULL_SERVER_VERSIONS["8.4"]="${MYSQL_CLUSTER_VERSIONS["8.4"]}-${IMAGE_VERSION}" +FULL_SERVER_VERSIONS["innovation"]="${MYSQL_CLUSTER_VERSIONS["innovation"]}-${IMAGE_VERSION}" diff --git a/mysql-router/VERSION b/mysql-router/VERSION index 64d218b8b..1138c9c89 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -1,20 +1,43 @@ IMAGE_VERSION=1.0.16-router -LATEST="8.4" + +# LATEST is always set to the +# current highest release, which is, +# either 'innovation' or an LTS series +# i.e. 9.7, or 10.7 + +LATEST="innovation" + + + +# LATEST_LTS is set to the highest +# LTS series currently being released +# i.e. when 9.7 release will come it +# will be set to 9.7 up till 10.7 and +# then 10.7 and so on + LATEST_LTS="8.4" -LATEST_INNOVATION="9.0" + + + +# The value of key should be series +# i.e. 8.0, 8.4, innovation, 9.7, etc. +# do not use any other value for key +# like 'latest-8.4' or 'lts-84', etch declare -A MYSQL_ROUTER_VERSIONS WEEKLY_ROUTER_VERSIONS MYSQL_ROUTER_VERSIONS["8.0"]=8.0.37 MYSQL_ROUTER_VERSIONS["8.4"]=8.4.0 +MYSQL_ROUTER_VERSIONS["innovation"]=9.0.0 WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.38 WEEKLY_ROUTER_VERSIONS["8.4"]=8.4.1 -WEEKLY_ROUTER_VERSIONS["innovation"]=9.0.0 +WEEKLY_ROUTER_VERSIONS["innovation"]=9.1.0 declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["8.0"]=8.0.37 MYSQL_SERVER_VERSIONS["8.4"]=8.4.0 +MYSQL_SERVER_VERSIONS["innovation"]=9.0.0 WEEKLY_SERVER_VERSIONS["8.0"]=8.0.38 WEEKLY_SERVER_VERSIONS["8.4"]=8.4.1 -WEEKLY_SERVER_VERSIONS["innovation"]=9.0.0 +WEEKLY_SERVER_VERSIONS["innovation"]=9.1.0 diff --git a/mysql-server/VERSION b/mysql-server/VERSION index 448a93993..c51b14ff2 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,25 +1,43 @@ IMAGE_VERSION=1.2.16-server -LATEST="8.4" + +# LATEST is always set to the +# current highest release, which is, +# either 'innovation' or an LTS series +# i.e. 9.7, or 10.7 + +LATEST="innovation" + + + +# LATEST_LTS is set to the highest +# LTS series currently being released +# i.e. when 9.7 release will come it +# will be set to 9.7 up till 10.7 and +# then 10.7 and so on + LATEST_LTS="8.4" -LATEST_INNOVATION="9.0" + + # The value of key should be series # i.e. 8.0, 8.4, innovation, 9.7, etc. # do not use any other value for key -# like 'latest-8.4' or 'lts-84', etch +# like 'latest-8.4' or 'lts-84', etc. declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["8.0"]=8.0.37 MYSQL_SERVER_VERSIONS["8.4"]=8.4.0 +MYSQL_SERVER_VERSIONS["innovation"]=9.0.0 WEEKLY_SERVER_VERSIONS["8.0"]=8.0.38 WEEKLY_SERVER_VERSIONS["8.4"]=8.4.1 -WEEKLY_SERVER_VERSIONS["innovation"]=9.0.0 +WEEKLY_SERVER_VERSIONS["innovation"]=9.1.0 declare -A MYSQL_SHELL_VERSIONS WEEKLY_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["8.0"]=8.0.37 MYSQL_SHELL_VERSIONS["8.4"]=8.4.0 +MYSQL_SHELL_VERSIONS["innovation"]=9.0.0 WEEKLY_SHELL_VERSIONS["8.0"]=8.0.38 WEEKLY_SHELL_VERSIONS["8.4"]=8.4.1 -WEEKLY_SHELL_VERSIONS["innovation"]=9.0.0 +WEEKLY_SHELL_VERSIONS["innovation"]=9.1.0 diff --git a/mysql-server/gen_dockerfiles.sh b/mysql-server/gen_dockerfiles.sh index 8605d269f..76e9f9862 100755 --- a/mysql-server/gen_dockerfiles.sh +++ b/mysql-server/gen_dockerfiles.sh @@ -35,9 +35,6 @@ MYSQL_CONFIG_PKG="mysql80-community-release"; [ -n "${11}" ] && MYSQL_CONFIG_PKG # Get the Major Version MAJOR_VERSION=${MYSQL_VERSION%.*} -if [ $MAJOR_VERSION == $LATEST_INNOVATION ]; then - REPO_PATH="innovation" -fi if [[ ${MYSQL_CONFIG_PKG_MINIMAL} =~ (community) ]]; then CONT_NAME="mysql-server" From b9a95dc75209e81b348c82b0c1016ba9e63b8444 Mon Sep 17 00:00:00 2001 From: Karen Langford Date: Mon, 10 Jun 2024 06:21:13 +0200 Subject: [PATCH 347/386] ET#81589: Bump versions for July 8.0.38/8.4.1/9.0.0 Docker releases Change-Id: Ic9b3fe5b792a06215a39ca45aac3488897add206 --- mysql-cluster/VERSION | 10 +++++----- mysql-router/VERSION | 18 +++++++++--------- mysql-server/VERSION | 18 +++++++++--------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/mysql-cluster/VERSION b/mysql-cluster/VERSION index fb2ae5ece..6180c7f6a 100644 --- a/mysql-cluster/VERSION +++ b/mysql-cluster/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.2.16-cluster +IMAGE_VERSION=1.2.17-cluster # LATEST is always set to the # current highest release, which is, @@ -25,13 +25,13 @@ LATEST_LTS="8.4" # like 'latest-8.4' or 'lts-84', etch declare -A MYSQL_CLUSTER_VERSIONS -MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.37 -MYSQL_CLUSTER_VERSIONS["8.4"]=8.4.0 +MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.38 +MYSQL_CLUSTER_VERSIONS["8.4"]=8.4.1 MYSQL_CLUSTER_VERSIONS["innovation"]=9.0.0 declare -A MYSQL_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["8.0"]=8.0.37 -MYSQL_SHELL_VERSIONS["8.4"]=8.4.0 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.38 +MYSQL_SHELL_VERSIONS["8.4"]=8.4.1 MYSQL_SHELL_VERSIONS["innovation"]=9.0.0 declare -A FULL_SERVER_VERSIONS diff --git a/mysql-router/VERSION b/mysql-router/VERSION index 1138c9c89..17fe234a6 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.0.16-router +IMAGE_VERSION=1.0.17-router # LATEST is always set to the # current highest release, which is, @@ -25,19 +25,19 @@ LATEST_LTS="8.4" # like 'latest-8.4' or 'lts-84', etch declare -A MYSQL_ROUTER_VERSIONS WEEKLY_ROUTER_VERSIONS -MYSQL_ROUTER_VERSIONS["8.0"]=8.0.37 -MYSQL_ROUTER_VERSIONS["8.4"]=8.4.0 +MYSQL_ROUTER_VERSIONS["8.0"]=8.0.38 +MYSQL_ROUTER_VERSIONS["8.4"]=8.4.1 MYSQL_ROUTER_VERSIONS["innovation"]=9.0.0 -WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.38 -WEEKLY_ROUTER_VERSIONS["8.4"]=8.4.1 +WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.39 +WEEKLY_ROUTER_VERSIONS["8.4"]=8.4.2 WEEKLY_ROUTER_VERSIONS["innovation"]=9.1.0 declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["8.0"]=8.0.37 -MYSQL_SERVER_VERSIONS["8.4"]=8.4.0 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.38 +MYSQL_SERVER_VERSIONS["8.4"]=8.4.1 MYSQL_SERVER_VERSIONS["innovation"]=9.0.0 -WEEKLY_SERVER_VERSIONS["8.0"]=8.0.38 -WEEKLY_SERVER_VERSIONS["8.4"]=8.4.1 +WEEKLY_SERVER_VERSIONS["8.0"]=8.0.39 +WEEKLY_SERVER_VERSIONS["8.4"]=8.4.2 WEEKLY_SERVER_VERSIONS["innovation"]=9.1.0 diff --git a/mysql-server/VERSION b/mysql-server/VERSION index c51b14ff2..793e563f5 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.2.16-server +IMAGE_VERSION=1.2.17-server # LATEST is always set to the # current highest release, which is, @@ -25,19 +25,19 @@ LATEST_LTS="8.4" # like 'latest-8.4' or 'lts-84', etc. declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["8.0"]=8.0.37 -MYSQL_SERVER_VERSIONS["8.4"]=8.4.0 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.38 +MYSQL_SERVER_VERSIONS["8.4"]=8.4.1 MYSQL_SERVER_VERSIONS["innovation"]=9.0.0 -WEEKLY_SERVER_VERSIONS["8.0"]=8.0.38 -WEEKLY_SERVER_VERSIONS["8.4"]=8.4.1 +WEEKLY_SERVER_VERSIONS["8.0"]=8.0.39 +WEEKLY_SERVER_VERSIONS["8.4"]=8.4.2 WEEKLY_SERVER_VERSIONS["innovation"]=9.1.0 declare -A MYSQL_SHELL_VERSIONS WEEKLY_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["8.0"]=8.0.37 -MYSQL_SHELL_VERSIONS["8.4"]=8.4.0 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.38 +MYSQL_SHELL_VERSIONS["8.4"]=8.4.1 MYSQL_SHELL_VERSIONS["innovation"]=9.0.0 -WEEKLY_SHELL_VERSIONS["8.0"]=8.0.38 -WEEKLY_SHELL_VERSIONS["8.4"]=8.4.1 +WEEKLY_SHELL_VERSIONS["8.0"]=8.0.39 +WEEKLY_SHELL_VERSIONS["8.4"]=8.4.2 WEEKLY_SHELL_VERSIONS["innovation"]=9.1.0 From c68ad7bae09038a00410c985bdf8a6aba2833a00 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Mon, 1 Jul 2024 05:15:16 +0000 Subject: [PATCH 348/386] Release version 1.2.17-server * ET#81589: Bump versions for July 8.0.38/8.4.1/9.0.0 Docker releases * ET#81519 - Set weekly innovation version to 9.1.0 and remove any unused code --- mysql-server/8.0/Dockerfile | 4 +- mysql-server/8.0/docker-entrypoint.sh | 4 +- mysql-server/8.0/inspec/control.rb | 4 +- mysql-server/8.4/Dockerfile | 4 +- mysql-server/8.4/docker-entrypoint.sh | 4 +- mysql-server/8.4/inspec/control.rb | 4 +- mysql-server/9.0/Dockerfile | 45 +++++ mysql-server/9.0/docker-entrypoint.sh | 230 ++++++++++++++++++++++++++ mysql-server/9.0/healthcheck.sh | 24 +++ mysql-server/9.0/inspec/control.rb | 20 +++ mysql-server/9.0/prepare-image.sh | 25 +++ 11 files changed, 356 insertions(+), 12 deletions(-) create mode 100644 mysql-server/9.0/Dockerfile create mode 100755 mysql-server/9.0/docker-entrypoint.sh create mode 100755 mysql-server/9.0/healthcheck.sh create mode 100644 mysql-server/9.0/inspec/control.rb create mode 100755 mysql-server/9.0/prepare-image.sh diff --git a/mysql-server/8.0/Dockerfile b/mysql-server/8.0/Dockerfile index 676deb4de..f193c209e 100644 --- a/mysql-server/8.0/Dockerfile +++ b/mysql-server/8.0/Dockerfile @@ -15,8 +15,8 @@ FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.37 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.37 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.38 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.38 # Setup repositories for minimal packages (all versions) RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ diff --git a/mysql-server/8.0/docker-entrypoint.sh b/mysql-server/8.0/docker-entrypoint.sh index f8a1c6e5f..70c33844c 100755 --- a/mysql-server/8.0/docker-entrypoint.sh +++ b/mysql-server/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.37-1.2.16-server" +echo "[Entrypoint] MySQL Docker Image 8.0.38-1.2.17-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.37-1.2.16-server" + echo "[Entrypoint] Starting MySQL 8.0.38-1.2.17-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/8.0/inspec/control.rb b/mysql-server/8.0/inspec/control.rb index 2476df29d..06a49a37e 100644 --- a/mysql-server/8.0/inspec/control.rb +++ b/mysql-server/8.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.37.*' } + its ('version') { should match '8.0.38.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.37.*' } + its ('version') { should match '8.0.38.*' } end end diff --git a/mysql-server/8.4/Dockerfile b/mysql-server/8.4/Dockerfile index 2c1655174..3dbdaa856 100644 --- a/mysql-server/8.4/Dockerfile +++ b/mysql-server/8.4/Dockerfile @@ -15,8 +15,8 @@ FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.4.0 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.4.0 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.4.1 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.4.1 # Setup repositories for minimal packages (all versions) RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ diff --git a/mysql-server/8.4/docker-entrypoint.sh b/mysql-server/8.4/docker-entrypoint.sh index 6e8d65678..70886520f 100755 --- a/mysql-server/8.4/docker-entrypoint.sh +++ b/mysql-server/8.4/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.4.0-1.2.16-server" +echo "[Entrypoint] MySQL Docker Image 8.4.1-1.2.17-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.4.0-1.2.16-server" + echo "[Entrypoint] Starting MySQL 8.4.1-1.2.17-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/8.4/inspec/control.rb b/mysql-server/8.4/inspec/control.rb index 5daf7f18c..efb23c936 100644 --- a/mysql-server/8.4/inspec/control.rb +++ b/mysql-server/8.4/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.4.0.*' } + its ('version') { should match '8.4.1.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.4.0.*' } + its ('version') { should match '8.4.1.*' } end end diff --git a/mysql-server/9.0/Dockerfile b/mysql-server/9.0/Dockerfile new file mode 100644 index 000000000..475efe196 --- /dev/null +++ b/mysql-server/9.0/Dockerfile @@ -0,0 +1,45 @@ +# Copyright (c) 2017, 2023, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +FROM container-registry.oracle.com/os/oraclelinux:9-slim + +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-9.0.0 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-9.0.0 + +# Setup repositories for minimal packages (all versions) +RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ + && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm + +# Install server and shell 8.0 +RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ + && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --disablerepo=ol9_appstream \ + --enablerepo=mysql-innovation-community-minimal $MYSQL_SERVER_PACKAGE \ + && microdnf remove -y mysql-community-minimal-release mysql84-community-release \ + && microdnf clean all \ + && mkdir /docker-entrypoint-initdb.d + +COPY prepare-image.sh / +RUN /prepare-image.sh && rm -f /prepare-image.sh + +ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock + +COPY docker-entrypoint.sh /entrypoint.sh +COPY healthcheck.sh /healthcheck.sh +ENTRYPOINT ["/entrypoint.sh"] +HEALTHCHECK CMD /healthcheck.sh +EXPOSE 3306 33060 33061 +CMD ["mysqld"] + diff --git a/mysql-server/9.0/docker-entrypoint.sh b/mysql-server/9.0/docker-entrypoint.sh new file mode 100755 index 000000000..565b7458d --- /dev/null +++ b/mysql-server/9.0/docker-entrypoint.sh @@ -0,0 +1,230 @@ +#!/bin/bash +# Copyright (c) 2017, 2021, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +echo "[Entrypoint] MySQL Docker Image 9.0.0-1.2.17-server" +# Fetch value from server config +# We use mysqld --verbose --help instead of my_print_defaults because the +# latter only show values present in config files, and not server defaults +_get_config() { + local conf="$1"; shift + "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' +} + +# Generate a random password +_mkpw() { + letter=$(cat /dev/urandom| tr -dc a-zA-Z | dd bs=1 count=16 2> /dev/null ) + number=$(cat /dev/urandom| tr -dc 0-9 | dd bs=1 count=8 2> /dev/null) + special=$(cat /dev/urandom| tr -dc '=+@#%^&*_.,;:?/' | dd bs=1 count=8 2> /dev/null) + + echo $letter$number$special | fold -w 1 | shuf | tr -d '\n' +} + +# If command starts with an option, prepend mysqld +# This allows users to add command-line options without +# needing to specify the "mysqld" command +if [ "${1:0:1}" = '-' ]; then + set -- mysqld "$@" +fi + +# Check if entrypoint (and the container) is running as root +if [ $(id -u) = "0" ]; then + is_root=1 + install_devnull="install /dev/null -m0600 -omysql -gmysql" + MYSQLD_USER=mysql +else + install_devnull="install /dev/null -m0600" + MYSQLD_USER=$(id -u) +fi + +if [ "$1" = 'mysqld' ]; then + # Test that the server can start. We redirect stdout to /dev/null so + # only the error messages are left. + result=0 + output=$("$@" --validate-config) || result=$? + if [ ! "$result" = "0" ]; then + echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' + echo >&2 "[Entrypoint] $output" + exit 1 + fi + + # Get config + DATADIR="$(_get_config 'datadir' "$@")" + SOCKET="$(_get_config 'socket' "$@")" + + if [ ! -d "$DATADIR/mysql" ]; then + # If the password variable is a filename we use the contents of the file. We + # read this first to make sure that a proper error is generated for empty files. + if [ -f "$MYSQL_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + if [ -z "$MYSQL_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' + exit 1 + fi + fi + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] No password option specified for new database.' + echo >&2 '[Entrypoint] A random onetime password will be generated.' + MYSQL_RANDOM_ROOT_PASSWORD=true + MYSQL_ONETIME_PASSWORD=true + fi + if [ ! -d "$DATADIR" ]; then + mkdir -p "$DATADIR" + chown mysql:mysql "$DATADIR" + fi + + # The user can set a default_timezone either in a my.cnf file + # they mount into the container or on command line + # (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`) + # however the timezone tables will only be populated in a later + # stage of this script. By using +00:00 as timezone we override + # the user's choice during initialization. Later the server + # will be restarted using the user's option. + + echo '[Entrypoint] Initializing database' + "$@" --user=$MYSQLD_USER --initialize-insecure --default-time-zone=+00:00 + + echo '[Entrypoint] Database initialized' + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" --default-time-zone=+00:00 + + # To avoid using password on commandline, put it in a temporary file. + # The file is only populated when and if the root password is set. + PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + $install_devnull "$PASSFILE" + # Define the client command used throughout the script + # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") + + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break + fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 + fi + + mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql + + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(_mkpw)" + echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + fi + if [ -z "$MYSQL_ROOT_HOST" ]; then + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';" + else + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ + GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + fi + "${mysql[@]}" <<-EOSQL + DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; + ${ROOTCREATE} + FLUSH PRIVILEGES ; + EOSQL + if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then + # Put the password into the temporary config file + cat >"$PASSFILE" < "$SQL" +ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL + fi + + echo + echo '[Entrypoint] MySQL init process done. Ready for start up.' + echo + fi + + # Used by healthcheck to make sure it doesn't mistakenly report container + # healthy during startup + # Put the password into the temporary config file + touch /var/lib/mysql-files/healthcheck.cnf + cat >"/var/lib/mysql-files/healthcheck.cnf" < Date: Mon, 1 Jul 2024 05:43:42 +0000 Subject: [PATCH 349/386] Release version 1.0.17-router * ET#81589: Bump versions for July 8.0.38/8.4.1/9.0.0 Docker releases * ET#81519 - Set weekly innovation version to 9.1.0 and remove any unused code --- mysql-router/8.0/Dockerfile | 4 +- mysql-router/8.0/inspec/control.rb | 4 +- mysql-router/8.4/Dockerfile | 4 +- mysql-router/8.4/inspec/control.rb | 4 +- mysql-router/9.0/Dockerfile | 39 +++++++++++ mysql-router/9.0/README.md | 88 +++++++++++++++++++++++++ mysql-router/9.0/inspec/control.rb | 20 ++++++ mysql-router/9.0/run.sh | 101 +++++++++++++++++++++++++++++ 8 files changed, 256 insertions(+), 8 deletions(-) create mode 100644 mysql-router/9.0/Dockerfile create mode 100644 mysql-router/9.0/README.md create mode 100644 mysql-router/9.0/inspec/control.rb create mode 100755 mysql-router/9.0/run.sh diff --git a/mysql-router/8.0/Dockerfile b/mysql-router/8.0/Dockerfile index 8ad3af4d8..c4acab024 100644 --- a/mysql-router/8.0/Dockerfile +++ b/mysql-router/8.0/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.37 -ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.37 +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.38 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.38 ARG CONFIG_PACKAGE_NAME=mysql84-community-release-el9.rpm ARG REPO_NAME_SERVER=mysql80-community ARG REPO_NAME_TOOLS=mysql-tools-community diff --git a/mysql-router/8.0/inspec/control.rb b/mysql-router/8.0/inspec/control.rb index 6bdc2f102..9f6dbdd69 100644 --- a/mysql-router/8.0/inspec/control.rb +++ b/mysql-router/8.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-client') do it { should be_installed } - its ('version') { should match '8.0.37.*' } + its ('version') { should match '8.0.38.*' } end describe package('mysql-router-community') do it { should be_installed } - its ('version') { should match '8.0.37.*' } + its ('version') { should match '8.0.38.*' } end end diff --git a/mysql-router/8.4/Dockerfile b/mysql-router/8.4/Dockerfile index 70d720d7c..ec8382619 100644 --- a/mysql-router/8.4/Dockerfile +++ b/mysql-router/8.4/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.4.0 -ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.4.0 +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.4.1 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.4.1 ARG CONFIG_PACKAGE_NAME=mysql84-community-release-el9.rpm ARG REPO_NAME_SERVER=mysql-8.4-lts-community ARG REPO_NAME_TOOLS=mysql-tools-8.4-lts-community diff --git a/mysql-router/8.4/inspec/control.rb b/mysql-router/8.4/inspec/control.rb index 5c772d168..2e5b29f85 100644 --- a/mysql-router/8.4/inspec/control.rb +++ b/mysql-router/8.4/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-client') do it { should be_installed } - its ('version') { should match '8.4.0.*' } + its ('version') { should match '8.4.1.*' } end describe package('mysql-router-community') do it { should be_installed } - its ('version') { should match '8.4.0.*' } + its ('version') { should match '8.4.1.*' } end end diff --git a/mysql-router/9.0/Dockerfile b/mysql-router/9.0/Dockerfile new file mode 100644 index 000000000..ace89c2e1 --- /dev/null +++ b/mysql-router/9.0/Dockerfile @@ -0,0 +1,39 @@ +# Copyright (c) 2018, 2023, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +FROM container-registry.oracle.com/os/oraclelinux:9-slim + +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-9.0.0 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-9.0.0 +ARG CONFIG_PACKAGE_NAME=mysql84-community-release-el9.rpm +ARG REPO_NAME_SERVER=mysql-innovation-community +ARG REPO_NAME_TOOLS=mysql-tools-innovation-community + +RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ + && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ + -c "MySQL Router" mysqlrouter \ + && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/$CONFIG_PACKAGE_NAME \ + && microdnf install -y \ + --enablerepo=mysql-innovation-community $MYSQL_CLIENT_PACKAGE \ + && microdnf install -y --disablerepo=\* \ + --enablerepo=mysql-tools-innovation-community $MYSQL_ROUTER_PACKAGE \ + && microdnf clean all + +COPY run.sh /run.sh +HEALTHCHECK \ + CMD mysqladmin --port 6446 --protocol TCP ping 2>&1 | grep Access || exit 1 +EXPOSE 6446 6447 6448 6449 6450 8443 +USER 999:999 +ENTRYPOINT ["/run.sh"] +CMD ["mysqlrouter"] diff --git a/mysql-router/9.0/README.md b/mysql-router/9.0/README.md new file mode 100644 index 000000000..0f2711ba5 --- /dev/null +++ b/mysql-router/9.0/README.md @@ -0,0 +1,88 @@ +![logo](https://www.mysql.com/common/logos/logo-mysql-170x115.png) + +# What is MySQL Router? + +MySQL Router is part of InnoDB cluster, and is lightweight middleware that +provides transparent routing between your application and back-end MySQL +Servers. It can be used for a wide variety of use cases, such as providing high +availability and scalability by effectively routing database traffic to +appropriate back-end MySQL Servers. The pluggable architecture also enables +developers to extend MySQL Router for custom use cases. + +# Supported Tags and Respective Dockerfile Links + +* MySQL Router 8.0 (tag: [`latest`, `8.0`](https://github.com/mysql/mysql-docker/blob/mysql-router/8.0/Dockerfile)) ([mysql-router/8.0/Dockerfile](https://github.com/mysql/mysql-docker/blob/mysql-router/8.0/Dockerfile)) + +Images are updated when new MySQL Server maintenance releases and development milestones are published. Please note that non-GA releases are for preview purposes only and should not be used in production setups. + +# How to Use the MySQL Router Images + +The image currently uses the following mandatory variables: + +| Variable | Description | +| ------------------------ | ------------------------------------------- | +| MYSQL_HOST | MySQL host to connect to | +| MYSQL_PORT | Port to use | +| MYSQL_USER | User to connect with | +| MYSQL_PASSWORD | Password to connect with | + +Running in a container requires a working InnoDB cluster. + +The image uses the following optional variables: + +| Variable | Description | +| ------------------------------------ | ------------------------------------------- | +| MYSQL_INNODB_CLUSTER_MEMBERS | Wait for at least this number of cluster instances to be ONLINE | +| MYSQL_CREATE_ROUTER_USER | Whether to create a new account for the Router to use when it's running. Defaults to 1, set to 0 to disable. | +| MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS | Additional command line options applied while bootstrapping + +If supplied the run script waits for the given mysql host to be up, the InnoDB cluster to have +MYSQL_INNODB_CLUSTER_MEMBERS members and then uses the given server for its +bootstrap mode +[Bootstrapping](https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-deploying-bootstrapping.html). + +The image can be run via: + +``` +docker run -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -e MYSQL_INNODB_CLUSTER_MEMBERS=3 -ti mysql/mysql-router +``` + +Additional command line options for running MySQL Router after bootstrap can be passed a command options. For instance you can use a config file from your home directory like this: + +``` +docker run -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -ti -v $HOME/router-extra.conf:/tmp/router-extra.conf mysql/mysql-router mysqlrouter --extra-config=/tmp/router-extra.conf +``` + +It can be verified by typing: + +``` +docker ps +``` + +The following output should be displayed: + +``` +4954b1c80be1 mysql-router:8.0 "/run.sh mysqlrouter" About a minute ago Up About a minute (healthy) 6447/tcp, 6448/tcp, 0.0.0.0:6446->6446/tcp, 6449/tcp innodbcluster_mysql-router_1 +``` + +By default the container will run as user 999:999 which maps to mysqlrouter:mysqlrouter inside the container. + +# Exposed Ports + +The following TCP ports are exposed by the MySQL Router container: + +| Port | Description +| ----- | --------------------------------------------------------------------------------------- | +| 6446 | R/W connection port. Clients that connect to this port will be forwarded to the PRIMARY | +| 6447 | R/O connection port. Clients that connect to this port will be forwarded to a SECONDARY | +| 6448 | X Protocol R/W connection port. R/W port for X protocol client connections | +| 6449 | X Protocol R/O connection port. R/O port for X protocol client connections | +| 8443 | HTTPS REST interface port. | + +For more information about the REST interface API, see: + +https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-rest-api-reference.html + +For full usage documentation, see: + +https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-installation-docker.html diff --git a/mysql-router/9.0/inspec/control.rb b/mysql-router/9.0/inspec/control.rb new file mode 100644 index 000000000..d9474739d --- /dev/null +++ b/mysql-router/9.0/inspec/control.rb @@ -0,0 +1,20 @@ +control 'container' do + impact 0.5 + describe podman.containers do + its('status') { should cmp /Up/ } + its('commands') { should cmp /sleep/ } + its('images') { should cmp /mysql-router:9.0/ } + its('names') { should include "mysql-router-9.0" } + end +end +control 'packages' do + impact 0.5 + describe package('mysql-community-client') do + it { should be_installed } + its ('version') { should match '9.0.0.*' } + end + describe package('mysql-router-community') do + it { should be_installed } + its ('version') { should match '9.0.0.*' } + end +end diff --git a/mysql-router/9.0/run.sh b/mysql-router/9.0/run.sh new file mode 100755 index 000000000..f806c1afe --- /dev/null +++ b/mysql-router/9.0/run.sh @@ -0,0 +1,101 @@ +#!/bin/bash +# Copyright (c) 2018, 2021, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +if [ "$1" = 'mysqlrouter' ]; then + if [[ -z $MYSQL_HOST || -z $MYSQL_PORT || -z $MYSQL_USER || -z $MYSQL_PASSWORD ]]; then + echo "We require all of" + echo " MYSQL_HOST" + echo " MYSQL_PORT" + echo " MYSQL_USER" + echo " MYSQL_PASSWORD" + echo "to be set." + echo "In addition you can set" + echo " MYSQL_INNODB_CLUSTER_MEMBERS " + echo " MYSQL_CREATE_ROUTER_USER" + echo " MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS" + echo "Exiting." + exit 1 + fi + + PASSFILE=$(mktemp) + echo "$MYSQL_PASSWORD" > "$PASSFILE" + if [ -z $MYSQL_CREATE_ROUTER_USER ]; then + echo "$MYSQL_PASSWORD" >> "$PASSFILE" + MYSQL_CREATE_ROUTER_USER=1 + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is not set, Router will generate a new account to be used at runtime." + echo "[Entrypoint] Set it to 0 to reuse $MYSQL_USER instead." + elif [ "$MYSQL_CREATE_ROUTER_USER" = "0" ]; then + echo "$MYSQL_PASSWORD" >> "$PASSFILE" + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is 0, Router will reuse $MYSQL_USER account at runtime" + else + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is not 0, Router will generate a new account to be used at runtime" + fi + + DEFAULTS_EXTRA_FILE=$(mktemp) + cat >"$DEFAULTS_EXTRA_FILE" < "/dev/tcp/$MYSQL_HOST/$MYSQL_PORT") >/dev/null 2>&1; do + echo "[Entrypoint] Waiting for mysql server $MYSQL_HOST ($attempt_num/$max_tries)" + sleep $(( attempt_num++ )) + if (( attempt_num == max_tries )); then + exit 1 + fi + done + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST:$MYSQL_PORT. Checking for cluster state." + if ! [[ "$(mysql --defaults-extra-file="$DEFAULTS_EXTRA_FILE" -u "$MYSQL_USER" -h "$MYSQL_HOST" -P "$MYSQL_PORT" -e "show status;" 2> /dev/null)" ]]; then + echo "[Entrypoint] ERROR: Can not connect to database. Exiting." + exit 1 + fi + if [[ -n $MYSQL_INNODB_CLUSTER_MEMBERS ]]; then + attempt_num=0 + echo $attempt_num + echo $max_tries + until [ "$(mysql --defaults-extra-file="$DEFAULTS_EXTRA_FILE" -u "$MYSQL_USER" -h "$MYSQL_HOST" -P "$MYSQL_PORT" -N performance_schema -e "select count(MEMBER_STATE) >= $MYSQL_INNODB_CLUSTER_MEMBERS from replication_group_members where MEMBER_STATE = 'ONLINE';" 2> /dev/null)" -eq 1 ]; do + echo "[Entrypoint] Waiting for $MYSQL_INNODB_CLUSTER_MEMBERS cluster instances to become available via $MYSQL_HOST ($attempt_num/$max_tries)" + sleep $(( attempt_num++ )) + if (( attempt_num == max_tries )); then + exit 1 + fi + done + echo "[Entrypoint] Successfully contacted cluster with $MYSQL_INNODB_CLUSTER_MEMBERS members. Bootstrapping." + fi + if [ $(id -u) = "0" ]; then + opt_user=--user=mysqlrouter + fi + if [ "$MYSQL_CREATE_ROUTER_USER" = "0" ]; then + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap reusing account \"$MYSQL_USER\"." + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force --account-create=never --account=$MYSQL_USER $opt_user $MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS < "$PASSFILE" || exit 1 + else + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap." + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force $opt_user $MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS < "$PASSFILE" || exit 1 + fi + + sed -i -e 's/logging_folder=.*$/logging_folder=/' /tmp/mysqlrouter/mysqlrouter.conf + echo "[Entrypoint] Starting mysql-router." + exec "$@" --config /tmp/mysqlrouter/mysqlrouter.conf + + rm -f "$PASSFILE" + rm -f "$DEFAULTS_EXTRA_FILE" + unset DEFAULTS_EXTRA_FILE +else + exec "$@" +fi From 3e1702ce59d4711912d0bb190e99a43145abd6ce Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Tue, 2 Jul 2024 03:27:36 +0000 Subject: [PATCH 350/386] Release version 1.2.17-cluster * ET#81589: Bump versions for July 8.0.38/8.4.1/9.0.0 Docker releases * ET#81519 - Set weekly innovation version to 9.1.0 and remove any unused code --- mysql-cluster/8.0/Dockerfile | 6 +- mysql-cluster/8.0/docker-entrypoint.sh | 4 +- mysql-cluster/8.0/inspec/control.rb | 4 +- mysql-cluster/8.4/Dockerfile | 4 +- mysql-cluster/8.4/docker-entrypoint.sh | 4 +- mysql-cluster/8.4/inspec/control.rb | 4 +- mysql-cluster/9.0/Dockerfile | 47 +++++ mysql-cluster/9.0/cnf/my.cnf | 22 ++ mysql-cluster/9.0/cnf/mysql-cluster.cnf | 39 ++++ mysql-cluster/9.0/docker-entrypoint.sh | 264 ++++++++++++++++++++++++ mysql-cluster/9.0/healthcheck.sh | 24 +++ mysql-cluster/9.0/inspec/control.rb | 20 ++ mysql-cluster/9.0/prepare-image.sh | 25 +++ 13 files changed, 454 insertions(+), 13 deletions(-) create mode 100644 mysql-cluster/9.0/Dockerfile create mode 100644 mysql-cluster/9.0/cnf/my.cnf create mode 100644 mysql-cluster/9.0/cnf/mysql-cluster.cnf create mode 100755 mysql-cluster/9.0/docker-entrypoint.sh create mode 100755 mysql-cluster/9.0/healthcheck.sh create mode 100644 mysql-cluster/9.0/inspec/control.rb create mode 100755 mysql-cluster/9.0/prepare-image.sh diff --git a/mysql-cluster/8.0/Dockerfile b/mysql-cluster/8.0/Dockerfile index 297bea38d..9d80d9fa2 100644 --- a/mysql-cluster/8.0/Dockerfile +++ b/mysql-cluster/8.0/Dockerfile @@ -15,12 +15,12 @@ FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.0.37 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.37 +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.0.38 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.38 # Setup repositories for minimal packages (all versions) RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-cluster-community-minimal-release-el9.rpm \ - && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql80-community-release-el9.rpm + && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm # Install server and shell 8.0 RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ diff --git a/mysql-cluster/8.0/docker-entrypoint.sh b/mysql-cluster/8.0/docker-entrypoint.sh index dd0d16372..ae765bd34 100755 --- a/mysql-cluster/8.0/docker-entrypoint.sh +++ b/mysql-cluster/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.37-1.2.16-cluster" +echo "[Entrypoint] MySQL Docker Image 8.0.38-1.2.17-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -227,7 +227,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.37-1.2.16-cluster" + echo "[Entrypoint] Starting MySQL 8.0.38-1.2.17-cluster" fi export MYSQLD_PARENT_PID=$$ ; exec "$@" --user= else diff --git a/mysql-cluster/8.0/inspec/control.rb b/mysql-cluster/8.0/inspec/control.rb index fbbab474b..118ce1134 100644 --- a/mysql-cluster/8.0/inspec/control.rb +++ b/mysql-cluster/8.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.37.*' } + its ('version') { should match '8.0.38.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.37.*' } + its ('version') { should match '8.0.38.*' } end end diff --git a/mysql-cluster/8.4/Dockerfile b/mysql-cluster/8.4/Dockerfile index cbd0300ed..bcb4dc884 100644 --- a/mysql-cluster/8.4/Dockerfile +++ b/mysql-cluster/8.4/Dockerfile @@ -15,8 +15,8 @@ FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.4.0 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.4.0 +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.4.1 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.4.1 # Setup repositories for minimal packages (all versions) RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-cluster-community-minimal-release-el9.rpm \ diff --git a/mysql-cluster/8.4/docker-entrypoint.sh b/mysql-cluster/8.4/docker-entrypoint.sh index 58310cdc5..6e8b9831f 100755 --- a/mysql-cluster/8.4/docker-entrypoint.sh +++ b/mysql-cluster/8.4/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.4.0-1.2.16-cluster" +echo "[Entrypoint] MySQL Docker Image 8.4.1-1.2.17-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -227,7 +227,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.4.0-1.2.16-cluster" + echo "[Entrypoint] Starting MySQL 8.4.1-1.2.17-cluster" fi export MYSQLD_PARENT_PID=$$ ; exec "$@" --user= else diff --git a/mysql-cluster/8.4/inspec/control.rb b/mysql-cluster/8.4/inspec/control.rb index 7b94b9615..a930d1549 100644 --- a/mysql-cluster/8.4/inspec/control.rb +++ b/mysql-cluster/8.4/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.4.0.*' } + its ('version') { should match '8.4.1.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.4.0.*' } + its ('version') { should match '8.4.1.*' } end end diff --git a/mysql-cluster/9.0/Dockerfile b/mysql-cluster/9.0/Dockerfile new file mode 100644 index 000000000..2e72ccab8 --- /dev/null +++ b/mysql-cluster/9.0/Dockerfile @@ -0,0 +1,47 @@ +# Copyright (c) 2017, 2023, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +FROM container-registry.oracle.com/os/oraclelinux:9-slim + +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-9.0.0 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-9.0.0 + +# Setup repositories for minimal packages (all versions) +RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-cluster-community-minimal-release-el9.rpm \ + && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm + +# Install server and shell 8.0 +RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ + && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --disablerepo=ol9_appstream \ + --enablerepo=mysql-cluster-innovation-community-minimal $MYSQL_SERVER_PACKAGE \ + && microdnf clean all \ + && mkdir /docker-entrypoint-initdb.d + +COPY prepare-image.sh / +RUN /prepare-image.sh && rm -f /prepare-image.sh + +ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock + +COPY docker-entrypoint.sh /entrypoint.sh +COPY healthcheck.sh /healthcheck.sh +COPY cnf/my.cnf /etc/ +COPY cnf/mysql-cluster.cnf /etc/ + +ENTRYPOINT ["/entrypoint.sh"] +HEALTHCHECK CMD /healthcheck.sh +EXPOSE 3306 33060-33061 2202 1186 +CMD ["mysqld"] + diff --git a/mysql-cluster/9.0/cnf/my.cnf b/mysql-cluster/9.0/cnf/my.cnf new file mode 100644 index 000000000..ec98b2dc1 --- /dev/null +++ b/mysql-cluster/9.0/cnf/my.cnf @@ -0,0 +1,22 @@ +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +[mysqld] +ndbcluster +ndb-connectstring=192.168.0.2 +user=mysql + +[mysql_cluster] +ndb-connectstring=192.168.0.2 diff --git a/mysql-cluster/9.0/cnf/mysql-cluster.cnf b/mysql-cluster/9.0/cnf/mysql-cluster.cnf new file mode 100644 index 000000000..16f79f1c0 --- /dev/null +++ b/mysql-cluster/9.0/cnf/mysql-cluster.cnf @@ -0,0 +1,39 @@ +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +[ndbd default] +NoOfReplicas=2 +DataMemory=80M +IndexMemory=18M + + +[ndb_mgmd] +NodeId=1 +hostname=192.168.0.2 +datadir=/var/lib/mysql + +[ndbd] +NodeId=2 +hostname=192.168.0.3 +datadir=/var/lib/mysql + +[ndbd] +NodeId=3 +hostname=192.168.0.4 +datadir=/var/lib/mysql + +[mysqld] +NodeId=4 +hostname=192.168.0.10 diff --git a/mysql-cluster/9.0/docker-entrypoint.sh b/mysql-cluster/9.0/docker-entrypoint.sh new file mode 100755 index 000000000..9c130f143 --- /dev/null +++ b/mysql-cluster/9.0/docker-entrypoint.sh @@ -0,0 +1,264 @@ +#!/bin/bash +# Copyright (c) 2017, 2021, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +echo "[Entrypoint] MySQL Docker Image " +# Fetch value from server config +# We use mysqld --verbose --help instead of my_print_defaults because the +# latter only show values present in config files, and not server defaults +_get_config() { + local conf="$1"; shift + "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' +} + +# Generate a random password +_mkpw() { + letter=$(cat /dev/urandom| tr -dc a-zA-Z | dd bs=1 count=16 2> /dev/null ) + number=$(cat /dev/urandom| tr -dc 0-9 | dd bs=1 count=8 2> /dev/null) + special=$(cat /dev/urandom| tr -dc '=+@#%^&*_.,;:?/' | dd bs=1 count=8 2> /dev/null) + + echo $letter$number$special | fold -w 1 | shuf | tr -d '\n' +} + +# If command starts with an option, prepend mysqld +# This allows users to add command-line options without +# needing to specify the "mysqld" command +if [ "${1:0:1}" = '-' ]; then + set -- mysqld "$@" +fi + +# Check if entrypoint (and the container) is running as root +if [ $(id -u) = "0" ]; then + is_root=1 + install_devnull="install /dev/null -m0600 -omysql -gmysql" + MYSQLD_USER=mysql +else + install_devnull="install /dev/null -m0600" + MYSQLD_USER=$(id -u) +fi + +if [ "$1" = 'mysqld' ]; then + # Test that the server can start. We redirect stdout to /dev/null so + # only the error messages are left. + result=0 + output=$("$@" --validate-config) || result=$? + if [ ! "$result" = "0" ]; then + echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' + echo >&2 "[Entrypoint] $output" + exit 1 + fi + + # Get config + DATADIR="$(_get_config 'datadir' "$@")" + SOCKET="$(_get_config 'socket' "$@")" + + if [ ! -d "$DATADIR/mysql" ]; then + # If the password variable is a filename we use the contents of the file. We + # read this first to make sure that a proper error is generated for empty files. + if [ -f "$MYSQL_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + if [ -z "$MYSQL_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' + exit 1 + fi + fi + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] No password option specified for new database.' + echo >&2 '[Entrypoint] A random onetime password will be generated.' + MYSQL_RANDOM_ROOT_PASSWORD=true + MYSQL_ONETIME_PASSWORD=true + fi + if [ ! -d "$DATADIR" ]; then + mkdir -p "$DATADIR" + chown mysql:mysql "$DATADIR" + fi + + # The user can set a default_timezone either in a my.cnf file + # they mount into the container or on command line + # (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`) + # however the timezone tables will only be populated in a later + # stage of this script. By using +00:00 as timezone we override + # the user's choice during initialization. Later the server + # will be restarted using the user's option. + + echo '[Entrypoint] Initializing database' + "$@" --user=$MYSQLD_USER --initialize-insecure --default-time-zone=+00:00 + + echo '[Entrypoint] Database initialized' + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" --default-time-zone=+00:00 + + # To avoid using password on commandline, put it in a temporary file. + # The file is only populated when and if the root password is set. + PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + $install_devnull "$PASSFILE" + # Define the client command used throughout the script + # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") + + if [ ! -z %%STARTUP_WAIT%% ]; + then + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break + fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 + fi + fi + + mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql + + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(_mkpw)" + echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + fi + if [ -z "$MYSQL_ROOT_HOST" ]; then + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';" + else + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ + GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + fi + "${mysql[@]}" <<-EOSQL + DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; + ${ROOTCREATE} + FLUSH PRIVILEGES ; + EOSQL + if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then + # Put the password into the temporary config file + cat >"$PASSFILE" < "$SQL" +ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL + fi + fi + + echo + echo '[Entrypoint] MySQL init process done. Ready for start up.' + echo + fi + + # Used by healthcheck to make sure it doesn't mistakenly report container + # healthy during startup + # Put the password into the temporary config file + touch /var/lib/mysql-files/healthcheck.cnf + cat >"/var/lib/mysql-files/healthcheck.cnf" < Date: Sun, 14 Jul 2024 04:26:31 +0200 Subject: [PATCH 351/386] ET#81988: Bump versions for July OOC 8.0.39/8.4.2/9.0.1 Docker releases Change-Id: Ic52f5705c75ef50fc2ff4daef5be059fe2829748 --- mysql-cluster/VERSION | 10 +++++----- mysql-router/VERSION | 14 +++++++------- mysql-server/VERSION | 10 +++++----- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/mysql-cluster/VERSION b/mysql-cluster/VERSION index 6180c7f6a..7cf062160 100644 --- a/mysql-cluster/VERSION +++ b/mysql-cluster/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.2.17-cluster +IMAGE_VERSION=1.2.18-cluster # LATEST is always set to the # current highest release, which is, @@ -25,14 +25,14 @@ LATEST_LTS="8.4" # like 'latest-8.4' or 'lts-84', etch declare -A MYSQL_CLUSTER_VERSIONS -MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.38 -MYSQL_CLUSTER_VERSIONS["8.4"]=8.4.1 -MYSQL_CLUSTER_VERSIONS["innovation"]=9.0.0 +MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.39 +MYSQL_CLUSTER_VERSIONS["8.4"]=8.4.2 +MYSQL_CLUSTER_VERSIONS["innovation"]=9.0.1 declare -A MYSQL_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["8.0"]=8.0.38 MYSQL_SHELL_VERSIONS["8.4"]=8.4.1 -MYSQL_SHELL_VERSIONS["innovation"]=9.0.0 +MYSQL_SHELL_VERSIONS["innovation"]=9.0.1 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["8.0"]="${MYSQL_CLUSTER_VERSIONS["8.0"]}-${IMAGE_VERSION}" diff --git a/mysql-router/VERSION b/mysql-router/VERSION index 17fe234a6..7d004ea02 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.0.17-router +IMAGE_VERSION=1.0.18-router # LATEST is always set to the # current highest release, which is, @@ -25,18 +25,18 @@ LATEST_LTS="8.4" # like 'latest-8.4' or 'lts-84', etch declare -A MYSQL_ROUTER_VERSIONS WEEKLY_ROUTER_VERSIONS -MYSQL_ROUTER_VERSIONS["8.0"]=8.0.38 -MYSQL_ROUTER_VERSIONS["8.4"]=8.4.1 -MYSQL_ROUTER_VERSIONS["innovation"]=9.0.0 +MYSQL_ROUTER_VERSIONS["8.0"]=8.0.39 +MYSQL_ROUTER_VERSIONS["8.4"]=8.4.2 +MYSQL_ROUTER_VERSIONS["innovation"]=9.0.1 WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.39 WEEKLY_ROUTER_VERSIONS["8.4"]=8.4.2 WEEKLY_ROUTER_VERSIONS["innovation"]=9.1.0 declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["8.0"]=8.0.38 -MYSQL_SERVER_VERSIONS["8.4"]=8.4.1 -MYSQL_SERVER_VERSIONS["innovation"]=9.0.0 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.39 +MYSQL_SERVER_VERSIONS["8.4"]=8.4.2 +MYSQL_SERVER_VERSIONS["innovation"]=9.0.1 WEEKLY_SERVER_VERSIONS["8.0"]=8.0.39 WEEKLY_SERVER_VERSIONS["8.4"]=8.4.2 diff --git a/mysql-server/VERSION b/mysql-server/VERSION index 793e563f5..3f3fefa25 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.2.17-server +IMAGE_VERSION=1.2.18-server # LATEST is always set to the # current highest release, which is, @@ -25,9 +25,9 @@ LATEST_LTS="8.4" # like 'latest-8.4' or 'lts-84', etc. declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["8.0"]=8.0.38 -MYSQL_SERVER_VERSIONS["8.4"]=8.4.1 -MYSQL_SERVER_VERSIONS["innovation"]=9.0.0 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.39 +MYSQL_SERVER_VERSIONS["8.4"]=8.4.2 +MYSQL_SERVER_VERSIONS["innovation"]=9.0.1 WEEKLY_SERVER_VERSIONS["8.0"]=8.0.39 WEEKLY_SERVER_VERSIONS["8.4"]=8.4.2 @@ -36,7 +36,7 @@ WEEKLY_SERVER_VERSIONS["innovation"]=9.1.0 declare -A MYSQL_SHELL_VERSIONS WEEKLY_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["8.0"]=8.0.38 MYSQL_SHELL_VERSIONS["8.4"]=8.4.1 -MYSQL_SHELL_VERSIONS["innovation"]=9.0.0 +MYSQL_SHELL_VERSIONS["innovation"]=9.0.1 WEEKLY_SHELL_VERSIONS["8.0"]=8.0.39 WEEKLY_SHELL_VERSIONS["8.4"]=8.4.2 From 1f464ddf9fb977aa04bb1bf84a9b85ec7c8dea26 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Tue, 23 Jul 2024 04:03:40 +0000 Subject: [PATCH 352/386] Release version 1.2.18-server * ET#81988: Bump versions for July OOC 8.0.39/8.4.2/9.0.1 Docker releases --- mysql-server/8.0/Dockerfile | 2 +- mysql-server/8.0/docker-entrypoint.sh | 4 ++-- mysql-server/8.0/inspec/control.rb | 2 +- mysql-server/8.4/Dockerfile | 2 +- mysql-server/8.4/docker-entrypoint.sh | 4 ++-- mysql-server/8.4/inspec/control.rb | 2 +- mysql-server/9.0/Dockerfile | 4 ++-- mysql-server/9.0/docker-entrypoint.sh | 4 ++-- mysql-server/9.0/inspec/control.rb | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/mysql-server/8.0/Dockerfile b/mysql-server/8.0/Dockerfile index f193c209e..6b1c3a829 100644 --- a/mysql-server/8.0/Dockerfile +++ b/mysql-server/8.0/Dockerfile @@ -15,7 +15,7 @@ FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.38 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.39 ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.38 # Setup repositories for minimal packages (all versions) diff --git a/mysql-server/8.0/docker-entrypoint.sh b/mysql-server/8.0/docker-entrypoint.sh index 70c33844c..614172858 100755 --- a/mysql-server/8.0/docker-entrypoint.sh +++ b/mysql-server/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.38-1.2.17-server" +echo "[Entrypoint] MySQL Docker Image 8.0.39-1.2.18-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.38-1.2.17-server" + echo "[Entrypoint] Starting MySQL 8.0.39-1.2.18-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/8.0/inspec/control.rb b/mysql-server/8.0/inspec/control.rb index 06a49a37e..d1c657f12 100644 --- a/mysql-server/8.0/inspec/control.rb +++ b/mysql-server/8.0/inspec/control.rb @@ -11,7 +11,7 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.38.*' } + its ('version') { should match '8.0.39.*' } end describe package('mysql-shell') do it { should be_installed } diff --git a/mysql-server/8.4/Dockerfile b/mysql-server/8.4/Dockerfile index 3dbdaa856..f3d7ded2a 100644 --- a/mysql-server/8.4/Dockerfile +++ b/mysql-server/8.4/Dockerfile @@ -15,7 +15,7 @@ FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.4.1 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.4.2 ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.4.1 # Setup repositories for minimal packages (all versions) diff --git a/mysql-server/8.4/docker-entrypoint.sh b/mysql-server/8.4/docker-entrypoint.sh index 70886520f..3530409ab 100755 --- a/mysql-server/8.4/docker-entrypoint.sh +++ b/mysql-server/8.4/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.4.1-1.2.17-server" +echo "[Entrypoint] MySQL Docker Image 8.4.2-1.2.18-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.4.1-1.2.17-server" + echo "[Entrypoint] Starting MySQL 8.4.2-1.2.18-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/8.4/inspec/control.rb b/mysql-server/8.4/inspec/control.rb index efb23c936..9a542b3e4 100644 --- a/mysql-server/8.4/inspec/control.rb +++ b/mysql-server/8.4/inspec/control.rb @@ -11,7 +11,7 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.4.1.*' } + its ('version') { should match '8.4.2.*' } end describe package('mysql-shell') do it { should be_installed } diff --git a/mysql-server/9.0/Dockerfile b/mysql-server/9.0/Dockerfile index 475efe196..aabe73b7e 100644 --- a/mysql-server/9.0/Dockerfile +++ b/mysql-server/9.0/Dockerfile @@ -15,8 +15,8 @@ FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-9.0.0 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-9.0.0 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-9.0.1 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-9.0.1 # Setup repositories for minimal packages (all versions) RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ diff --git a/mysql-server/9.0/docker-entrypoint.sh b/mysql-server/9.0/docker-entrypoint.sh index 565b7458d..94029c497 100755 --- a/mysql-server/9.0/docker-entrypoint.sh +++ b/mysql-server/9.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 9.0.0-1.2.17-server" +echo "[Entrypoint] MySQL Docker Image 9.0.1-1.2.18-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 9.0.0-1.2.17-server" + echo "[Entrypoint] Starting MySQL 9.0.1-1.2.18-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/9.0/inspec/control.rb b/mysql-server/9.0/inspec/control.rb index 87bf00a16..0047b2116 100644 --- a/mysql-server/9.0/inspec/control.rb +++ b/mysql-server/9.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '9.0.0.*' } + its ('version') { should match '9.0.1.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '9.0.0.*' } + its ('version') { should match '9.0.1.*' } end end From e30d830b4df5ad9fe8a5e45f73fc18d515183d41 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Tue, 23 Jul 2024 06:04:37 +0000 Subject: [PATCH 353/386] Release version 1.0.18-router * ET#81988: Bump versions for July OOC 8.0.39/8.4.2/9.0.1 Docker releases --- mysql-router/8.0/Dockerfile | 4 ++-- mysql-router/8.0/inspec/control.rb | 4 ++-- mysql-router/8.4/Dockerfile | 4 ++-- mysql-router/8.4/inspec/control.rb | 4 ++-- mysql-router/9.0/Dockerfile | 4 ++-- mysql-router/9.0/inspec/control.rb | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/mysql-router/8.0/Dockerfile b/mysql-router/8.0/Dockerfile index c4acab024..32b227da4 100644 --- a/mysql-router/8.0/Dockerfile +++ b/mysql-router/8.0/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.38 -ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.38 +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.39 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.39 ARG CONFIG_PACKAGE_NAME=mysql84-community-release-el9.rpm ARG REPO_NAME_SERVER=mysql80-community ARG REPO_NAME_TOOLS=mysql-tools-community diff --git a/mysql-router/8.0/inspec/control.rb b/mysql-router/8.0/inspec/control.rb index 9f6dbdd69..710194fb7 100644 --- a/mysql-router/8.0/inspec/control.rb +++ b/mysql-router/8.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-client') do it { should be_installed } - its ('version') { should match '8.0.38.*' } + its ('version') { should match '8.0.39.*' } end describe package('mysql-router-community') do it { should be_installed } - its ('version') { should match '8.0.38.*' } + its ('version') { should match '8.0.39.*' } end end diff --git a/mysql-router/8.4/Dockerfile b/mysql-router/8.4/Dockerfile index ec8382619..563935102 100644 --- a/mysql-router/8.4/Dockerfile +++ b/mysql-router/8.4/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.4.1 -ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.4.1 +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.4.2 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.4.2 ARG CONFIG_PACKAGE_NAME=mysql84-community-release-el9.rpm ARG REPO_NAME_SERVER=mysql-8.4-lts-community ARG REPO_NAME_TOOLS=mysql-tools-8.4-lts-community diff --git a/mysql-router/8.4/inspec/control.rb b/mysql-router/8.4/inspec/control.rb index 2e5b29f85..f9282fd34 100644 --- a/mysql-router/8.4/inspec/control.rb +++ b/mysql-router/8.4/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-client') do it { should be_installed } - its ('version') { should match '8.4.1.*' } + its ('version') { should match '8.4.2.*' } end describe package('mysql-router-community') do it { should be_installed } - its ('version') { should match '8.4.1.*' } + its ('version') { should match '8.4.2.*' } end end diff --git a/mysql-router/9.0/Dockerfile b/mysql-router/9.0/Dockerfile index ace89c2e1..50c541c6e 100644 --- a/mysql-router/9.0/Dockerfile +++ b/mysql-router/9.0/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-9.0.0 -ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-9.0.0 +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-9.0.1 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-9.0.1 ARG CONFIG_PACKAGE_NAME=mysql84-community-release-el9.rpm ARG REPO_NAME_SERVER=mysql-innovation-community ARG REPO_NAME_TOOLS=mysql-tools-innovation-community diff --git a/mysql-router/9.0/inspec/control.rb b/mysql-router/9.0/inspec/control.rb index d9474739d..6ff21399b 100644 --- a/mysql-router/9.0/inspec/control.rb +++ b/mysql-router/9.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-client') do it { should be_installed } - its ('version') { should match '9.0.0.*' } + its ('version') { should match '9.0.1.*' } end describe package('mysql-router-community') do it { should be_installed } - its ('version') { should match '9.0.0.*' } + its ('version') { should match '9.0.1.*' } end end From 28c8640d20c26cb4993ba8ec23c451a2b3805a68 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Tue, 23 Jul 2024 06:41:41 +0000 Subject: [PATCH 354/386] Release version 1.2.18-cluster * ET#81988: Bump versions for July OOC 8.0.39/8.4.2/9.0.1 Docker releases --- mysql-cluster/8.0/Dockerfile | 2 +- mysql-cluster/8.0/docker-entrypoint.sh | 4 ++-- mysql-cluster/8.0/inspec/control.rb | 2 +- mysql-cluster/8.4/Dockerfile | 2 +- mysql-cluster/8.4/docker-entrypoint.sh | 4 ++-- mysql-cluster/8.4/inspec/control.rb | 2 +- mysql-cluster/9.0/Dockerfile | 4 ++-- mysql-cluster/9.0/inspec/control.rb | 4 ++-- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/mysql-cluster/8.0/Dockerfile b/mysql-cluster/8.0/Dockerfile index 9d80d9fa2..68c2705a6 100644 --- a/mysql-cluster/8.0/Dockerfile +++ b/mysql-cluster/8.0/Dockerfile @@ -15,7 +15,7 @@ FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.0.38 +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.0.39 ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.38 # Setup repositories for minimal packages (all versions) diff --git a/mysql-cluster/8.0/docker-entrypoint.sh b/mysql-cluster/8.0/docker-entrypoint.sh index ae765bd34..632370458 100755 --- a/mysql-cluster/8.0/docker-entrypoint.sh +++ b/mysql-cluster/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.38-1.2.17-cluster" +echo "[Entrypoint] MySQL Docker Image 8.0.39-1.2.18-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -227,7 +227,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.38-1.2.17-cluster" + echo "[Entrypoint] Starting MySQL 8.0.39-1.2.18-cluster" fi export MYSQLD_PARENT_PID=$$ ; exec "$@" --user= else diff --git a/mysql-cluster/8.0/inspec/control.rb b/mysql-cluster/8.0/inspec/control.rb index 118ce1134..a9fb05a04 100644 --- a/mysql-cluster/8.0/inspec/control.rb +++ b/mysql-cluster/8.0/inspec/control.rb @@ -11,7 +11,7 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.38.*' } + its ('version') { should match '8.0.39.*' } end describe package('mysql-shell') do it { should be_installed } diff --git a/mysql-cluster/8.4/Dockerfile b/mysql-cluster/8.4/Dockerfile index bcb4dc884..b0d9534f1 100644 --- a/mysql-cluster/8.4/Dockerfile +++ b/mysql-cluster/8.4/Dockerfile @@ -15,7 +15,7 @@ FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.4.1 +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.4.2 ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.4.1 # Setup repositories for minimal packages (all versions) diff --git a/mysql-cluster/8.4/docker-entrypoint.sh b/mysql-cluster/8.4/docker-entrypoint.sh index 6e8b9831f..507394121 100755 --- a/mysql-cluster/8.4/docker-entrypoint.sh +++ b/mysql-cluster/8.4/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.4.1-1.2.17-cluster" +echo "[Entrypoint] MySQL Docker Image 8.4.2-1.2.18-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -227,7 +227,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.4.1-1.2.17-cluster" + echo "[Entrypoint] Starting MySQL 8.4.2-1.2.18-cluster" fi export MYSQLD_PARENT_PID=$$ ; exec "$@" --user= else diff --git a/mysql-cluster/8.4/inspec/control.rb b/mysql-cluster/8.4/inspec/control.rb index a930d1549..68fa7f3ee 100644 --- a/mysql-cluster/8.4/inspec/control.rb +++ b/mysql-cluster/8.4/inspec/control.rb @@ -11,7 +11,7 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.4.1.*' } + its ('version') { should match '8.4.2.*' } end describe package('mysql-shell') do it { should be_installed } diff --git a/mysql-cluster/9.0/Dockerfile b/mysql-cluster/9.0/Dockerfile index 2e72ccab8..51c560859 100644 --- a/mysql-cluster/9.0/Dockerfile +++ b/mysql-cluster/9.0/Dockerfile @@ -15,8 +15,8 @@ FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-9.0.0 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-9.0.0 +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-9.0.1 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-9.0.1 # Setup repositories for minimal packages (all versions) RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-cluster-community-minimal-release-el9.rpm \ diff --git a/mysql-cluster/9.0/inspec/control.rb b/mysql-cluster/9.0/inspec/control.rb index 9456354ed..13fd76165 100644 --- a/mysql-cluster/9.0/inspec/control.rb +++ b/mysql-cluster/9.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '9.0.0.*' } + its ('version') { should match '9.0.1.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '9.0.0.*' } + its ('version') { should match '9.0.1.*' } end end From ea79f981ae5954e1962eeb03963f278810426227 Mon Sep 17 00:00:00 2001 From: Gipson Pulla Date: Thu, 25 Jul 2024 08:35:45 +0530 Subject: [PATCH 355/386] ET#82116 container images are wrong version for 8.0 and 8.4 Updating the weekly server/shell versions for 8.0/8.4 Change-Id: If22ec7cf8e16b11fd9134d70753b187be64d7501 --- mysql-server/VERSION | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-server/VERSION b/mysql-server/VERSION index 3f3fefa25..5604c2360 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -29,8 +29,8 @@ MYSQL_SERVER_VERSIONS["8.0"]=8.0.39 MYSQL_SERVER_VERSIONS["8.4"]=8.4.2 MYSQL_SERVER_VERSIONS["innovation"]=9.0.1 -WEEKLY_SERVER_VERSIONS["8.0"]=8.0.39 -WEEKLY_SERVER_VERSIONS["8.4"]=8.4.2 +WEEKLY_SERVER_VERSIONS["8.0"]=8.0.40 +WEEKLY_SERVER_VERSIONS["8.4"]=8.4.3 WEEKLY_SERVER_VERSIONS["innovation"]=9.1.0 declare -A MYSQL_SHELL_VERSIONS WEEKLY_SHELL_VERSIONS @@ -38,6 +38,6 @@ MYSQL_SHELL_VERSIONS["8.0"]=8.0.38 MYSQL_SHELL_VERSIONS["8.4"]=8.4.1 MYSQL_SHELL_VERSIONS["innovation"]=9.0.1 -WEEKLY_SHELL_VERSIONS["8.0"]=8.0.39 -WEEKLY_SHELL_VERSIONS["8.4"]=8.4.2 +WEEKLY_SHELL_VERSIONS["8.0"]=8.0.40 +WEEKLY_SHELL_VERSIONS["8.4"]=8.4.3 WEEKLY_SHELL_VERSIONS["innovation"]=9.1.0 From ea800da4936136c5e3e3f4ed68a9e0bb5fe6d136 Mon Sep 17 00:00:00 2001 From: Gipson Pulla Date: Thu, 25 Jul 2024 22:25:31 +0530 Subject: [PATCH 356/386] follow-up ET#82116 container images are wrong version for 8.0 and 8.4 Updating the router versions Change-Id: Ib7dc3ca1705b08377e98088994e254c56535d9e2 --- mysql-router/VERSION | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-router/VERSION b/mysql-router/VERSION index 7d004ea02..a92464671 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -29,8 +29,8 @@ MYSQL_ROUTER_VERSIONS["8.0"]=8.0.39 MYSQL_ROUTER_VERSIONS["8.4"]=8.4.2 MYSQL_ROUTER_VERSIONS["innovation"]=9.0.1 -WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.39 -WEEKLY_ROUTER_VERSIONS["8.4"]=8.4.2 +WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.40 +WEEKLY_ROUTER_VERSIONS["8.4"]=8.4.3 WEEKLY_ROUTER_VERSIONS["innovation"]=9.1.0 declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS @@ -38,6 +38,6 @@ MYSQL_SERVER_VERSIONS["8.0"]=8.0.39 MYSQL_SERVER_VERSIONS["8.4"]=8.4.2 MYSQL_SERVER_VERSIONS["innovation"]=9.0.1 -WEEKLY_SERVER_VERSIONS["8.0"]=8.0.39 -WEEKLY_SERVER_VERSIONS["8.4"]=8.4.2 +WEEKLY_SERVER_VERSIONS["8.0"]=8.0.40 +WEEKLY_SERVER_VERSIONS["8.4"]=8.4.3 WEEKLY_SERVER_VERSIONS["innovation"]=9.1.0 From d0c51d5da9608d9bd326972c9cc16c9478dc1698 Mon Sep 17 00:00:00 2001 From: Gipson Pulla Date: Tue, 10 Sep 2024 23:42:56 +0530 Subject: [PATCH 357/386] ET#82573 please create 9.2 container images Updating the weekly-trunk-server/router/shell versions for internal docker build Change-Id: Ide3679e0c97b758bd85899e966d28619e5c114b2 --- mysql-router/VERSION | 4 ++-- mysql-server/VERSION | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-router/VERSION b/mysql-router/VERSION index a92464671..b3c18054e 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -31,7 +31,7 @@ MYSQL_ROUTER_VERSIONS["innovation"]=9.0.1 WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.40 WEEKLY_ROUTER_VERSIONS["8.4"]=8.4.3 -WEEKLY_ROUTER_VERSIONS["innovation"]=9.1.0 +WEEKLY_ROUTER_VERSIONS["innovation"]=9.2.0 declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["8.0"]=8.0.39 @@ -40,4 +40,4 @@ MYSQL_SERVER_VERSIONS["innovation"]=9.0.1 WEEKLY_SERVER_VERSIONS["8.0"]=8.0.40 WEEKLY_SERVER_VERSIONS["8.4"]=8.4.3 -WEEKLY_SERVER_VERSIONS["innovation"]=9.1.0 +WEEKLY_SERVER_VERSIONS["innovation"]=9.2.0 diff --git a/mysql-server/VERSION b/mysql-server/VERSION index 5604c2360..7b7964033 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -31,7 +31,7 @@ MYSQL_SERVER_VERSIONS["innovation"]=9.0.1 WEEKLY_SERVER_VERSIONS["8.0"]=8.0.40 WEEKLY_SERVER_VERSIONS["8.4"]=8.4.3 -WEEKLY_SERVER_VERSIONS["innovation"]=9.1.0 +WEEKLY_SERVER_VERSIONS["innovation"]=9.2.0 declare -A MYSQL_SHELL_VERSIONS WEEKLY_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["8.0"]=8.0.38 @@ -40,4 +40,4 @@ MYSQL_SHELL_VERSIONS["innovation"]=9.0.1 WEEKLY_SHELL_VERSIONS["8.0"]=8.0.40 WEEKLY_SHELL_VERSIONS["8.4"]=8.4.3 -WEEKLY_SHELL_VERSIONS["innovation"]=9.1.0 +WEEKLY_SHELL_VERSIONS["innovation"]=9.2.0 From 35b355c8289dae202b81ed32a3a38a63abc0111f Mon Sep 17 00:00:00 2001 From: Karen Langford Date: Wed, 18 Sep 2024 05:26:24 +0200 Subject: [PATCH 358/386] ET#82635: Bump versions for October 8.0.40/8.4.3/9.1.0 Docker releases Change-Id: Iacac004d666a284cbbac4625416f0d5b3b5fa3d4 --- mysql-cluster/VERSION | 14 +++++++------- mysql-router/VERSION | 14 +++++++------- mysql-server/VERSION | 14 +++++++------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/mysql-cluster/VERSION b/mysql-cluster/VERSION index 7cf062160..48a2ce631 100644 --- a/mysql-cluster/VERSION +++ b/mysql-cluster/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.2.18-cluster +IMAGE_VERSION=1.2.19-cluster # LATEST is always set to the # current highest release, which is, @@ -25,14 +25,14 @@ LATEST_LTS="8.4" # like 'latest-8.4' or 'lts-84', etch declare -A MYSQL_CLUSTER_VERSIONS -MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.39 -MYSQL_CLUSTER_VERSIONS["8.4"]=8.4.2 -MYSQL_CLUSTER_VERSIONS["innovation"]=9.0.1 +MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.40 +MYSQL_CLUSTER_VERSIONS["8.4"]=8.4.3 +MYSQL_CLUSTER_VERSIONS["innovation"]=9.1.0 declare -A MYSQL_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["8.0"]=8.0.38 -MYSQL_SHELL_VERSIONS["8.4"]=8.4.1 -MYSQL_SHELL_VERSIONS["innovation"]=9.0.1 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.40 +MYSQL_SHELL_VERSIONS["8.4"]=8.4.3 +MYSQL_SHELL_VERSIONS["innovation"]=9.1.0 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["8.0"]="${MYSQL_CLUSTER_VERSIONS["8.0"]}-${IMAGE_VERSION}" diff --git a/mysql-router/VERSION b/mysql-router/VERSION index b3c18054e..c9acfae9e 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.0.18-router +IMAGE_VERSION=1.0.19-router # LATEST is always set to the # current highest release, which is, @@ -25,18 +25,18 @@ LATEST_LTS="8.4" # like 'latest-8.4' or 'lts-84', etch declare -A MYSQL_ROUTER_VERSIONS WEEKLY_ROUTER_VERSIONS -MYSQL_ROUTER_VERSIONS["8.0"]=8.0.39 -MYSQL_ROUTER_VERSIONS["8.4"]=8.4.2 -MYSQL_ROUTER_VERSIONS["innovation"]=9.0.1 +MYSQL_ROUTER_VERSIONS["8.0"]=8.0.40 +MYSQL_ROUTER_VERSIONS["8.4"]=8.4.3 +MYSQL_ROUTER_VERSIONS["innovation"]=9.1.0 WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.40 WEEKLY_ROUTER_VERSIONS["8.4"]=8.4.3 WEEKLY_ROUTER_VERSIONS["innovation"]=9.2.0 declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["8.0"]=8.0.39 -MYSQL_SERVER_VERSIONS["8.4"]=8.4.2 -MYSQL_SERVER_VERSIONS["innovation"]=9.0.1 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.40 +MYSQL_SERVER_VERSIONS["8.4"]=8.4.3 +MYSQL_SERVER_VERSIONS["innovation"]=9.1.0 WEEKLY_SERVER_VERSIONS["8.0"]=8.0.40 WEEKLY_SERVER_VERSIONS["8.4"]=8.4.3 diff --git a/mysql-server/VERSION b/mysql-server/VERSION index 7b7964033..5e57a7082 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.2.18-server +IMAGE_VERSION=1.2.19-server # LATEST is always set to the # current highest release, which is, @@ -25,18 +25,18 @@ LATEST_LTS="8.4" # like 'latest-8.4' or 'lts-84', etc. declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["8.0"]=8.0.39 -MYSQL_SERVER_VERSIONS["8.4"]=8.4.2 -MYSQL_SERVER_VERSIONS["innovation"]=9.0.1 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.40 +MYSQL_SERVER_VERSIONS["8.4"]=8.4.3 +MYSQL_SERVER_VERSIONS["innovation"]=9.1.0 WEEKLY_SERVER_VERSIONS["8.0"]=8.0.40 WEEKLY_SERVER_VERSIONS["8.4"]=8.4.3 WEEKLY_SERVER_VERSIONS["innovation"]=9.2.0 declare -A MYSQL_SHELL_VERSIONS WEEKLY_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["8.0"]=8.0.38 -MYSQL_SHELL_VERSIONS["8.4"]=8.4.1 -MYSQL_SHELL_VERSIONS["innovation"]=9.0.1 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.40 +MYSQL_SHELL_VERSIONS["8.4"]=8.4.3 +MYSQL_SHELL_VERSIONS["innovation"]=9.1.0 WEEKLY_SHELL_VERSIONS["8.0"]=8.0.40 WEEKLY_SHELL_VERSIONS["8.4"]=8.4.3 From 12718136620faf00f81aa1f844c95d715755a63a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Schl=C3=BCter?= Date: Mon, 17 Jun 2024 16:43:55 +0200 Subject: [PATCH 359/386] Fix Bug#36740567 - MySQL Router Container should accept credentials via file This adds two new environment variables: - MYSQL_USER_FILE - MYSQL_PASSWORD_FILE These can be used to provide credentials from a credential store Change-Id: I83bc736888e4ec132964eb10ee1b81cc93cc937e --- mysql-router/template/run.sh | 54 +++++++++++++++++++++++++++--------- 1 file changed, 41 insertions(+), 13 deletions(-) diff --git a/mysql-router/template/run.sh b/mysql-router/template/run.sh index f806c1afe..79bb35080 100755 --- a/mysql-router/template/run.sh +++ b/mysql-router/template/run.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2018, 2021, Oracle and/or its affiliates. +# Copyright (c) 2018, 2024, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,16 +15,20 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e +if [[ -n $MYSQL_USER_FILE && -f $MYSQL_USER_FILE ]]; then + MYSQL_USER=$(cat $MYSQL_USER_FILE) +fi + if [ "$1" = 'mysqlrouter' ]; then - if [[ -z $MYSQL_HOST || -z $MYSQL_PORT || -z $MYSQL_USER || -z $MYSQL_PASSWORD ]]; then + if [[ -z $MYSQL_HOST || -z $MYSQL_PORT || -z $MYSQL_USER || (-z $MYSQL_PASSWORD && -z $MYSQL_PASSWORD_FILE) ]]; then echo "We require all of" echo " MYSQL_HOST" echo " MYSQL_PORT" - echo " MYSQL_USER" - echo " MYSQL_PASSWORD" + echo " MYSQL_USER or MYSQL_USER_FILE" + echo " MYSQL_PASSWORD or MYSQL_PASSWORD_FILE" echo "to be set." echo "In addition you can set" - echo " MYSQL_INNODB_CLUSTER_MEMBERS " + echo " MYSQL_INNODB_CLUSTER_MEMBERS" echo " MYSQL_CREATE_ROUTER_USER" echo " MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS" echo "Exiting." @@ -32,25 +36,49 @@ if [ "$1" = 'mysqlrouter' ]; then fi PASSFILE=$(mktemp) - echo "$MYSQL_PASSWORD" > "$PASSFILE" + if [[ -n $MYSQL_PASSWORD_FILE && -f "$MYSQL_PASSWORD_FILE" ]]; then + cat "$MYSQL_PASSWORD_FILE" > "$PASSFILE" + echo "" >> "$PASSFILE" + else + echo "$MYSQL_PASSWORD" > "$PASSFILE" + fi if [ -z $MYSQL_CREATE_ROUTER_USER ]; then - echo "$MYSQL_PASSWORD" >> "$PASSFILE" + if [[ -n $MYSQL_PASSWORD_FILE && -f "$MYSQL_PASSWORD_FILE" ]]; then + cat "$MYSQL_PASSWORD_FILE" >> "$PASSFILE" + echo "" >> "$PASSFILE" + else + echo "$MYSQL_PASSWORD" >> "$PASSFILE" + fi MYSQL_CREATE_ROUTER_USER=1 echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is not set, Router will generate a new account to be used at runtime." echo "[Entrypoint] Set it to 0 to reuse $MYSQL_USER instead." elif [ "$MYSQL_CREATE_ROUTER_USER" = "0" ]; then - echo "$MYSQL_PASSWORD" >> "$PASSFILE" + if [[ -n $MYSQL_PASSWORD_FILE && -f "$MYSQL_PASSWORD_FILE" ]]; then + cat "$MYSQL_PASSWORD_FILE" >> "$PASSFILE" + echo "" >> "$PASSFILE" + else + echo "$MYSQL_PASSWORD" >> "$PASSFILE" + fi echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is 0, Router will reuse $MYSQL_USER account at runtime" else echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is not 0, Router will generate a new account to be used at runtime" fi - DEFAULTS_EXTRA_FILE=$(mktemp) - cat >"$DEFAULTS_EXTRA_FILE" <"$DEFAULTS_EXTRA_FILE" <"$DEFAULTS_EXTRA_FILE" < "/dev/tcp/$MYSQL_HOST/$MYSQL_PORT") >/dev/null 2>&1; do @@ -89,13 +117,13 @@ EOF mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force $opt_user $MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS < "$PASSFILE" || exit 1 fi + rm "$DEFAULTS_EXTRA_FILE" + sed -i -e 's/logging_folder=.*$/logging_folder=/' /tmp/mysqlrouter/mysqlrouter.conf echo "[Entrypoint] Starting mysql-router." exec "$@" --config /tmp/mysqlrouter/mysqlrouter.conf - rm -f "$PASSFILE" - rm -f "$DEFAULTS_EXTRA_FILE" - unset DEFAULTS_EXTRA_FILE + rm $PASSFILE else exec "$@" fi From 7ed3627bd1e500e6aef68a979f34be0f61ffbfd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Schl=C3=BCter?= Date: Mon, 23 Sep 2024 13:33:39 +0200 Subject: [PATCH 360/386] Add README files Change-Id: I4b1fea951e234b4472c73597ef2efed4962f128f --- CONTRIBUTING.md | 18 ++++++++++++++++++ README.md | 5 +++++ SECURITY.md | 30 ++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 CONTRIBUTING.md create mode 100644 README.md create mode 100644 SECURITY.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..c561cd9f6 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,18 @@ +We welcome your code contributions. Before submitting code via a GitHub pull +request, or by filing a bug in https://bugs.mysql.com you will need to have +signed the Oracle Contributor Agreement (see https://oca.opensource.oracle.com). + +Only pull requests from committers that can be verified as having signed the OCA +can be accepted. + +Submitting a contribution +-------------------------- + +1. Make sure you have a user account at bugs.mysql.com. You'll need to reference this + user account when you submit your OCA (Oracle Contributor Agreement). +2. Sign the Oracle OCA. You can find instructions for doing that at the OCA Page, + at https://oca.opensource.oracle.com +3. Validate your contribution by including tests that sufficiently cover the functionality. +4. Verify that the entire test suite passes with your code applied. +5. Submit your pull request via GitHub or uploading it using the contribution tab to a bug + record in https://bugs.mysql.com (using the 'contribution' tab). diff --git a/README.md b/README.md new file mode 100644 index 000000000..93e29dd22 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# About This Repository + +This repository collects files and tools related to creating Container (Docker) images for different MySQL products. + +Please refer to the indvidual directories for information, including licenses, for the individual products. diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 000000000..e43f9fb4c --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,30 @@ +Reporting security vulnerabilities +==================== +Oracle values the independent security research community and believes that +responsible disclosure of security vulnerabilities helps us ensure the security +and privacy of all our users. + +Please do NOT raise a GitHub Issue to report a security vulnerability. If you +believe you have found a security vulnerability, please submit a report to +secalert_us@oracle.com preferably with a proof of concept. Please review +some additional information on how to report security vulnerabilities to Oracle +(see https://www.oracle.com/corporate/security-practices/assurance/vulnerability/reporting.html) +We encourage people who contact Oracle Security to use email encryption using +our encryption key (see https://www.oracle.com/security-alerts/encryptionkey.html) + +We ask that you do not use other channels or contact the project maintainers +directly. + +Security updates, alerts and bulletins +------------------------------------- +Security updates will be released on a regular cadence. Many of our projects +will typically release security fixes in conjunction with the Oracle Critical Patch +Update program. Additional information, including past advisories, is available on our +security alerts page at https://www.oracle.com/security-alerts/ + +Security-related information +---------------------------- +We will provide security related information such as a threat model, considerations +for secure use, or any known security issues in our documentation. Please note +that labs and sample code are intended to demonstrate a concept and may not be +sufficiently hardened for production use. From 91a9cd7b51e17e1acf950e25901894ad81fd9546 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Tue, 15 Oct 2024 07:00:04 +0000 Subject: [PATCH 361/386] Release version 1.2.19-server * ET#82635: Bump versions for October 8.0.40/8.4.3/9.1.0 Docker releases * ET#82573 please create 9.2 container images * ET#82116 container images are wrong version for 8.0 and 8.4 --- mysql-server/8.0/Dockerfile | 4 +- mysql-server/8.0/docker-entrypoint.sh | 4 +- mysql-server/8.0/inspec/control.rb | 4 +- mysql-server/8.4/Dockerfile | 4 +- mysql-server/8.4/docker-entrypoint.sh | 4 +- mysql-server/8.4/inspec/control.rb | 4 +- mysql-server/9.1/Dockerfile | 45 +++++ mysql-server/9.1/docker-entrypoint.sh | 230 ++++++++++++++++++++++++++ mysql-server/9.1/healthcheck.sh | 24 +++ mysql-server/9.1/inspec/control.rb | 20 +++ mysql-server/9.1/prepare-image.sh | 25 +++ 11 files changed, 356 insertions(+), 12 deletions(-) create mode 100644 mysql-server/9.1/Dockerfile create mode 100755 mysql-server/9.1/docker-entrypoint.sh create mode 100755 mysql-server/9.1/healthcheck.sh create mode 100644 mysql-server/9.1/inspec/control.rb create mode 100755 mysql-server/9.1/prepare-image.sh diff --git a/mysql-server/8.0/Dockerfile b/mysql-server/8.0/Dockerfile index 6b1c3a829..915a535d7 100644 --- a/mysql-server/8.0/Dockerfile +++ b/mysql-server/8.0/Dockerfile @@ -15,8 +15,8 @@ FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.39 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.38 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.40 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.40 # Setup repositories for minimal packages (all versions) RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ diff --git a/mysql-server/8.0/docker-entrypoint.sh b/mysql-server/8.0/docker-entrypoint.sh index 614172858..75980e3b8 100755 --- a/mysql-server/8.0/docker-entrypoint.sh +++ b/mysql-server/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.39-1.2.18-server" +echo "[Entrypoint] MySQL Docker Image 8.0.40-1.2.19-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.39-1.2.18-server" + echo "[Entrypoint] Starting MySQL 8.0.40-1.2.19-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/8.0/inspec/control.rb b/mysql-server/8.0/inspec/control.rb index d1c657f12..fd4b35038 100644 --- a/mysql-server/8.0/inspec/control.rb +++ b/mysql-server/8.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.39.*' } + its ('version') { should match '8.0.40.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.38.*' } + its ('version') { should match '8.0.40.*' } end end diff --git a/mysql-server/8.4/Dockerfile b/mysql-server/8.4/Dockerfile index f3d7ded2a..d274d5d74 100644 --- a/mysql-server/8.4/Dockerfile +++ b/mysql-server/8.4/Dockerfile @@ -15,8 +15,8 @@ FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.4.2 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.4.1 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.4.3 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.4.3 # Setup repositories for minimal packages (all versions) RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ diff --git a/mysql-server/8.4/docker-entrypoint.sh b/mysql-server/8.4/docker-entrypoint.sh index 3530409ab..577faa5fe 100755 --- a/mysql-server/8.4/docker-entrypoint.sh +++ b/mysql-server/8.4/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.4.2-1.2.18-server" +echo "[Entrypoint] MySQL Docker Image 8.4.3-1.2.19-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.4.2-1.2.18-server" + echo "[Entrypoint] Starting MySQL 8.4.3-1.2.19-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/8.4/inspec/control.rb b/mysql-server/8.4/inspec/control.rb index 9a542b3e4..c20ea957e 100644 --- a/mysql-server/8.4/inspec/control.rb +++ b/mysql-server/8.4/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.4.2.*' } + its ('version') { should match '8.4.3.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.4.1.*' } + its ('version') { should match '8.4.3.*' } end end diff --git a/mysql-server/9.1/Dockerfile b/mysql-server/9.1/Dockerfile new file mode 100644 index 000000000..2dd1c453b --- /dev/null +++ b/mysql-server/9.1/Dockerfile @@ -0,0 +1,45 @@ +# Copyright (c) 2017, 2023, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +FROM container-registry.oracle.com/os/oraclelinux:9-slim + +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-9.1.0 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-9.1.0 + +# Setup repositories for minimal packages (all versions) +RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ + && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm + +# Install server and shell 8.0 +RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ + && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --disablerepo=ol9_appstream \ + --enablerepo=mysql-innovation-community-minimal $MYSQL_SERVER_PACKAGE \ + && microdnf remove -y mysql-community-minimal-release mysql84-community-release \ + && microdnf clean all \ + && mkdir /docker-entrypoint-initdb.d + +COPY prepare-image.sh / +RUN /prepare-image.sh && rm -f /prepare-image.sh + +ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock + +COPY docker-entrypoint.sh /entrypoint.sh +COPY healthcheck.sh /healthcheck.sh +ENTRYPOINT ["/entrypoint.sh"] +HEALTHCHECK CMD /healthcheck.sh +EXPOSE 3306 33060 33061 +CMD ["mysqld"] + diff --git a/mysql-server/9.1/docker-entrypoint.sh b/mysql-server/9.1/docker-entrypoint.sh new file mode 100755 index 000000000..17ff28ef6 --- /dev/null +++ b/mysql-server/9.1/docker-entrypoint.sh @@ -0,0 +1,230 @@ +#!/bin/bash +# Copyright (c) 2017, 2021, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +echo "[Entrypoint] MySQL Docker Image 9.1.0-1.2.19-server" +# Fetch value from server config +# We use mysqld --verbose --help instead of my_print_defaults because the +# latter only show values present in config files, and not server defaults +_get_config() { + local conf="$1"; shift + "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' +} + +# Generate a random password +_mkpw() { + letter=$(cat /dev/urandom| tr -dc a-zA-Z | dd bs=1 count=16 2> /dev/null ) + number=$(cat /dev/urandom| tr -dc 0-9 | dd bs=1 count=8 2> /dev/null) + special=$(cat /dev/urandom| tr -dc '=+@#%^&*_.,;:?/' | dd bs=1 count=8 2> /dev/null) + + echo $letter$number$special | fold -w 1 | shuf | tr -d '\n' +} + +# If command starts with an option, prepend mysqld +# This allows users to add command-line options without +# needing to specify the "mysqld" command +if [ "${1:0:1}" = '-' ]; then + set -- mysqld "$@" +fi + +# Check if entrypoint (and the container) is running as root +if [ $(id -u) = "0" ]; then + is_root=1 + install_devnull="install /dev/null -m0600 -omysql -gmysql" + MYSQLD_USER=mysql +else + install_devnull="install /dev/null -m0600" + MYSQLD_USER=$(id -u) +fi + +if [ "$1" = 'mysqld' ]; then + # Test that the server can start. We redirect stdout to /dev/null so + # only the error messages are left. + result=0 + output=$("$@" --validate-config) || result=$? + if [ ! "$result" = "0" ]; then + echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' + echo >&2 "[Entrypoint] $output" + exit 1 + fi + + # Get config + DATADIR="$(_get_config 'datadir' "$@")" + SOCKET="$(_get_config 'socket' "$@")" + + if [ ! -d "$DATADIR/mysql" ]; then + # If the password variable is a filename we use the contents of the file. We + # read this first to make sure that a proper error is generated for empty files. + if [ -f "$MYSQL_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + if [ -z "$MYSQL_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' + exit 1 + fi + fi + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] No password option specified for new database.' + echo >&2 '[Entrypoint] A random onetime password will be generated.' + MYSQL_RANDOM_ROOT_PASSWORD=true + MYSQL_ONETIME_PASSWORD=true + fi + if [ ! -d "$DATADIR" ]; then + mkdir -p "$DATADIR" + chown mysql:mysql "$DATADIR" + fi + + # The user can set a default_timezone either in a my.cnf file + # they mount into the container or on command line + # (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`) + # however the timezone tables will only be populated in a later + # stage of this script. By using +00:00 as timezone we override + # the user's choice during initialization. Later the server + # will be restarted using the user's option. + + echo '[Entrypoint] Initializing database' + "$@" --user=$MYSQLD_USER --initialize-insecure --default-time-zone=+00:00 + + echo '[Entrypoint] Database initialized' + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" --default-time-zone=+00:00 + + # To avoid using password on commandline, put it in a temporary file. + # The file is only populated when and if the root password is set. + PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + $install_devnull "$PASSFILE" + # Define the client command used throughout the script + # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") + + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break + fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 + fi + + mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql + + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(_mkpw)" + echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + fi + if [ -z "$MYSQL_ROOT_HOST" ]; then + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';" + else + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ + GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + fi + "${mysql[@]}" <<-EOSQL + DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; + ${ROOTCREATE} + FLUSH PRIVILEGES ; + EOSQL + if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then + # Put the password into the temporary config file + cat >"$PASSFILE" < "$SQL" +ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL + fi + + echo + echo '[Entrypoint] MySQL init process done. Ready for start up.' + echo + fi + + # Used by healthcheck to make sure it doesn't mistakenly report container + # healthy during startup + # Put the password into the temporary config file + touch /var/lib/mysql-files/healthcheck.cnf + cat >"/var/lib/mysql-files/healthcheck.cnf" < Date: Tue, 15 Oct 2024 07:30:18 +0000 Subject: [PATCH 362/386] Release version 1.0.19-router * Fix Bug#36740567 - MySQL Router Container should accept credentials via file * ET#82635: Bump versions for October 8.0.40/8.4.3/9.1.0 Docker releases * ET#82573 please create 9.2 container images * follow-up ET#82116 container images are wrong version for 8.0 and 8.4 --- mysql-router/8.0/Dockerfile | 4 +- mysql-router/8.0/inspec/control.rb | 4 +- mysql-router/8.0/run.sh | 54 +++++++++--- mysql-router/8.4/Dockerfile | 4 +- mysql-router/8.4/inspec/control.rb | 4 +- mysql-router/8.4/run.sh | 54 +++++++++--- mysql-router/9.1/Dockerfile | 39 +++++++++ mysql-router/9.1/README.md | 88 ++++++++++++++++++++ mysql-router/9.1/inspec/control.rb | 20 +++++ mysql-router/9.1/run.sh | 129 +++++++++++++++++++++++++++++ 10 files changed, 366 insertions(+), 34 deletions(-) create mode 100644 mysql-router/9.1/Dockerfile create mode 100644 mysql-router/9.1/README.md create mode 100644 mysql-router/9.1/inspec/control.rb create mode 100755 mysql-router/9.1/run.sh diff --git a/mysql-router/8.0/Dockerfile b/mysql-router/8.0/Dockerfile index 32b227da4..5e5c0f88b 100644 --- a/mysql-router/8.0/Dockerfile +++ b/mysql-router/8.0/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.39 -ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.39 +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.40 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.40 ARG CONFIG_PACKAGE_NAME=mysql84-community-release-el9.rpm ARG REPO_NAME_SERVER=mysql80-community ARG REPO_NAME_TOOLS=mysql-tools-community diff --git a/mysql-router/8.0/inspec/control.rb b/mysql-router/8.0/inspec/control.rb index 710194fb7..1cac045d6 100644 --- a/mysql-router/8.0/inspec/control.rb +++ b/mysql-router/8.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-client') do it { should be_installed } - its ('version') { should match '8.0.39.*' } + its ('version') { should match '8.0.40.*' } end describe package('mysql-router-community') do it { should be_installed } - its ('version') { should match '8.0.39.*' } + its ('version') { should match '8.0.40.*' } end end diff --git a/mysql-router/8.0/run.sh b/mysql-router/8.0/run.sh index f806c1afe..79bb35080 100755 --- a/mysql-router/8.0/run.sh +++ b/mysql-router/8.0/run.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2018, 2021, Oracle and/or its affiliates. +# Copyright (c) 2018, 2024, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,16 +15,20 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e +if [[ -n $MYSQL_USER_FILE && -f $MYSQL_USER_FILE ]]; then + MYSQL_USER=$(cat $MYSQL_USER_FILE) +fi + if [ "$1" = 'mysqlrouter' ]; then - if [[ -z $MYSQL_HOST || -z $MYSQL_PORT || -z $MYSQL_USER || -z $MYSQL_PASSWORD ]]; then + if [[ -z $MYSQL_HOST || -z $MYSQL_PORT || -z $MYSQL_USER || (-z $MYSQL_PASSWORD && -z $MYSQL_PASSWORD_FILE) ]]; then echo "We require all of" echo " MYSQL_HOST" echo " MYSQL_PORT" - echo " MYSQL_USER" - echo " MYSQL_PASSWORD" + echo " MYSQL_USER or MYSQL_USER_FILE" + echo " MYSQL_PASSWORD or MYSQL_PASSWORD_FILE" echo "to be set." echo "In addition you can set" - echo " MYSQL_INNODB_CLUSTER_MEMBERS " + echo " MYSQL_INNODB_CLUSTER_MEMBERS" echo " MYSQL_CREATE_ROUTER_USER" echo " MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS" echo "Exiting." @@ -32,25 +36,49 @@ if [ "$1" = 'mysqlrouter' ]; then fi PASSFILE=$(mktemp) - echo "$MYSQL_PASSWORD" > "$PASSFILE" + if [[ -n $MYSQL_PASSWORD_FILE && -f "$MYSQL_PASSWORD_FILE" ]]; then + cat "$MYSQL_PASSWORD_FILE" > "$PASSFILE" + echo "" >> "$PASSFILE" + else + echo "$MYSQL_PASSWORD" > "$PASSFILE" + fi if [ -z $MYSQL_CREATE_ROUTER_USER ]; then - echo "$MYSQL_PASSWORD" >> "$PASSFILE" + if [[ -n $MYSQL_PASSWORD_FILE && -f "$MYSQL_PASSWORD_FILE" ]]; then + cat "$MYSQL_PASSWORD_FILE" >> "$PASSFILE" + echo "" >> "$PASSFILE" + else + echo "$MYSQL_PASSWORD" >> "$PASSFILE" + fi MYSQL_CREATE_ROUTER_USER=1 echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is not set, Router will generate a new account to be used at runtime." echo "[Entrypoint] Set it to 0 to reuse $MYSQL_USER instead." elif [ "$MYSQL_CREATE_ROUTER_USER" = "0" ]; then - echo "$MYSQL_PASSWORD" >> "$PASSFILE" + if [[ -n $MYSQL_PASSWORD_FILE && -f "$MYSQL_PASSWORD_FILE" ]]; then + cat "$MYSQL_PASSWORD_FILE" >> "$PASSFILE" + echo "" >> "$PASSFILE" + else + echo "$MYSQL_PASSWORD" >> "$PASSFILE" + fi echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is 0, Router will reuse $MYSQL_USER account at runtime" else echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is not 0, Router will generate a new account to be used at runtime" fi - DEFAULTS_EXTRA_FILE=$(mktemp) - cat >"$DEFAULTS_EXTRA_FILE" <"$DEFAULTS_EXTRA_FILE" <"$DEFAULTS_EXTRA_FILE" < "/dev/tcp/$MYSQL_HOST/$MYSQL_PORT") >/dev/null 2>&1; do @@ -89,13 +117,13 @@ EOF mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force $opt_user $MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS < "$PASSFILE" || exit 1 fi + rm "$DEFAULTS_EXTRA_FILE" + sed -i -e 's/logging_folder=.*$/logging_folder=/' /tmp/mysqlrouter/mysqlrouter.conf echo "[Entrypoint] Starting mysql-router." exec "$@" --config /tmp/mysqlrouter/mysqlrouter.conf - rm -f "$PASSFILE" - rm -f "$DEFAULTS_EXTRA_FILE" - unset DEFAULTS_EXTRA_FILE + rm $PASSFILE else exec "$@" fi diff --git a/mysql-router/8.4/Dockerfile b/mysql-router/8.4/Dockerfile index 563935102..f3b8be235 100644 --- a/mysql-router/8.4/Dockerfile +++ b/mysql-router/8.4/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.4.2 -ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.4.2 +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.4.3 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.4.3 ARG CONFIG_PACKAGE_NAME=mysql84-community-release-el9.rpm ARG REPO_NAME_SERVER=mysql-8.4-lts-community ARG REPO_NAME_TOOLS=mysql-tools-8.4-lts-community diff --git a/mysql-router/8.4/inspec/control.rb b/mysql-router/8.4/inspec/control.rb index f9282fd34..a2c1fee05 100644 --- a/mysql-router/8.4/inspec/control.rb +++ b/mysql-router/8.4/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-client') do it { should be_installed } - its ('version') { should match '8.4.2.*' } + its ('version') { should match '8.4.3.*' } end describe package('mysql-router-community') do it { should be_installed } - its ('version') { should match '8.4.2.*' } + its ('version') { should match '8.4.3.*' } end end diff --git a/mysql-router/8.4/run.sh b/mysql-router/8.4/run.sh index f806c1afe..79bb35080 100755 --- a/mysql-router/8.4/run.sh +++ b/mysql-router/8.4/run.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2018, 2021, Oracle and/or its affiliates. +# Copyright (c) 2018, 2024, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,16 +15,20 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e +if [[ -n $MYSQL_USER_FILE && -f $MYSQL_USER_FILE ]]; then + MYSQL_USER=$(cat $MYSQL_USER_FILE) +fi + if [ "$1" = 'mysqlrouter' ]; then - if [[ -z $MYSQL_HOST || -z $MYSQL_PORT || -z $MYSQL_USER || -z $MYSQL_PASSWORD ]]; then + if [[ -z $MYSQL_HOST || -z $MYSQL_PORT || -z $MYSQL_USER || (-z $MYSQL_PASSWORD && -z $MYSQL_PASSWORD_FILE) ]]; then echo "We require all of" echo " MYSQL_HOST" echo " MYSQL_PORT" - echo " MYSQL_USER" - echo " MYSQL_PASSWORD" + echo " MYSQL_USER or MYSQL_USER_FILE" + echo " MYSQL_PASSWORD or MYSQL_PASSWORD_FILE" echo "to be set." echo "In addition you can set" - echo " MYSQL_INNODB_CLUSTER_MEMBERS " + echo " MYSQL_INNODB_CLUSTER_MEMBERS" echo " MYSQL_CREATE_ROUTER_USER" echo " MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS" echo "Exiting." @@ -32,25 +36,49 @@ if [ "$1" = 'mysqlrouter' ]; then fi PASSFILE=$(mktemp) - echo "$MYSQL_PASSWORD" > "$PASSFILE" + if [[ -n $MYSQL_PASSWORD_FILE && -f "$MYSQL_PASSWORD_FILE" ]]; then + cat "$MYSQL_PASSWORD_FILE" > "$PASSFILE" + echo "" >> "$PASSFILE" + else + echo "$MYSQL_PASSWORD" > "$PASSFILE" + fi if [ -z $MYSQL_CREATE_ROUTER_USER ]; then - echo "$MYSQL_PASSWORD" >> "$PASSFILE" + if [[ -n $MYSQL_PASSWORD_FILE && -f "$MYSQL_PASSWORD_FILE" ]]; then + cat "$MYSQL_PASSWORD_FILE" >> "$PASSFILE" + echo "" >> "$PASSFILE" + else + echo "$MYSQL_PASSWORD" >> "$PASSFILE" + fi MYSQL_CREATE_ROUTER_USER=1 echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is not set, Router will generate a new account to be used at runtime." echo "[Entrypoint] Set it to 0 to reuse $MYSQL_USER instead." elif [ "$MYSQL_CREATE_ROUTER_USER" = "0" ]; then - echo "$MYSQL_PASSWORD" >> "$PASSFILE" + if [[ -n $MYSQL_PASSWORD_FILE && -f "$MYSQL_PASSWORD_FILE" ]]; then + cat "$MYSQL_PASSWORD_FILE" >> "$PASSFILE" + echo "" >> "$PASSFILE" + else + echo "$MYSQL_PASSWORD" >> "$PASSFILE" + fi echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is 0, Router will reuse $MYSQL_USER account at runtime" else echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is not 0, Router will generate a new account to be used at runtime" fi - DEFAULTS_EXTRA_FILE=$(mktemp) - cat >"$DEFAULTS_EXTRA_FILE" <"$DEFAULTS_EXTRA_FILE" <"$DEFAULTS_EXTRA_FILE" < "/dev/tcp/$MYSQL_HOST/$MYSQL_PORT") >/dev/null 2>&1; do @@ -89,13 +117,13 @@ EOF mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force $opt_user $MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS < "$PASSFILE" || exit 1 fi + rm "$DEFAULTS_EXTRA_FILE" + sed -i -e 's/logging_folder=.*$/logging_folder=/' /tmp/mysqlrouter/mysqlrouter.conf echo "[Entrypoint] Starting mysql-router." exec "$@" --config /tmp/mysqlrouter/mysqlrouter.conf - rm -f "$PASSFILE" - rm -f "$DEFAULTS_EXTRA_FILE" - unset DEFAULTS_EXTRA_FILE + rm $PASSFILE else exec "$@" fi diff --git a/mysql-router/9.1/Dockerfile b/mysql-router/9.1/Dockerfile new file mode 100644 index 000000000..9270f8cc7 --- /dev/null +++ b/mysql-router/9.1/Dockerfile @@ -0,0 +1,39 @@ +# Copyright (c) 2018, 2023, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +FROM container-registry.oracle.com/os/oraclelinux:9-slim + +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-9.1.0 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-9.1.0 +ARG CONFIG_PACKAGE_NAME=mysql84-community-release-el9.rpm +ARG REPO_NAME_SERVER=mysql-innovation-community +ARG REPO_NAME_TOOLS=mysql-tools-innovation-community + +RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ + && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ + -c "MySQL Router" mysqlrouter \ + && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/$CONFIG_PACKAGE_NAME \ + && microdnf install -y \ + --enablerepo=mysql-innovation-community $MYSQL_CLIENT_PACKAGE \ + && microdnf install -y --disablerepo=\* \ + --enablerepo=mysql-tools-innovation-community $MYSQL_ROUTER_PACKAGE \ + && microdnf clean all + +COPY run.sh /run.sh +HEALTHCHECK \ + CMD mysqladmin --port 6446 --protocol TCP ping 2>&1 | grep Access || exit 1 +EXPOSE 6446 6447 6448 6449 6450 8443 +USER 999:999 +ENTRYPOINT ["/run.sh"] +CMD ["mysqlrouter"] diff --git a/mysql-router/9.1/README.md b/mysql-router/9.1/README.md new file mode 100644 index 000000000..0f2711ba5 --- /dev/null +++ b/mysql-router/9.1/README.md @@ -0,0 +1,88 @@ +![logo](https://www.mysql.com/common/logos/logo-mysql-170x115.png) + +# What is MySQL Router? + +MySQL Router is part of InnoDB cluster, and is lightweight middleware that +provides transparent routing between your application and back-end MySQL +Servers. It can be used for a wide variety of use cases, such as providing high +availability and scalability by effectively routing database traffic to +appropriate back-end MySQL Servers. The pluggable architecture also enables +developers to extend MySQL Router for custom use cases. + +# Supported Tags and Respective Dockerfile Links + +* MySQL Router 8.0 (tag: [`latest`, `8.0`](https://github.com/mysql/mysql-docker/blob/mysql-router/8.0/Dockerfile)) ([mysql-router/8.0/Dockerfile](https://github.com/mysql/mysql-docker/blob/mysql-router/8.0/Dockerfile)) + +Images are updated when new MySQL Server maintenance releases and development milestones are published. Please note that non-GA releases are for preview purposes only and should not be used in production setups. + +# How to Use the MySQL Router Images + +The image currently uses the following mandatory variables: + +| Variable | Description | +| ------------------------ | ------------------------------------------- | +| MYSQL_HOST | MySQL host to connect to | +| MYSQL_PORT | Port to use | +| MYSQL_USER | User to connect with | +| MYSQL_PASSWORD | Password to connect with | + +Running in a container requires a working InnoDB cluster. + +The image uses the following optional variables: + +| Variable | Description | +| ------------------------------------ | ------------------------------------------- | +| MYSQL_INNODB_CLUSTER_MEMBERS | Wait for at least this number of cluster instances to be ONLINE | +| MYSQL_CREATE_ROUTER_USER | Whether to create a new account for the Router to use when it's running. Defaults to 1, set to 0 to disable. | +| MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS | Additional command line options applied while bootstrapping + +If supplied the run script waits for the given mysql host to be up, the InnoDB cluster to have +MYSQL_INNODB_CLUSTER_MEMBERS members and then uses the given server for its +bootstrap mode +[Bootstrapping](https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-deploying-bootstrapping.html). + +The image can be run via: + +``` +docker run -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -e MYSQL_INNODB_CLUSTER_MEMBERS=3 -ti mysql/mysql-router +``` + +Additional command line options for running MySQL Router after bootstrap can be passed a command options. For instance you can use a config file from your home directory like this: + +``` +docker run -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -ti -v $HOME/router-extra.conf:/tmp/router-extra.conf mysql/mysql-router mysqlrouter --extra-config=/tmp/router-extra.conf +``` + +It can be verified by typing: + +``` +docker ps +``` + +The following output should be displayed: + +``` +4954b1c80be1 mysql-router:8.0 "/run.sh mysqlrouter" About a minute ago Up About a minute (healthy) 6447/tcp, 6448/tcp, 0.0.0.0:6446->6446/tcp, 6449/tcp innodbcluster_mysql-router_1 +``` + +By default the container will run as user 999:999 which maps to mysqlrouter:mysqlrouter inside the container. + +# Exposed Ports + +The following TCP ports are exposed by the MySQL Router container: + +| Port | Description +| ----- | --------------------------------------------------------------------------------------- | +| 6446 | R/W connection port. Clients that connect to this port will be forwarded to the PRIMARY | +| 6447 | R/O connection port. Clients that connect to this port will be forwarded to a SECONDARY | +| 6448 | X Protocol R/W connection port. R/W port for X protocol client connections | +| 6449 | X Protocol R/O connection port. R/O port for X protocol client connections | +| 8443 | HTTPS REST interface port. | + +For more information about the REST interface API, see: + +https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-rest-api-reference.html + +For full usage documentation, see: + +https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-installation-docker.html diff --git a/mysql-router/9.1/inspec/control.rb b/mysql-router/9.1/inspec/control.rb new file mode 100644 index 000000000..f447dc6d8 --- /dev/null +++ b/mysql-router/9.1/inspec/control.rb @@ -0,0 +1,20 @@ +control 'container' do + impact 0.5 + describe podman.containers do + its('status') { should cmp /Up/ } + its('commands') { should cmp /sleep/ } + its('images') { should cmp /mysql-router:9.1/ } + its('names') { should include "mysql-router-9.1" } + end +end +control 'packages' do + impact 0.5 + describe package('mysql-community-client') do + it { should be_installed } + its ('version') { should match '9.1.0.*' } + end + describe package('mysql-router-community') do + it { should be_installed } + its ('version') { should match '9.1.0.*' } + end +end diff --git a/mysql-router/9.1/run.sh b/mysql-router/9.1/run.sh new file mode 100755 index 000000000..79bb35080 --- /dev/null +++ b/mysql-router/9.1/run.sh @@ -0,0 +1,129 @@ +#!/bin/bash +# Copyright (c) 2018, 2024, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +if [[ -n $MYSQL_USER_FILE && -f $MYSQL_USER_FILE ]]; then + MYSQL_USER=$(cat $MYSQL_USER_FILE) +fi + +if [ "$1" = 'mysqlrouter' ]; then + if [[ -z $MYSQL_HOST || -z $MYSQL_PORT || -z $MYSQL_USER || (-z $MYSQL_PASSWORD && -z $MYSQL_PASSWORD_FILE) ]]; then + echo "We require all of" + echo " MYSQL_HOST" + echo " MYSQL_PORT" + echo " MYSQL_USER or MYSQL_USER_FILE" + echo " MYSQL_PASSWORD or MYSQL_PASSWORD_FILE" + echo "to be set." + echo "In addition you can set" + echo " MYSQL_INNODB_CLUSTER_MEMBERS" + echo " MYSQL_CREATE_ROUTER_USER" + echo " MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS" + echo "Exiting." + exit 1 + fi + + PASSFILE=$(mktemp) + if [[ -n $MYSQL_PASSWORD_FILE && -f "$MYSQL_PASSWORD_FILE" ]]; then + cat "$MYSQL_PASSWORD_FILE" > "$PASSFILE" + echo "" >> "$PASSFILE" + else + echo "$MYSQL_PASSWORD" > "$PASSFILE" + fi + if [ -z $MYSQL_CREATE_ROUTER_USER ]; then + if [[ -n $MYSQL_PASSWORD_FILE && -f "$MYSQL_PASSWORD_FILE" ]]; then + cat "$MYSQL_PASSWORD_FILE" >> "$PASSFILE" + echo "" >> "$PASSFILE" + else + echo "$MYSQL_PASSWORD" >> "$PASSFILE" + fi + MYSQL_CREATE_ROUTER_USER=1 + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is not set, Router will generate a new account to be used at runtime." + echo "[Entrypoint] Set it to 0 to reuse $MYSQL_USER instead." + elif [ "$MYSQL_CREATE_ROUTER_USER" = "0" ]; then + if [[ -n $MYSQL_PASSWORD_FILE && -f "$MYSQL_PASSWORD_FILE" ]]; then + cat "$MYSQL_PASSWORD_FILE" >> "$PASSFILE" + echo "" >> "$PASSFILE" + else + echo "$MYSQL_PASSWORD" >> "$PASSFILE" + fi + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is 0, Router will reuse $MYSQL_USER account at runtime" + else + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is not 0, Router will generate a new account to be used at runtime" + fi + + if [[ -n $MYSQL_PASSWORD_FILE && -f "$MYSQL_PASSWORD_FILE" ]]; then + DEFAULTS_EXTRA_FILE=$(mktemp) + cat >"$DEFAULTS_EXTRA_FILE" <"$DEFAULTS_EXTRA_FILE" < "/dev/tcp/$MYSQL_HOST/$MYSQL_PORT") >/dev/null 2>&1; do + echo "[Entrypoint] Waiting for mysql server $MYSQL_HOST ($attempt_num/$max_tries)" + sleep $(( attempt_num++ )) + if (( attempt_num == max_tries )); then + exit 1 + fi + done + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST:$MYSQL_PORT. Checking for cluster state." + if ! [[ "$(mysql --defaults-extra-file="$DEFAULTS_EXTRA_FILE" -u "$MYSQL_USER" -h "$MYSQL_HOST" -P "$MYSQL_PORT" -e "show status;" 2> /dev/null)" ]]; then + echo "[Entrypoint] ERROR: Can not connect to database. Exiting." + exit 1 + fi + if [[ -n $MYSQL_INNODB_CLUSTER_MEMBERS ]]; then + attempt_num=0 + echo $attempt_num + echo $max_tries + until [ "$(mysql --defaults-extra-file="$DEFAULTS_EXTRA_FILE" -u "$MYSQL_USER" -h "$MYSQL_HOST" -P "$MYSQL_PORT" -N performance_schema -e "select count(MEMBER_STATE) >= $MYSQL_INNODB_CLUSTER_MEMBERS from replication_group_members where MEMBER_STATE = 'ONLINE';" 2> /dev/null)" -eq 1 ]; do + echo "[Entrypoint] Waiting for $MYSQL_INNODB_CLUSTER_MEMBERS cluster instances to become available via $MYSQL_HOST ($attempt_num/$max_tries)" + sleep $(( attempt_num++ )) + if (( attempt_num == max_tries )); then + exit 1 + fi + done + echo "[Entrypoint] Successfully contacted cluster with $MYSQL_INNODB_CLUSTER_MEMBERS members. Bootstrapping." + fi + if [ $(id -u) = "0" ]; then + opt_user=--user=mysqlrouter + fi + if [ "$MYSQL_CREATE_ROUTER_USER" = "0" ]; then + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap reusing account \"$MYSQL_USER\"." + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force --account-create=never --account=$MYSQL_USER $opt_user $MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS < "$PASSFILE" || exit 1 + else + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap." + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force $opt_user $MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS < "$PASSFILE" || exit 1 + fi + + rm "$DEFAULTS_EXTRA_FILE" + + sed -i -e 's/logging_folder=.*$/logging_folder=/' /tmp/mysqlrouter/mysqlrouter.conf + echo "[Entrypoint] Starting mysql-router." + exec "$@" --config /tmp/mysqlrouter/mysqlrouter.conf + + rm $PASSFILE +else + exec "$@" +fi From 2ee43855aba5bb75105229fc13e99fd9e19707c2 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 16 Oct 2024 06:21:50 +0000 Subject: [PATCH 363/386] Release version 1.2.19-cluster * ET#82635: Bump versions for October 8.0.40/8.4.3/9.1.0 Docker releases --- mysql-cluster/8.0/Dockerfile | 4 +- mysql-cluster/8.0/docker-entrypoint.sh | 4 +- mysql-cluster/8.0/inspec/control.rb | 4 +- mysql-cluster/8.4/Dockerfile | 4 +- mysql-cluster/8.4/docker-entrypoint.sh | 4 +- mysql-cluster/8.4/inspec/control.rb | 4 +- mysql-cluster/9.1/Dockerfile | 47 +++++ mysql-cluster/9.1/cnf/my.cnf | 22 ++ mysql-cluster/9.1/cnf/mysql-cluster.cnf | 39 ++++ mysql-cluster/9.1/docker-entrypoint.sh | 264 ++++++++++++++++++++++++ mysql-cluster/9.1/healthcheck.sh | 24 +++ mysql-cluster/9.1/inspec/control.rb | 20 ++ mysql-cluster/9.1/prepare-image.sh | 25 +++ 13 files changed, 453 insertions(+), 12 deletions(-) create mode 100644 mysql-cluster/9.1/Dockerfile create mode 100644 mysql-cluster/9.1/cnf/my.cnf create mode 100644 mysql-cluster/9.1/cnf/mysql-cluster.cnf create mode 100755 mysql-cluster/9.1/docker-entrypoint.sh create mode 100755 mysql-cluster/9.1/healthcheck.sh create mode 100644 mysql-cluster/9.1/inspec/control.rb create mode 100755 mysql-cluster/9.1/prepare-image.sh diff --git a/mysql-cluster/8.0/Dockerfile b/mysql-cluster/8.0/Dockerfile index 68c2705a6..29ab517d1 100644 --- a/mysql-cluster/8.0/Dockerfile +++ b/mysql-cluster/8.0/Dockerfile @@ -15,8 +15,8 @@ FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.0.39 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.38 +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.0.40 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.40 # Setup repositories for minimal packages (all versions) RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-cluster-community-minimal-release-el9.rpm \ diff --git a/mysql-cluster/8.0/docker-entrypoint.sh b/mysql-cluster/8.0/docker-entrypoint.sh index 632370458..f9c6c8b12 100755 --- a/mysql-cluster/8.0/docker-entrypoint.sh +++ b/mysql-cluster/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.39-1.2.18-cluster" +echo "[Entrypoint] MySQL Docker Image 8.0.40-1.2.19-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -227,7 +227,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.39-1.2.18-cluster" + echo "[Entrypoint] Starting MySQL 8.0.40-1.2.19-cluster" fi export MYSQLD_PARENT_PID=$$ ; exec "$@" --user= else diff --git a/mysql-cluster/8.0/inspec/control.rb b/mysql-cluster/8.0/inspec/control.rb index a9fb05a04..59c2bc99c 100644 --- a/mysql-cluster/8.0/inspec/control.rb +++ b/mysql-cluster/8.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.39.*' } + its ('version') { should match '8.0.40.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.38.*' } + its ('version') { should match '8.0.40.*' } end end diff --git a/mysql-cluster/8.4/Dockerfile b/mysql-cluster/8.4/Dockerfile index b0d9534f1..5695b5aa0 100644 --- a/mysql-cluster/8.4/Dockerfile +++ b/mysql-cluster/8.4/Dockerfile @@ -15,8 +15,8 @@ FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.4.2 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.4.1 +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.4.3 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.4.3 # Setup repositories for minimal packages (all versions) RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-cluster-community-minimal-release-el9.rpm \ diff --git a/mysql-cluster/8.4/docker-entrypoint.sh b/mysql-cluster/8.4/docker-entrypoint.sh index 507394121..2dbf0966b 100755 --- a/mysql-cluster/8.4/docker-entrypoint.sh +++ b/mysql-cluster/8.4/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.4.2-1.2.18-cluster" +echo "[Entrypoint] MySQL Docker Image 8.4.3-1.2.19-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -227,7 +227,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.4.2-1.2.18-cluster" + echo "[Entrypoint] Starting MySQL 8.4.3-1.2.19-cluster" fi export MYSQLD_PARENT_PID=$$ ; exec "$@" --user= else diff --git a/mysql-cluster/8.4/inspec/control.rb b/mysql-cluster/8.4/inspec/control.rb index 68fa7f3ee..dbf56780a 100644 --- a/mysql-cluster/8.4/inspec/control.rb +++ b/mysql-cluster/8.4/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.4.2.*' } + its ('version') { should match '8.4.3.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.4.1.*' } + its ('version') { should match '8.4.3.*' } end end diff --git a/mysql-cluster/9.1/Dockerfile b/mysql-cluster/9.1/Dockerfile new file mode 100644 index 000000000..a431d3920 --- /dev/null +++ b/mysql-cluster/9.1/Dockerfile @@ -0,0 +1,47 @@ +# Copyright (c) 2017, 2023, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +FROM container-registry.oracle.com/os/oraclelinux:9-slim + +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-9.1.0 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-9.1.0 + +# Setup repositories for minimal packages (all versions) +RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-cluster-community-minimal-release-el9.rpm \ + && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm + +# Install server and shell 8.0 +RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ + && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --disablerepo=ol9_appstream \ + --enablerepo=mysql-cluster-innovation-community-minimal $MYSQL_SERVER_PACKAGE \ + && microdnf clean all \ + && mkdir /docker-entrypoint-initdb.d + +COPY prepare-image.sh / +RUN /prepare-image.sh && rm -f /prepare-image.sh + +ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock + +COPY docker-entrypoint.sh /entrypoint.sh +COPY healthcheck.sh /healthcheck.sh +COPY cnf/my.cnf /etc/ +COPY cnf/mysql-cluster.cnf /etc/ + +ENTRYPOINT ["/entrypoint.sh"] +HEALTHCHECK CMD /healthcheck.sh +EXPOSE 3306 33060-33061 2202 1186 +CMD ["mysqld"] + diff --git a/mysql-cluster/9.1/cnf/my.cnf b/mysql-cluster/9.1/cnf/my.cnf new file mode 100644 index 000000000..ec98b2dc1 --- /dev/null +++ b/mysql-cluster/9.1/cnf/my.cnf @@ -0,0 +1,22 @@ +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +[mysqld] +ndbcluster +ndb-connectstring=192.168.0.2 +user=mysql + +[mysql_cluster] +ndb-connectstring=192.168.0.2 diff --git a/mysql-cluster/9.1/cnf/mysql-cluster.cnf b/mysql-cluster/9.1/cnf/mysql-cluster.cnf new file mode 100644 index 000000000..16f79f1c0 --- /dev/null +++ b/mysql-cluster/9.1/cnf/mysql-cluster.cnf @@ -0,0 +1,39 @@ +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +[ndbd default] +NoOfReplicas=2 +DataMemory=80M +IndexMemory=18M + + +[ndb_mgmd] +NodeId=1 +hostname=192.168.0.2 +datadir=/var/lib/mysql + +[ndbd] +NodeId=2 +hostname=192.168.0.3 +datadir=/var/lib/mysql + +[ndbd] +NodeId=3 +hostname=192.168.0.4 +datadir=/var/lib/mysql + +[mysqld] +NodeId=4 +hostname=192.168.0.10 diff --git a/mysql-cluster/9.1/docker-entrypoint.sh b/mysql-cluster/9.1/docker-entrypoint.sh new file mode 100755 index 000000000..9c130f143 --- /dev/null +++ b/mysql-cluster/9.1/docker-entrypoint.sh @@ -0,0 +1,264 @@ +#!/bin/bash +# Copyright (c) 2017, 2021, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +echo "[Entrypoint] MySQL Docker Image " +# Fetch value from server config +# We use mysqld --verbose --help instead of my_print_defaults because the +# latter only show values present in config files, and not server defaults +_get_config() { + local conf="$1"; shift + "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' +} + +# Generate a random password +_mkpw() { + letter=$(cat /dev/urandom| tr -dc a-zA-Z | dd bs=1 count=16 2> /dev/null ) + number=$(cat /dev/urandom| tr -dc 0-9 | dd bs=1 count=8 2> /dev/null) + special=$(cat /dev/urandom| tr -dc '=+@#%^&*_.,;:?/' | dd bs=1 count=8 2> /dev/null) + + echo $letter$number$special | fold -w 1 | shuf | tr -d '\n' +} + +# If command starts with an option, prepend mysqld +# This allows users to add command-line options without +# needing to specify the "mysqld" command +if [ "${1:0:1}" = '-' ]; then + set -- mysqld "$@" +fi + +# Check if entrypoint (and the container) is running as root +if [ $(id -u) = "0" ]; then + is_root=1 + install_devnull="install /dev/null -m0600 -omysql -gmysql" + MYSQLD_USER=mysql +else + install_devnull="install /dev/null -m0600" + MYSQLD_USER=$(id -u) +fi + +if [ "$1" = 'mysqld' ]; then + # Test that the server can start. We redirect stdout to /dev/null so + # only the error messages are left. + result=0 + output=$("$@" --validate-config) || result=$? + if [ ! "$result" = "0" ]; then + echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' + echo >&2 "[Entrypoint] $output" + exit 1 + fi + + # Get config + DATADIR="$(_get_config 'datadir' "$@")" + SOCKET="$(_get_config 'socket' "$@")" + + if [ ! -d "$DATADIR/mysql" ]; then + # If the password variable is a filename we use the contents of the file. We + # read this first to make sure that a proper error is generated for empty files. + if [ -f "$MYSQL_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + if [ -z "$MYSQL_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' + exit 1 + fi + fi + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] No password option specified for new database.' + echo >&2 '[Entrypoint] A random onetime password will be generated.' + MYSQL_RANDOM_ROOT_PASSWORD=true + MYSQL_ONETIME_PASSWORD=true + fi + if [ ! -d "$DATADIR" ]; then + mkdir -p "$DATADIR" + chown mysql:mysql "$DATADIR" + fi + + # The user can set a default_timezone either in a my.cnf file + # they mount into the container or on command line + # (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`) + # however the timezone tables will only be populated in a later + # stage of this script. By using +00:00 as timezone we override + # the user's choice during initialization. Later the server + # will be restarted using the user's option. + + echo '[Entrypoint] Initializing database' + "$@" --user=$MYSQLD_USER --initialize-insecure --default-time-zone=+00:00 + + echo '[Entrypoint] Database initialized' + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" --default-time-zone=+00:00 + + # To avoid using password on commandline, put it in a temporary file. + # The file is only populated when and if the root password is set. + PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + $install_devnull "$PASSFILE" + # Define the client command used throughout the script + # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") + + if [ ! -z %%STARTUP_WAIT%% ]; + then + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break + fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 + fi + fi + + mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql + + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(_mkpw)" + echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + fi + if [ -z "$MYSQL_ROOT_HOST" ]; then + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';" + else + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ + GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + fi + "${mysql[@]}" <<-EOSQL + DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; + ${ROOTCREATE} + FLUSH PRIVILEGES ; + EOSQL + if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then + # Put the password into the temporary config file + cat >"$PASSFILE" < "$SQL" +ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL + fi + fi + + echo + echo '[Entrypoint] MySQL init process done. Ready for start up.' + echo + fi + + # Used by healthcheck to make sure it doesn't mistakenly report container + # healthy during startup + # Put the password into the temporary config file + touch /var/lib/mysql-files/healthcheck.cnf + cat >"/var/lib/mysql-files/healthcheck.cnf" < Date: Thu, 17 Oct 2024 09:23:35 +0200 Subject: [PATCH 364/386] ET#83033 - [Docker] Update weekly server, shell & router version Change-Id: I7887bb87f20fd15774ce0a4c8eefe3b3e0778905 --- mysql-router/VERSION | 8 ++++---- mysql-server/VERSION | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mysql-router/VERSION b/mysql-router/VERSION index c9acfae9e..e9f2dba3b 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -29,8 +29,8 @@ MYSQL_ROUTER_VERSIONS["8.0"]=8.0.40 MYSQL_ROUTER_VERSIONS["8.4"]=8.4.3 MYSQL_ROUTER_VERSIONS["innovation"]=9.1.0 -WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.40 -WEEKLY_ROUTER_VERSIONS["8.4"]=8.4.3 +WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.41 +WEEKLY_ROUTER_VERSIONS["8.4"]=8.4.4 WEEKLY_ROUTER_VERSIONS["innovation"]=9.2.0 declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS @@ -38,6 +38,6 @@ MYSQL_SERVER_VERSIONS["8.0"]=8.0.40 MYSQL_SERVER_VERSIONS["8.4"]=8.4.3 MYSQL_SERVER_VERSIONS["innovation"]=9.1.0 -WEEKLY_SERVER_VERSIONS["8.0"]=8.0.40 -WEEKLY_SERVER_VERSIONS["8.4"]=8.4.3 +WEEKLY_SERVER_VERSIONS["8.0"]=8.0.41 +WEEKLY_SERVER_VERSIONS["8.4"]=8.4.4 WEEKLY_SERVER_VERSIONS["innovation"]=9.2.0 diff --git a/mysql-server/VERSION b/mysql-server/VERSION index 5e57a7082..762ba8cd9 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -29,8 +29,8 @@ MYSQL_SERVER_VERSIONS["8.0"]=8.0.40 MYSQL_SERVER_VERSIONS["8.4"]=8.4.3 MYSQL_SERVER_VERSIONS["innovation"]=9.1.0 -WEEKLY_SERVER_VERSIONS["8.0"]=8.0.40 -WEEKLY_SERVER_VERSIONS["8.4"]=8.4.3 +WEEKLY_SERVER_VERSIONS["8.0"]=8.0.41 +WEEKLY_SERVER_VERSIONS["8.4"]=8.4.4 WEEKLY_SERVER_VERSIONS["innovation"]=9.2.0 declare -A MYSQL_SHELL_VERSIONS WEEKLY_SHELL_VERSIONS @@ -38,6 +38,6 @@ MYSQL_SHELL_VERSIONS["8.0"]=8.0.40 MYSQL_SHELL_VERSIONS["8.4"]=8.4.3 MYSQL_SHELL_VERSIONS["innovation"]=9.1.0 -WEEKLY_SHELL_VERSIONS["8.0"]=8.0.40 -WEEKLY_SHELL_VERSIONS["8.4"]=8.4.3 +WEEKLY_SHELL_VERSIONS["8.0"]=8.0.41 +WEEKLY_SHELL_VERSIONS["8.4"]=8.4.4 WEEKLY_SHELL_VERSIONS["innovation"]=9.2.0 From 373370bde3e62178f5a4c2c52e29ec7e2dcdd444 Mon Sep 17 00:00:00 2001 From: Suhani Goel Date: Tue, 24 Dec 2024 19:21:13 +0100 Subject: [PATCH 365/386] ET#83723 Bump versions for 8.0.41/8.4.4/9.2.0 Docker releases Change-Id: I0c196c53ec0bbf68c4db8f2c593860d1668263e5 --- mysql-cluster/VERSION | 14 +++++++------- mysql-router/VERSION | 14 +++++++------- mysql-server/VERSION | 14 +++++++------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/mysql-cluster/VERSION b/mysql-cluster/VERSION index 48a2ce631..b67bc0904 100644 --- a/mysql-cluster/VERSION +++ b/mysql-cluster/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.2.19-cluster +IMAGE_VERSION=1.2.20-cluster # LATEST is always set to the # current highest release, which is, @@ -25,14 +25,14 @@ LATEST_LTS="8.4" # like 'latest-8.4' or 'lts-84', etch declare -A MYSQL_CLUSTER_VERSIONS -MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.40 -MYSQL_CLUSTER_VERSIONS["8.4"]=8.4.3 -MYSQL_CLUSTER_VERSIONS["innovation"]=9.1.0 +MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.41 +MYSQL_CLUSTER_VERSIONS["8.4"]=8.4.4 +MYSQL_CLUSTER_VERSIONS["innovation"]=9.2.0 declare -A MYSQL_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["8.0"]=8.0.40 -MYSQL_SHELL_VERSIONS["8.4"]=8.4.3 -MYSQL_SHELL_VERSIONS["innovation"]=9.1.0 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.41 +MYSQL_SHELL_VERSIONS["8.4"]=8.4.4 +MYSQL_SHELL_VERSIONS["innovation"]=9.2.0 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["8.0"]="${MYSQL_CLUSTER_VERSIONS["8.0"]}-${IMAGE_VERSION}" diff --git a/mysql-router/VERSION b/mysql-router/VERSION index e9f2dba3b..9bb7aa946 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.0.19-router +IMAGE_VERSION=1.0.20-router # LATEST is always set to the # current highest release, which is, @@ -25,18 +25,18 @@ LATEST_LTS="8.4" # like 'latest-8.4' or 'lts-84', etch declare -A MYSQL_ROUTER_VERSIONS WEEKLY_ROUTER_VERSIONS -MYSQL_ROUTER_VERSIONS["8.0"]=8.0.40 -MYSQL_ROUTER_VERSIONS["8.4"]=8.4.3 -MYSQL_ROUTER_VERSIONS["innovation"]=9.1.0 +MYSQL_ROUTER_VERSIONS["8.0"]=8.0.41 +MYSQL_ROUTER_VERSIONS["8.4"]=8.4.4 +MYSQL_ROUTER_VERSIONS["innovation"]=9.2.0 WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.41 WEEKLY_ROUTER_VERSIONS["8.4"]=8.4.4 WEEKLY_ROUTER_VERSIONS["innovation"]=9.2.0 declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["8.0"]=8.0.40 -MYSQL_SERVER_VERSIONS["8.4"]=8.4.3 -MYSQL_SERVER_VERSIONS["innovation"]=9.1.0 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.41 +MYSQL_SERVER_VERSIONS["8.4"]=8.4.4 +MYSQL_SERVER_VERSIONS["innovation"]=9.2.0 WEEKLY_SERVER_VERSIONS["8.0"]=8.0.41 WEEKLY_SERVER_VERSIONS["8.4"]=8.4.4 diff --git a/mysql-server/VERSION b/mysql-server/VERSION index 762ba8cd9..759d84151 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.2.19-server +IMAGE_VERSION=1.2.20-server # LATEST is always set to the # current highest release, which is, @@ -25,18 +25,18 @@ LATEST_LTS="8.4" # like 'latest-8.4' or 'lts-84', etc. declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["8.0"]=8.0.40 -MYSQL_SERVER_VERSIONS["8.4"]=8.4.3 -MYSQL_SERVER_VERSIONS["innovation"]=9.1.0 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.41 +MYSQL_SERVER_VERSIONS["8.4"]=8.4.4 +MYSQL_SERVER_VERSIONS["innovation"]=9.2.0 WEEKLY_SERVER_VERSIONS["8.0"]=8.0.41 WEEKLY_SERVER_VERSIONS["8.4"]=8.4.4 WEEKLY_SERVER_VERSIONS["innovation"]=9.2.0 declare -A MYSQL_SHELL_VERSIONS WEEKLY_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["8.0"]=8.0.40 -MYSQL_SHELL_VERSIONS["8.4"]=8.4.3 -MYSQL_SHELL_VERSIONS["innovation"]=9.1.0 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.41 +MYSQL_SHELL_VERSIONS["8.4"]=8.4.4 +MYSQL_SHELL_VERSIONS["innovation"]=9.2.0 WEEKLY_SHELL_VERSIONS["8.0"]=8.0.41 WEEKLY_SHELL_VERSIONS["8.4"]=8.4.4 From 859d71ce1a96d27f8ab92f7955291f1ce913c77c Mon Sep 17 00:00:00 2001 From: Nawaz Nazeer Ahamed Date: Sun, 29 Dec 2024 02:30:13 +0100 Subject: [PATCH 366/386] ET#83752 - Bump up version for weekly server & router pipelines Change-Id: Icca677457b6e8f2f98a209ee978315fd9cc449bc --- mysql-router/VERSION | 12 ++++++------ mysql-server/VERSION | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/mysql-router/VERSION b/mysql-router/VERSION index 9bb7aa946..57cd1f016 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -29,15 +29,15 @@ MYSQL_ROUTER_VERSIONS["8.0"]=8.0.41 MYSQL_ROUTER_VERSIONS["8.4"]=8.4.4 MYSQL_ROUTER_VERSIONS["innovation"]=9.2.0 -WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.41 -WEEKLY_ROUTER_VERSIONS["8.4"]=8.4.4 -WEEKLY_ROUTER_VERSIONS["innovation"]=9.2.0 +WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.42 +WEEKLY_ROUTER_VERSIONS["8.4"]=8.4.5 +WEEKLY_ROUTER_VERSIONS["innovation"]=9.3.0 declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["8.0"]=8.0.41 MYSQL_SERVER_VERSIONS["8.4"]=8.4.4 MYSQL_SERVER_VERSIONS["innovation"]=9.2.0 -WEEKLY_SERVER_VERSIONS["8.0"]=8.0.41 -WEEKLY_SERVER_VERSIONS["8.4"]=8.4.4 -WEEKLY_SERVER_VERSIONS["innovation"]=9.2.0 +WEEKLY_SERVER_VERSIONS["8.0"]=8.0.42 +WEEKLY_SERVER_VERSIONS["8.4"]=8.4.5 +WEEKLY_SERVER_VERSIONS["innovation"]=9.3.0 diff --git a/mysql-server/VERSION b/mysql-server/VERSION index 759d84151..1067b7d12 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -29,15 +29,15 @@ MYSQL_SERVER_VERSIONS["8.0"]=8.0.41 MYSQL_SERVER_VERSIONS["8.4"]=8.4.4 MYSQL_SERVER_VERSIONS["innovation"]=9.2.0 -WEEKLY_SERVER_VERSIONS["8.0"]=8.0.41 -WEEKLY_SERVER_VERSIONS["8.4"]=8.4.4 -WEEKLY_SERVER_VERSIONS["innovation"]=9.2.0 +WEEKLY_SERVER_VERSIONS["8.0"]=8.0.42 +WEEKLY_SERVER_VERSIONS["8.4"]=8.4.5 +WEEKLY_SERVER_VERSIONS["innovation"]=9.3.0 declare -A MYSQL_SHELL_VERSIONS WEEKLY_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["8.0"]=8.0.41 MYSQL_SHELL_VERSIONS["8.4"]=8.4.4 MYSQL_SHELL_VERSIONS["innovation"]=9.2.0 -WEEKLY_SHELL_VERSIONS["8.0"]=8.0.41 -WEEKLY_SHELL_VERSIONS["8.4"]=8.4.4 -WEEKLY_SHELL_VERSIONS["innovation"]=9.2.0 +WEEKLY_SHELL_VERSIONS["8.0"]=8.0.42 +WEEKLY_SHELL_VERSIONS["8.4"]=8.4.5 +WEEKLY_SHELL_VERSIONS["innovation"]=9.3.0 From 757505a70bca80e184f73ab71ee3d8eafaf628a0 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 22 Jan 2025 08:15:35 +0000 Subject: [PATCH 367/386] Release version 1.2.20-cluster * ET#83723 Bump versions for 8.0.41/8.4.4/9.2.0 Docker releases --- mysql-cluster/8.0/Dockerfile | 8 +- mysql-cluster/8.0/docker-entrypoint.sh | 4 +- mysql-cluster/8.0/inspec/control.rb | 4 +- mysql-cluster/8.4/Dockerfile | 8 +- mysql-cluster/8.4/docker-entrypoint.sh | 4 +- mysql-cluster/8.4/inspec/control.rb | 4 +- mysql-cluster/9.2/Dockerfile | 47 +++++ mysql-cluster/9.2/cnf/my.cnf | 22 ++ mysql-cluster/9.2/cnf/mysql-cluster.cnf | 39 ++++ mysql-cluster/9.2/docker-entrypoint.sh | 264 ++++++++++++++++++++++++ mysql-cluster/9.2/healthcheck.sh | 24 +++ mysql-cluster/9.2/inspec/control.rb | 20 ++ mysql-cluster/9.2/prepare-image.sh | 25 +++ 13 files changed, 457 insertions(+), 16 deletions(-) create mode 100644 mysql-cluster/9.2/Dockerfile create mode 100644 mysql-cluster/9.2/cnf/my.cnf create mode 100644 mysql-cluster/9.2/cnf/mysql-cluster.cnf create mode 100755 mysql-cluster/9.2/docker-entrypoint.sh create mode 100755 mysql-cluster/9.2/healthcheck.sh create mode 100644 mysql-cluster/9.2/inspec/control.rb create mode 100755 mysql-cluster/9.2/prepare-image.sh diff --git a/mysql-cluster/8.0/Dockerfile b/mysql-cluster/8.0/Dockerfile index 29ab517d1..61f6dfce4 100644 --- a/mysql-cluster/8.0/Dockerfile +++ b/mysql-cluster/8.0/Dockerfile @@ -15,12 +15,12 @@ FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.0.40 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.40 +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.0.41 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.41 # Setup repositories for minimal packages (all versions) -RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-cluster-community-minimal-release-el9.rpm \ - && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm +RUN rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ + && rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm # Install server and shell 8.0 RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ diff --git a/mysql-cluster/8.0/docker-entrypoint.sh b/mysql-cluster/8.0/docker-entrypoint.sh index f9c6c8b12..f6f5c65d8 100755 --- a/mysql-cluster/8.0/docker-entrypoint.sh +++ b/mysql-cluster/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.40-1.2.19-cluster" +echo "[Entrypoint] MySQL Docker Image 8.0.41-1.2.20-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -227,7 +227,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.40-1.2.19-cluster" + echo "[Entrypoint] Starting MySQL 8.0.41-1.2.20-cluster" fi export MYSQLD_PARENT_PID=$$ ; exec "$@" --user= else diff --git a/mysql-cluster/8.0/inspec/control.rb b/mysql-cluster/8.0/inspec/control.rb index 59c2bc99c..f695c9f51 100644 --- a/mysql-cluster/8.0/inspec/control.rb +++ b/mysql-cluster/8.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.40.*' } + its ('version') { should match '8.0.41.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.40.*' } + its ('version') { should match '8.0.41.*' } end end diff --git a/mysql-cluster/8.4/Dockerfile b/mysql-cluster/8.4/Dockerfile index 5695b5aa0..0b8944515 100644 --- a/mysql-cluster/8.4/Dockerfile +++ b/mysql-cluster/8.4/Dockerfile @@ -15,12 +15,12 @@ FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.4.3 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.4.3 +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.4.4 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.4.4 # Setup repositories for minimal packages (all versions) -RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-cluster-community-minimal-release-el9.rpm \ - && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm +RUN rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ + && rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm # Install server and shell 8.0 RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ diff --git a/mysql-cluster/8.4/docker-entrypoint.sh b/mysql-cluster/8.4/docker-entrypoint.sh index 2dbf0966b..eb05cb23d 100755 --- a/mysql-cluster/8.4/docker-entrypoint.sh +++ b/mysql-cluster/8.4/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.4.3-1.2.19-cluster" +echo "[Entrypoint] MySQL Docker Image 8.4.4-1.2.20-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -227,7 +227,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.4.3-1.2.19-cluster" + echo "[Entrypoint] Starting MySQL 8.4.4-1.2.20-cluster" fi export MYSQLD_PARENT_PID=$$ ; exec "$@" --user= else diff --git a/mysql-cluster/8.4/inspec/control.rb b/mysql-cluster/8.4/inspec/control.rb index dbf56780a..f8e648303 100644 --- a/mysql-cluster/8.4/inspec/control.rb +++ b/mysql-cluster/8.4/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.4.3.*' } + its ('version') { should match '8.4.4.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.4.3.*' } + its ('version') { should match '8.4.4.*' } end end diff --git a/mysql-cluster/9.2/Dockerfile b/mysql-cluster/9.2/Dockerfile new file mode 100644 index 000000000..54c07d0e4 --- /dev/null +++ b/mysql-cluster/9.2/Dockerfile @@ -0,0 +1,47 @@ +# Copyright (c) 2017, 2023, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +FROM container-registry.oracle.com/os/oraclelinux:9-slim + +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-9.2.0 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-9.2.0 + +# Setup repositories for minimal packages (all versions) +RUN rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ + && rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm + +# Install server and shell 8.0 +RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ + && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --disablerepo=ol9_appstream \ + --enablerepo=mysql-cluster-innovation-community-minimal $MYSQL_SERVER_PACKAGE \ + && microdnf clean all \ + && mkdir /docker-entrypoint-initdb.d + +COPY prepare-image.sh / +RUN /prepare-image.sh && rm -f /prepare-image.sh + +ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock + +COPY docker-entrypoint.sh /entrypoint.sh +COPY healthcheck.sh /healthcheck.sh +COPY cnf/my.cnf /etc/ +COPY cnf/mysql-cluster.cnf /etc/ + +ENTRYPOINT ["/entrypoint.sh"] +HEALTHCHECK CMD /healthcheck.sh +EXPOSE 3306 33060-33061 2202 1186 +CMD ["mysqld"] + diff --git a/mysql-cluster/9.2/cnf/my.cnf b/mysql-cluster/9.2/cnf/my.cnf new file mode 100644 index 000000000..ec98b2dc1 --- /dev/null +++ b/mysql-cluster/9.2/cnf/my.cnf @@ -0,0 +1,22 @@ +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +[mysqld] +ndbcluster +ndb-connectstring=192.168.0.2 +user=mysql + +[mysql_cluster] +ndb-connectstring=192.168.0.2 diff --git a/mysql-cluster/9.2/cnf/mysql-cluster.cnf b/mysql-cluster/9.2/cnf/mysql-cluster.cnf new file mode 100644 index 000000000..16f79f1c0 --- /dev/null +++ b/mysql-cluster/9.2/cnf/mysql-cluster.cnf @@ -0,0 +1,39 @@ +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +[ndbd default] +NoOfReplicas=2 +DataMemory=80M +IndexMemory=18M + + +[ndb_mgmd] +NodeId=1 +hostname=192.168.0.2 +datadir=/var/lib/mysql + +[ndbd] +NodeId=2 +hostname=192.168.0.3 +datadir=/var/lib/mysql + +[ndbd] +NodeId=3 +hostname=192.168.0.4 +datadir=/var/lib/mysql + +[mysqld] +NodeId=4 +hostname=192.168.0.10 diff --git a/mysql-cluster/9.2/docker-entrypoint.sh b/mysql-cluster/9.2/docker-entrypoint.sh new file mode 100755 index 000000000..9c130f143 --- /dev/null +++ b/mysql-cluster/9.2/docker-entrypoint.sh @@ -0,0 +1,264 @@ +#!/bin/bash +# Copyright (c) 2017, 2021, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +echo "[Entrypoint] MySQL Docker Image " +# Fetch value from server config +# We use mysqld --verbose --help instead of my_print_defaults because the +# latter only show values present in config files, and not server defaults +_get_config() { + local conf="$1"; shift + "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' +} + +# Generate a random password +_mkpw() { + letter=$(cat /dev/urandom| tr -dc a-zA-Z | dd bs=1 count=16 2> /dev/null ) + number=$(cat /dev/urandom| tr -dc 0-9 | dd bs=1 count=8 2> /dev/null) + special=$(cat /dev/urandom| tr -dc '=+@#%^&*_.,;:?/' | dd bs=1 count=8 2> /dev/null) + + echo $letter$number$special | fold -w 1 | shuf | tr -d '\n' +} + +# If command starts with an option, prepend mysqld +# This allows users to add command-line options without +# needing to specify the "mysqld" command +if [ "${1:0:1}" = '-' ]; then + set -- mysqld "$@" +fi + +# Check if entrypoint (and the container) is running as root +if [ $(id -u) = "0" ]; then + is_root=1 + install_devnull="install /dev/null -m0600 -omysql -gmysql" + MYSQLD_USER=mysql +else + install_devnull="install /dev/null -m0600" + MYSQLD_USER=$(id -u) +fi + +if [ "$1" = 'mysqld' ]; then + # Test that the server can start. We redirect stdout to /dev/null so + # only the error messages are left. + result=0 + output=$("$@" --validate-config) || result=$? + if [ ! "$result" = "0" ]; then + echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' + echo >&2 "[Entrypoint] $output" + exit 1 + fi + + # Get config + DATADIR="$(_get_config 'datadir' "$@")" + SOCKET="$(_get_config 'socket' "$@")" + + if [ ! -d "$DATADIR/mysql" ]; then + # If the password variable is a filename we use the contents of the file. We + # read this first to make sure that a proper error is generated for empty files. + if [ -f "$MYSQL_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + if [ -z "$MYSQL_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' + exit 1 + fi + fi + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] No password option specified for new database.' + echo >&2 '[Entrypoint] A random onetime password will be generated.' + MYSQL_RANDOM_ROOT_PASSWORD=true + MYSQL_ONETIME_PASSWORD=true + fi + if [ ! -d "$DATADIR" ]; then + mkdir -p "$DATADIR" + chown mysql:mysql "$DATADIR" + fi + + # The user can set a default_timezone either in a my.cnf file + # they mount into the container or on command line + # (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`) + # however the timezone tables will only be populated in a later + # stage of this script. By using +00:00 as timezone we override + # the user's choice during initialization. Later the server + # will be restarted using the user's option. + + echo '[Entrypoint] Initializing database' + "$@" --user=$MYSQLD_USER --initialize-insecure --default-time-zone=+00:00 + + echo '[Entrypoint] Database initialized' + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" --default-time-zone=+00:00 + + # To avoid using password on commandline, put it in a temporary file. + # The file is only populated when and if the root password is set. + PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + $install_devnull "$PASSFILE" + # Define the client command used throughout the script + # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") + + if [ ! -z %%STARTUP_WAIT%% ]; + then + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break + fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 + fi + fi + + mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql + + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(_mkpw)" + echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + fi + if [ -z "$MYSQL_ROOT_HOST" ]; then + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';" + else + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ + GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + fi + "${mysql[@]}" <<-EOSQL + DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; + ${ROOTCREATE} + FLUSH PRIVILEGES ; + EOSQL + if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then + # Put the password into the temporary config file + cat >"$PASSFILE" < "$SQL" +ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL + fi + fi + + echo + echo '[Entrypoint] MySQL init process done. Ready for start up.' + echo + fi + + # Used by healthcheck to make sure it doesn't mistakenly report container + # healthy during startup + # Put the password into the temporary config file + touch /var/lib/mysql-files/healthcheck.cnf + cat >"/var/lib/mysql-files/healthcheck.cnf" < Date: Wed, 22 Jan 2025 08:40:31 +0000 Subject: [PATCH 368/386] Release version 1.2.20-server * ET#83752 - Bump up version for weekly server & router pipelines * ET#83723 Bump versions for 8.0.41/8.4.4/9.2.0 Docker releases * ET#83033 - [Docker] Update weekly server, shell & router version --- mysql-server/8.0/Dockerfile | 8 +- mysql-server/8.0/docker-entrypoint.sh | 4 +- mysql-server/8.0/inspec/control.rb | 4 +- mysql-server/8.4/Dockerfile | 8 +- mysql-server/8.4/docker-entrypoint.sh | 4 +- mysql-server/8.4/inspec/control.rb | 4 +- mysql-server/9.2/Dockerfile | 45 +++++ mysql-server/9.2/docker-entrypoint.sh | 230 ++++++++++++++++++++++++++ mysql-server/9.2/healthcheck.sh | 24 +++ mysql-server/9.2/inspec/control.rb | 20 +++ mysql-server/9.2/prepare-image.sh | 25 +++ 11 files changed, 360 insertions(+), 16 deletions(-) create mode 100644 mysql-server/9.2/Dockerfile create mode 100755 mysql-server/9.2/docker-entrypoint.sh create mode 100755 mysql-server/9.2/healthcheck.sh create mode 100644 mysql-server/9.2/inspec/control.rb create mode 100755 mysql-server/9.2/prepare-image.sh diff --git a/mysql-server/8.0/Dockerfile b/mysql-server/8.0/Dockerfile index 915a535d7..d49e956bd 100644 --- a/mysql-server/8.0/Dockerfile +++ b/mysql-server/8.0/Dockerfile @@ -15,12 +15,12 @@ FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.40 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.40 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.41 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.41 # Setup repositories for minimal packages (all versions) -RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ - && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm +RUN rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ + && rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm # Install server and shell 8.0 RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ diff --git a/mysql-server/8.0/docker-entrypoint.sh b/mysql-server/8.0/docker-entrypoint.sh index 75980e3b8..542bc27ef 100755 --- a/mysql-server/8.0/docker-entrypoint.sh +++ b/mysql-server/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.40-1.2.19-server" +echo "[Entrypoint] MySQL Docker Image 8.0.41-1.2.20-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.40-1.2.19-server" + echo "[Entrypoint] Starting MySQL 8.0.41-1.2.20-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/8.0/inspec/control.rb b/mysql-server/8.0/inspec/control.rb index fd4b35038..40b36ca5d 100644 --- a/mysql-server/8.0/inspec/control.rb +++ b/mysql-server/8.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.40.*' } + its ('version') { should match '8.0.41.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.40.*' } + its ('version') { should match '8.0.41.*' } end end diff --git a/mysql-server/8.4/Dockerfile b/mysql-server/8.4/Dockerfile index d274d5d74..15f41d189 100644 --- a/mysql-server/8.4/Dockerfile +++ b/mysql-server/8.4/Dockerfile @@ -15,12 +15,12 @@ FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.4.3 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.4.3 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.4.4 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.4.4 # Setup repositories for minimal packages (all versions) -RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ - && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm +RUN rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ + && rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm # Install server and shell 8.0 RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ diff --git a/mysql-server/8.4/docker-entrypoint.sh b/mysql-server/8.4/docker-entrypoint.sh index 577faa5fe..136789761 100755 --- a/mysql-server/8.4/docker-entrypoint.sh +++ b/mysql-server/8.4/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.4.3-1.2.19-server" +echo "[Entrypoint] MySQL Docker Image 8.4.4-1.2.20-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.4.3-1.2.19-server" + echo "[Entrypoint] Starting MySQL 8.4.4-1.2.20-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/8.4/inspec/control.rb b/mysql-server/8.4/inspec/control.rb index c20ea957e..c6c0282a4 100644 --- a/mysql-server/8.4/inspec/control.rb +++ b/mysql-server/8.4/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.4.3.*' } + its ('version') { should match '8.4.4.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.4.3.*' } + its ('version') { should match '8.4.4.*' } end end diff --git a/mysql-server/9.2/Dockerfile b/mysql-server/9.2/Dockerfile new file mode 100644 index 000000000..3c0355c4d --- /dev/null +++ b/mysql-server/9.2/Dockerfile @@ -0,0 +1,45 @@ +# Copyright (c) 2017, 2023, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +FROM container-registry.oracle.com/os/oraclelinux:9-slim + +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-9.2.0 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-9.2.0 + +# Setup repositories for minimal packages (all versions) +RUN rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ + && rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm + +# Install server and shell 8.0 +RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ + && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --disablerepo=ol9_appstream \ + --enablerepo=mysql-innovation-community-minimal $MYSQL_SERVER_PACKAGE \ + && microdnf remove -y mysql-community-minimal-release mysql84-community-release \ + && microdnf clean all \ + && mkdir /docker-entrypoint-initdb.d + +COPY prepare-image.sh / +RUN /prepare-image.sh && rm -f /prepare-image.sh + +ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock + +COPY docker-entrypoint.sh /entrypoint.sh +COPY healthcheck.sh /healthcheck.sh +ENTRYPOINT ["/entrypoint.sh"] +HEALTHCHECK CMD /healthcheck.sh +EXPOSE 3306 33060 33061 +CMD ["mysqld"] + diff --git a/mysql-server/9.2/docker-entrypoint.sh b/mysql-server/9.2/docker-entrypoint.sh new file mode 100755 index 000000000..dc7c81e99 --- /dev/null +++ b/mysql-server/9.2/docker-entrypoint.sh @@ -0,0 +1,230 @@ +#!/bin/bash +# Copyright (c) 2017, 2021, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +echo "[Entrypoint] MySQL Docker Image 9.2.0-1.2.20-server" +# Fetch value from server config +# We use mysqld --verbose --help instead of my_print_defaults because the +# latter only show values present in config files, and not server defaults +_get_config() { + local conf="$1"; shift + "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' +} + +# Generate a random password +_mkpw() { + letter=$(cat /dev/urandom| tr -dc a-zA-Z | dd bs=1 count=16 2> /dev/null ) + number=$(cat /dev/urandom| tr -dc 0-9 | dd bs=1 count=8 2> /dev/null) + special=$(cat /dev/urandom| tr -dc '=+@#%^&*_.,;:?/' | dd bs=1 count=8 2> /dev/null) + + echo $letter$number$special | fold -w 1 | shuf | tr -d '\n' +} + +# If command starts with an option, prepend mysqld +# This allows users to add command-line options without +# needing to specify the "mysqld" command +if [ "${1:0:1}" = '-' ]; then + set -- mysqld "$@" +fi + +# Check if entrypoint (and the container) is running as root +if [ $(id -u) = "0" ]; then + is_root=1 + install_devnull="install /dev/null -m0600 -omysql -gmysql" + MYSQLD_USER=mysql +else + install_devnull="install /dev/null -m0600" + MYSQLD_USER=$(id -u) +fi + +if [ "$1" = 'mysqld' ]; then + # Test that the server can start. We redirect stdout to /dev/null so + # only the error messages are left. + result=0 + output=$("$@" --validate-config) || result=$? + if [ ! "$result" = "0" ]; then + echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' + echo >&2 "[Entrypoint] $output" + exit 1 + fi + + # Get config + DATADIR="$(_get_config 'datadir' "$@")" + SOCKET="$(_get_config 'socket' "$@")" + + if [ ! -d "$DATADIR/mysql" ]; then + # If the password variable is a filename we use the contents of the file. We + # read this first to make sure that a proper error is generated for empty files. + if [ -f "$MYSQL_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + if [ -z "$MYSQL_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' + exit 1 + fi + fi + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] No password option specified for new database.' + echo >&2 '[Entrypoint] A random onetime password will be generated.' + MYSQL_RANDOM_ROOT_PASSWORD=true + MYSQL_ONETIME_PASSWORD=true + fi + if [ ! -d "$DATADIR" ]; then + mkdir -p "$DATADIR" + chown mysql:mysql "$DATADIR" + fi + + # The user can set a default_timezone either in a my.cnf file + # they mount into the container or on command line + # (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`) + # however the timezone tables will only be populated in a later + # stage of this script. By using +00:00 as timezone we override + # the user's choice during initialization. Later the server + # will be restarted using the user's option. + + echo '[Entrypoint] Initializing database' + "$@" --user=$MYSQLD_USER --initialize-insecure --default-time-zone=+00:00 + + echo '[Entrypoint] Database initialized' + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" --default-time-zone=+00:00 + + # To avoid using password on commandline, put it in a temporary file. + # The file is only populated when and if the root password is set. + PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + $install_devnull "$PASSFILE" + # Define the client command used throughout the script + # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") + + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break + fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 + fi + + mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql + + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(_mkpw)" + echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + fi + if [ -z "$MYSQL_ROOT_HOST" ]; then + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';" + else + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ + GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + fi + "${mysql[@]}" <<-EOSQL + DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; + ${ROOTCREATE} + FLUSH PRIVILEGES ; + EOSQL + if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then + # Put the password into the temporary config file + cat >"$PASSFILE" < "$SQL" +ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL + fi + + echo + echo '[Entrypoint] MySQL init process done. Ready for start up.' + echo + fi + + # Used by healthcheck to make sure it doesn't mistakenly report container + # healthy during startup + # Put the password into the temporary config file + touch /var/lib/mysql-files/healthcheck.cnf + cat >"/var/lib/mysql-files/healthcheck.cnf" < Date: Wed, 22 Jan 2025 09:04:04 +0000 Subject: [PATCH 369/386] Release version 1.0.20-router * ET#83752 - Bump up version for weekly server & router pipelines * ET#83723 Bump versions for 8.0.41/8.4.4/9.2.0 Docker releases * ET#83033 - [Docker] Update weekly server, shell & router version --- mysql-router/8.0/Dockerfile | 6 +- mysql-router/8.0/inspec/control.rb | 4 +- mysql-router/8.4/Dockerfile | 6 +- mysql-router/8.4/inspec/control.rb | 4 +- mysql-router/9.2/Dockerfile | 39 +++++++++ mysql-router/9.2/README.md | 88 ++++++++++++++++++++ mysql-router/9.2/inspec/control.rb | 20 +++++ mysql-router/9.2/run.sh | 129 +++++++++++++++++++++++++++++ 8 files changed, 286 insertions(+), 10 deletions(-) create mode 100644 mysql-router/9.2/Dockerfile create mode 100644 mysql-router/9.2/README.md create mode 100644 mysql-router/9.2/inspec/control.rb create mode 100755 mysql-router/9.2/run.sh diff --git a/mysql-router/8.0/Dockerfile b/mysql-router/8.0/Dockerfile index 5e5c0f88b..f95098235 100644 --- a/mysql-router/8.0/Dockerfile +++ b/mysql-router/8.0/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.40 -ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.40 +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.41 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.41 ARG CONFIG_PACKAGE_NAME=mysql84-community-release-el9.rpm ARG REPO_NAME_SERVER=mysql80-community ARG REPO_NAME_TOOLS=mysql-tools-community @@ -23,7 +23,7 @@ ARG REPO_NAME_TOOLS=mysql-tools-community RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ -c "MySQL Router" mysqlrouter \ - && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/$CONFIG_PACKAGE_NAME \ + && rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/$CONFIG_PACKAGE_NAME \ && microdnf install -y \ --enablerepo=mysql80-community $MYSQL_CLIENT_PACKAGE \ && microdnf install -y --disablerepo=\* \ diff --git a/mysql-router/8.0/inspec/control.rb b/mysql-router/8.0/inspec/control.rb index 1cac045d6..7adf53942 100644 --- a/mysql-router/8.0/inspec/control.rb +++ b/mysql-router/8.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-client') do it { should be_installed } - its ('version') { should match '8.0.40.*' } + its ('version') { should match '8.0.41.*' } end describe package('mysql-router-community') do it { should be_installed } - its ('version') { should match '8.0.40.*' } + its ('version') { should match '8.0.41.*' } end end diff --git a/mysql-router/8.4/Dockerfile b/mysql-router/8.4/Dockerfile index f3b8be235..fce1df31f 100644 --- a/mysql-router/8.4/Dockerfile +++ b/mysql-router/8.4/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.4.3 -ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.4.3 +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.4.4 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.4.4 ARG CONFIG_PACKAGE_NAME=mysql84-community-release-el9.rpm ARG REPO_NAME_SERVER=mysql-8.4-lts-community ARG REPO_NAME_TOOLS=mysql-tools-8.4-lts-community @@ -23,7 +23,7 @@ ARG REPO_NAME_TOOLS=mysql-tools-8.4-lts-community RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ -c "MySQL Router" mysqlrouter \ - && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/$CONFIG_PACKAGE_NAME \ + && rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/$CONFIG_PACKAGE_NAME \ && microdnf install -y \ --enablerepo=mysql-8.4-lts-community $MYSQL_CLIENT_PACKAGE \ && microdnf install -y --disablerepo=\* \ diff --git a/mysql-router/8.4/inspec/control.rb b/mysql-router/8.4/inspec/control.rb index a2c1fee05..6d076d093 100644 --- a/mysql-router/8.4/inspec/control.rb +++ b/mysql-router/8.4/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-client') do it { should be_installed } - its ('version') { should match '8.4.3.*' } + its ('version') { should match '8.4.4.*' } end describe package('mysql-router-community') do it { should be_installed } - its ('version') { should match '8.4.3.*' } + its ('version') { should match '8.4.4.*' } end end diff --git a/mysql-router/9.2/Dockerfile b/mysql-router/9.2/Dockerfile new file mode 100644 index 000000000..cc735776e --- /dev/null +++ b/mysql-router/9.2/Dockerfile @@ -0,0 +1,39 @@ +# Copyright (c) 2018, 2023, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +FROM container-registry.oracle.com/os/oraclelinux:9-slim + +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-9.2.0 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-9.2.0 +ARG CONFIG_PACKAGE_NAME=mysql84-community-release-el9.rpm +ARG REPO_NAME_SERVER=mysql-innovation-community +ARG REPO_NAME_TOOLS=mysql-tools-innovation-community + +RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ + && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ + -c "MySQL Router" mysqlrouter \ + && rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/$CONFIG_PACKAGE_NAME \ + && microdnf install -y \ + --enablerepo=mysql-innovation-community $MYSQL_CLIENT_PACKAGE \ + && microdnf install -y --disablerepo=\* \ + --enablerepo=mysql-tools-innovation-community $MYSQL_ROUTER_PACKAGE \ + && microdnf clean all + +COPY run.sh /run.sh +HEALTHCHECK \ + CMD mysqladmin --port 6446 --protocol TCP ping 2>&1 | grep Access || exit 1 +EXPOSE 6446 6447 6448 6449 6450 8443 +USER 999:999 +ENTRYPOINT ["/run.sh"] +CMD ["mysqlrouter"] diff --git a/mysql-router/9.2/README.md b/mysql-router/9.2/README.md new file mode 100644 index 000000000..0f2711ba5 --- /dev/null +++ b/mysql-router/9.2/README.md @@ -0,0 +1,88 @@ +![logo](https://www.mysql.com/common/logos/logo-mysql-170x115.png) + +# What is MySQL Router? + +MySQL Router is part of InnoDB cluster, and is lightweight middleware that +provides transparent routing between your application and back-end MySQL +Servers. It can be used for a wide variety of use cases, such as providing high +availability and scalability by effectively routing database traffic to +appropriate back-end MySQL Servers. The pluggable architecture also enables +developers to extend MySQL Router for custom use cases. + +# Supported Tags and Respective Dockerfile Links + +* MySQL Router 8.0 (tag: [`latest`, `8.0`](https://github.com/mysql/mysql-docker/blob/mysql-router/8.0/Dockerfile)) ([mysql-router/8.0/Dockerfile](https://github.com/mysql/mysql-docker/blob/mysql-router/8.0/Dockerfile)) + +Images are updated when new MySQL Server maintenance releases and development milestones are published. Please note that non-GA releases are for preview purposes only and should not be used in production setups. + +# How to Use the MySQL Router Images + +The image currently uses the following mandatory variables: + +| Variable | Description | +| ------------------------ | ------------------------------------------- | +| MYSQL_HOST | MySQL host to connect to | +| MYSQL_PORT | Port to use | +| MYSQL_USER | User to connect with | +| MYSQL_PASSWORD | Password to connect with | + +Running in a container requires a working InnoDB cluster. + +The image uses the following optional variables: + +| Variable | Description | +| ------------------------------------ | ------------------------------------------- | +| MYSQL_INNODB_CLUSTER_MEMBERS | Wait for at least this number of cluster instances to be ONLINE | +| MYSQL_CREATE_ROUTER_USER | Whether to create a new account for the Router to use when it's running. Defaults to 1, set to 0 to disable. | +| MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS | Additional command line options applied while bootstrapping + +If supplied the run script waits for the given mysql host to be up, the InnoDB cluster to have +MYSQL_INNODB_CLUSTER_MEMBERS members and then uses the given server for its +bootstrap mode +[Bootstrapping](https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-deploying-bootstrapping.html). + +The image can be run via: + +``` +docker run -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -e MYSQL_INNODB_CLUSTER_MEMBERS=3 -ti mysql/mysql-router +``` + +Additional command line options for running MySQL Router after bootstrap can be passed a command options. For instance you can use a config file from your home directory like this: + +``` +docker run -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -ti -v $HOME/router-extra.conf:/tmp/router-extra.conf mysql/mysql-router mysqlrouter --extra-config=/tmp/router-extra.conf +``` + +It can be verified by typing: + +``` +docker ps +``` + +The following output should be displayed: + +``` +4954b1c80be1 mysql-router:8.0 "/run.sh mysqlrouter" About a minute ago Up About a minute (healthy) 6447/tcp, 6448/tcp, 0.0.0.0:6446->6446/tcp, 6449/tcp innodbcluster_mysql-router_1 +``` + +By default the container will run as user 999:999 which maps to mysqlrouter:mysqlrouter inside the container. + +# Exposed Ports + +The following TCP ports are exposed by the MySQL Router container: + +| Port | Description +| ----- | --------------------------------------------------------------------------------------- | +| 6446 | R/W connection port. Clients that connect to this port will be forwarded to the PRIMARY | +| 6447 | R/O connection port. Clients that connect to this port will be forwarded to a SECONDARY | +| 6448 | X Protocol R/W connection port. R/W port for X protocol client connections | +| 6449 | X Protocol R/O connection port. R/O port for X protocol client connections | +| 8443 | HTTPS REST interface port. | + +For more information about the REST interface API, see: + +https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-rest-api-reference.html + +For full usage documentation, see: + +https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-installation-docker.html diff --git a/mysql-router/9.2/inspec/control.rb b/mysql-router/9.2/inspec/control.rb new file mode 100644 index 000000000..8e41e14eb --- /dev/null +++ b/mysql-router/9.2/inspec/control.rb @@ -0,0 +1,20 @@ +control 'container' do + impact 0.5 + describe podman.containers do + its('status') { should cmp /Up/ } + its('commands') { should cmp /sleep/ } + its('images') { should cmp /mysql-router:9.2/ } + its('names') { should include "mysql-router-9.2" } + end +end +control 'packages' do + impact 0.5 + describe package('mysql-community-client') do + it { should be_installed } + its ('version') { should match '9.2.0.*' } + end + describe package('mysql-router-community') do + it { should be_installed } + its ('version') { should match '9.2.0.*' } + end +end diff --git a/mysql-router/9.2/run.sh b/mysql-router/9.2/run.sh new file mode 100755 index 000000000..79bb35080 --- /dev/null +++ b/mysql-router/9.2/run.sh @@ -0,0 +1,129 @@ +#!/bin/bash +# Copyright (c) 2018, 2024, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +if [[ -n $MYSQL_USER_FILE && -f $MYSQL_USER_FILE ]]; then + MYSQL_USER=$(cat $MYSQL_USER_FILE) +fi + +if [ "$1" = 'mysqlrouter' ]; then + if [[ -z $MYSQL_HOST || -z $MYSQL_PORT || -z $MYSQL_USER || (-z $MYSQL_PASSWORD && -z $MYSQL_PASSWORD_FILE) ]]; then + echo "We require all of" + echo " MYSQL_HOST" + echo " MYSQL_PORT" + echo " MYSQL_USER or MYSQL_USER_FILE" + echo " MYSQL_PASSWORD or MYSQL_PASSWORD_FILE" + echo "to be set." + echo "In addition you can set" + echo " MYSQL_INNODB_CLUSTER_MEMBERS" + echo " MYSQL_CREATE_ROUTER_USER" + echo " MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS" + echo "Exiting." + exit 1 + fi + + PASSFILE=$(mktemp) + if [[ -n $MYSQL_PASSWORD_FILE && -f "$MYSQL_PASSWORD_FILE" ]]; then + cat "$MYSQL_PASSWORD_FILE" > "$PASSFILE" + echo "" >> "$PASSFILE" + else + echo "$MYSQL_PASSWORD" > "$PASSFILE" + fi + if [ -z $MYSQL_CREATE_ROUTER_USER ]; then + if [[ -n $MYSQL_PASSWORD_FILE && -f "$MYSQL_PASSWORD_FILE" ]]; then + cat "$MYSQL_PASSWORD_FILE" >> "$PASSFILE" + echo "" >> "$PASSFILE" + else + echo "$MYSQL_PASSWORD" >> "$PASSFILE" + fi + MYSQL_CREATE_ROUTER_USER=1 + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is not set, Router will generate a new account to be used at runtime." + echo "[Entrypoint] Set it to 0 to reuse $MYSQL_USER instead." + elif [ "$MYSQL_CREATE_ROUTER_USER" = "0" ]; then + if [[ -n $MYSQL_PASSWORD_FILE && -f "$MYSQL_PASSWORD_FILE" ]]; then + cat "$MYSQL_PASSWORD_FILE" >> "$PASSFILE" + echo "" >> "$PASSFILE" + else + echo "$MYSQL_PASSWORD" >> "$PASSFILE" + fi + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is 0, Router will reuse $MYSQL_USER account at runtime" + else + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is not 0, Router will generate a new account to be used at runtime" + fi + + if [[ -n $MYSQL_PASSWORD_FILE && -f "$MYSQL_PASSWORD_FILE" ]]; then + DEFAULTS_EXTRA_FILE=$(mktemp) + cat >"$DEFAULTS_EXTRA_FILE" <"$DEFAULTS_EXTRA_FILE" < "/dev/tcp/$MYSQL_HOST/$MYSQL_PORT") >/dev/null 2>&1; do + echo "[Entrypoint] Waiting for mysql server $MYSQL_HOST ($attempt_num/$max_tries)" + sleep $(( attempt_num++ )) + if (( attempt_num == max_tries )); then + exit 1 + fi + done + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST:$MYSQL_PORT. Checking for cluster state." + if ! [[ "$(mysql --defaults-extra-file="$DEFAULTS_EXTRA_FILE" -u "$MYSQL_USER" -h "$MYSQL_HOST" -P "$MYSQL_PORT" -e "show status;" 2> /dev/null)" ]]; then + echo "[Entrypoint] ERROR: Can not connect to database. Exiting." + exit 1 + fi + if [[ -n $MYSQL_INNODB_CLUSTER_MEMBERS ]]; then + attempt_num=0 + echo $attempt_num + echo $max_tries + until [ "$(mysql --defaults-extra-file="$DEFAULTS_EXTRA_FILE" -u "$MYSQL_USER" -h "$MYSQL_HOST" -P "$MYSQL_PORT" -N performance_schema -e "select count(MEMBER_STATE) >= $MYSQL_INNODB_CLUSTER_MEMBERS from replication_group_members where MEMBER_STATE = 'ONLINE';" 2> /dev/null)" -eq 1 ]; do + echo "[Entrypoint] Waiting for $MYSQL_INNODB_CLUSTER_MEMBERS cluster instances to become available via $MYSQL_HOST ($attempt_num/$max_tries)" + sleep $(( attempt_num++ )) + if (( attempt_num == max_tries )); then + exit 1 + fi + done + echo "[Entrypoint] Successfully contacted cluster with $MYSQL_INNODB_CLUSTER_MEMBERS members. Bootstrapping." + fi + if [ $(id -u) = "0" ]; then + opt_user=--user=mysqlrouter + fi + if [ "$MYSQL_CREATE_ROUTER_USER" = "0" ]; then + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap reusing account \"$MYSQL_USER\"." + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force --account-create=never --account=$MYSQL_USER $opt_user $MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS < "$PASSFILE" || exit 1 + else + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap." + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force $opt_user $MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS < "$PASSFILE" || exit 1 + fi + + rm "$DEFAULTS_EXTRA_FILE" + + sed -i -e 's/logging_folder=.*$/logging_folder=/' /tmp/mysqlrouter/mysqlrouter.conf + echo "[Entrypoint] Starting mysql-router." + exec "$@" --config /tmp/mysqlrouter/mysqlrouter.conf + + rm $PASSFILE +else + exec "$@" +fi From e166c94f8f74c52660797da34bf033b1dc9424a4 Mon Sep 17 00:00:00 2001 From: Nawaz Nazeer Ahamed Date: Mon, 10 Mar 2025 04:29:07 +0100 Subject: [PATCH 370/386] Update Weekly pipeline version - Server/Router Change-Id: I58c1b91f4c6b5b83413d325f47530a577f4a264b --- mysql-router/VERSION | 12 ++++++------ mysql-server/VERSION | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/mysql-router/VERSION b/mysql-router/VERSION index 57cd1f016..91be2ac40 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -29,15 +29,15 @@ MYSQL_ROUTER_VERSIONS["8.0"]=8.0.41 MYSQL_ROUTER_VERSIONS["8.4"]=8.4.4 MYSQL_ROUTER_VERSIONS["innovation"]=9.2.0 -WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.42 -WEEKLY_ROUTER_VERSIONS["8.4"]=8.4.5 -WEEKLY_ROUTER_VERSIONS["innovation"]=9.3.0 +WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.43 +WEEKLY_ROUTER_VERSIONS["8.4"]=8.4.6 +WEEKLY_ROUTER_VERSIONS["innovation"]=9.4.0 declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS MYSQL_SERVER_VERSIONS["8.0"]=8.0.41 MYSQL_SERVER_VERSIONS["8.4"]=8.4.4 MYSQL_SERVER_VERSIONS["innovation"]=9.2.0 -WEEKLY_SERVER_VERSIONS["8.0"]=8.0.42 -WEEKLY_SERVER_VERSIONS["8.4"]=8.4.5 -WEEKLY_SERVER_VERSIONS["innovation"]=9.3.0 +WEEKLY_SERVER_VERSIONS["8.0"]=8.0.43 +WEEKLY_SERVER_VERSIONS["8.4"]=8.4.6 +WEEKLY_SERVER_VERSIONS["innovation"]=9.4.0 diff --git a/mysql-server/VERSION b/mysql-server/VERSION index 1067b7d12..7671330a6 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -29,15 +29,15 @@ MYSQL_SERVER_VERSIONS["8.0"]=8.0.41 MYSQL_SERVER_VERSIONS["8.4"]=8.4.4 MYSQL_SERVER_VERSIONS["innovation"]=9.2.0 -WEEKLY_SERVER_VERSIONS["8.0"]=8.0.42 -WEEKLY_SERVER_VERSIONS["8.4"]=8.4.5 -WEEKLY_SERVER_VERSIONS["innovation"]=9.3.0 +WEEKLY_SERVER_VERSIONS["8.0"]=8.0.43 +WEEKLY_SERVER_VERSIONS["8.4"]=8.4.6 +WEEKLY_SERVER_VERSIONS["innovation"]=9.4.0 declare -A MYSQL_SHELL_VERSIONS WEEKLY_SHELL_VERSIONS MYSQL_SHELL_VERSIONS["8.0"]=8.0.41 MYSQL_SHELL_VERSIONS["8.4"]=8.4.4 MYSQL_SHELL_VERSIONS["innovation"]=9.2.0 -WEEKLY_SHELL_VERSIONS["8.0"]=8.0.42 -WEEKLY_SHELL_VERSIONS["8.4"]=8.4.5 -WEEKLY_SHELL_VERSIONS["innovation"]=9.3.0 +WEEKLY_SHELL_VERSIONS["8.0"]=8.0.43 +WEEKLY_SHELL_VERSIONS["8.4"]=8.4.6 +WEEKLY_SHELL_VERSIONS["innovation"]=9.4.0 From 76cd3ce17e823cd1d8b6413f2bb0ef1b30887365 Mon Sep 17 00:00:00 2001 From: Suhani Goel Date: Mon, 24 Mar 2025 11:04:22 +0100 Subject: [PATCH 371/386] Bump versions for Docker releases Change-Id: I4d9234b5d6b59c0358fc16579e30f1bfe3155719 --- mysql-cluster/VERSION | 14 +++++++------- mysql-router/VERSION | 14 +++++++------- mysql-server/VERSION | 14 +++++++------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/mysql-cluster/VERSION b/mysql-cluster/VERSION index b67bc0904..35c3f7bdd 100644 --- a/mysql-cluster/VERSION +++ b/mysql-cluster/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.2.20-cluster +IMAGE_VERSION=1.2.21-cluster # LATEST is always set to the # current highest release, which is, @@ -25,14 +25,14 @@ LATEST_LTS="8.4" # like 'latest-8.4' or 'lts-84', etch declare -A MYSQL_CLUSTER_VERSIONS -MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.41 -MYSQL_CLUSTER_VERSIONS["8.4"]=8.4.4 -MYSQL_CLUSTER_VERSIONS["innovation"]=9.2.0 +MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.42 +MYSQL_CLUSTER_VERSIONS["8.4"]=8.4.5 +MYSQL_CLUSTER_VERSIONS["innovation"]=9.3.0 declare -A MYSQL_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["8.0"]=8.0.41 -MYSQL_SHELL_VERSIONS["8.4"]=8.4.4 -MYSQL_SHELL_VERSIONS["innovation"]=9.2.0 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.42 +MYSQL_SHELL_VERSIONS["8.4"]=8.4.5 +MYSQL_SHELL_VERSIONS["innovation"]=9.3.0 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["8.0"]="${MYSQL_CLUSTER_VERSIONS["8.0"]}-${IMAGE_VERSION}" diff --git a/mysql-router/VERSION b/mysql-router/VERSION index 91be2ac40..856fffe18 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.0.20-router +IMAGE_VERSION=1.0.21-router # LATEST is always set to the # current highest release, which is, @@ -25,18 +25,18 @@ LATEST_LTS="8.4" # like 'latest-8.4' or 'lts-84', etch declare -A MYSQL_ROUTER_VERSIONS WEEKLY_ROUTER_VERSIONS -MYSQL_ROUTER_VERSIONS["8.0"]=8.0.41 -MYSQL_ROUTER_VERSIONS["8.4"]=8.4.4 -MYSQL_ROUTER_VERSIONS["innovation"]=9.2.0 +MYSQL_ROUTER_VERSIONS["8.0"]=8.0.42 +MYSQL_ROUTER_VERSIONS["8.4"]=8.4.5 +MYSQL_ROUTER_VERSIONS["innovation"]=9.3.0 WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.43 WEEKLY_ROUTER_VERSIONS["8.4"]=8.4.6 WEEKLY_ROUTER_VERSIONS["innovation"]=9.4.0 declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["8.0"]=8.0.41 -MYSQL_SERVER_VERSIONS["8.4"]=8.4.4 -MYSQL_SERVER_VERSIONS["innovation"]=9.2.0 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.42 +MYSQL_SERVER_VERSIONS["8.4"]=8.4.5 +MYSQL_SERVER_VERSIONS["innovation"]=9.3.0 WEEKLY_SERVER_VERSIONS["8.0"]=8.0.43 WEEKLY_SERVER_VERSIONS["8.4"]=8.4.6 diff --git a/mysql-server/VERSION b/mysql-server/VERSION index 7671330a6..d3a02a007 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.2.20-server +IMAGE_VERSION=1.2.21-server # LATEST is always set to the # current highest release, which is, @@ -25,18 +25,18 @@ LATEST_LTS="8.4" # like 'latest-8.4' or 'lts-84', etc. declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["8.0"]=8.0.41 -MYSQL_SERVER_VERSIONS["8.4"]=8.4.4 -MYSQL_SERVER_VERSIONS["innovation"]=9.2.0 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.42 +MYSQL_SERVER_VERSIONS["8.4"]=8.4.5 +MYSQL_SERVER_VERSIONS["innovation"]=9.3.0 WEEKLY_SERVER_VERSIONS["8.0"]=8.0.43 WEEKLY_SERVER_VERSIONS["8.4"]=8.4.6 WEEKLY_SERVER_VERSIONS["innovation"]=9.4.0 declare -A MYSQL_SHELL_VERSIONS WEEKLY_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["8.0"]=8.0.41 -MYSQL_SHELL_VERSIONS["8.4"]=8.4.4 -MYSQL_SHELL_VERSIONS["innovation"]=9.2.0 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.42 +MYSQL_SHELL_VERSIONS["8.4"]=8.4.5 +MYSQL_SHELL_VERSIONS["innovation"]=9.3.0 WEEKLY_SHELL_VERSIONS["8.0"]=8.0.43 WEEKLY_SHELL_VERSIONS["8.4"]=8.4.6 From 55937ac7ed5da12cb13a07300b33c348936d598b Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 16 Apr 2025 07:48:00 +0000 Subject: [PATCH 372/386] Release version 1.2.21-server * Bump versions for Docker releases * Update Weekly pipeline version - Server/Router --- mysql-server/8.0/Dockerfile | 4 +- mysql-server/8.0/docker-entrypoint.sh | 4 +- mysql-server/8.0/inspec/control.rb | 4 +- mysql-server/8.4/Dockerfile | 4 +- mysql-server/8.4/docker-entrypoint.sh | 4 +- mysql-server/8.4/inspec/control.rb | 4 +- mysql-server/9.3/Dockerfile | 45 +++++ mysql-server/9.3/docker-entrypoint.sh | 230 ++++++++++++++++++++++++++ mysql-server/9.3/healthcheck.sh | 24 +++ mysql-server/9.3/inspec/control.rb | 20 +++ mysql-server/9.3/prepare-image.sh | 25 +++ 11 files changed, 356 insertions(+), 12 deletions(-) create mode 100644 mysql-server/9.3/Dockerfile create mode 100755 mysql-server/9.3/docker-entrypoint.sh create mode 100755 mysql-server/9.3/healthcheck.sh create mode 100644 mysql-server/9.3/inspec/control.rb create mode 100755 mysql-server/9.3/prepare-image.sh diff --git a/mysql-server/8.0/Dockerfile b/mysql-server/8.0/Dockerfile index d49e956bd..ac624de20 100644 --- a/mysql-server/8.0/Dockerfile +++ b/mysql-server/8.0/Dockerfile @@ -15,8 +15,8 @@ FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.41 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.41 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.42 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.42 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ diff --git a/mysql-server/8.0/docker-entrypoint.sh b/mysql-server/8.0/docker-entrypoint.sh index 542bc27ef..0eaeb87a9 100755 --- a/mysql-server/8.0/docker-entrypoint.sh +++ b/mysql-server/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.41-1.2.20-server" +echo "[Entrypoint] MySQL Docker Image 8.0.42-1.2.21-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.41-1.2.20-server" + echo "[Entrypoint] Starting MySQL 8.0.42-1.2.21-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/8.0/inspec/control.rb b/mysql-server/8.0/inspec/control.rb index 40b36ca5d..f3a1abbd1 100644 --- a/mysql-server/8.0/inspec/control.rb +++ b/mysql-server/8.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.41.*' } + its ('version') { should match '8.0.42.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.41.*' } + its ('version') { should match '8.0.42.*' } end end diff --git a/mysql-server/8.4/Dockerfile b/mysql-server/8.4/Dockerfile index 15f41d189..937a1dadc 100644 --- a/mysql-server/8.4/Dockerfile +++ b/mysql-server/8.4/Dockerfile @@ -15,8 +15,8 @@ FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.4.4 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.4.4 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.4.5 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.4.5 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ diff --git a/mysql-server/8.4/docker-entrypoint.sh b/mysql-server/8.4/docker-entrypoint.sh index 136789761..a50c50bc9 100755 --- a/mysql-server/8.4/docker-entrypoint.sh +++ b/mysql-server/8.4/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.4.4-1.2.20-server" +echo "[Entrypoint] MySQL Docker Image 8.4.5-1.2.21-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.4.4-1.2.20-server" + echo "[Entrypoint] Starting MySQL 8.4.5-1.2.21-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/8.4/inspec/control.rb b/mysql-server/8.4/inspec/control.rb index c6c0282a4..b757a4417 100644 --- a/mysql-server/8.4/inspec/control.rb +++ b/mysql-server/8.4/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.4.4.*' } + its ('version') { should match '8.4.5.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.4.4.*' } + its ('version') { should match '8.4.5.*' } end end diff --git a/mysql-server/9.3/Dockerfile b/mysql-server/9.3/Dockerfile new file mode 100644 index 000000000..c0a024017 --- /dev/null +++ b/mysql-server/9.3/Dockerfile @@ -0,0 +1,45 @@ +# Copyright (c) 2017, 2023, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +FROM container-registry.oracle.com/os/oraclelinux:9-slim + +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-9.3.0 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-9.3.0 + +# Setup repositories for minimal packages (all versions) +RUN rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ + && rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm + +# Install server and shell 8.0 +RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ + && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --disablerepo=ol9_appstream \ + --enablerepo=mysql-innovation-community-minimal $MYSQL_SERVER_PACKAGE \ + && microdnf remove -y mysql-community-minimal-release mysql84-community-release \ + && microdnf clean all \ + && mkdir /docker-entrypoint-initdb.d + +COPY prepare-image.sh / +RUN /prepare-image.sh && rm -f /prepare-image.sh + +ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock + +COPY docker-entrypoint.sh /entrypoint.sh +COPY healthcheck.sh /healthcheck.sh +ENTRYPOINT ["/entrypoint.sh"] +HEALTHCHECK CMD /healthcheck.sh +EXPOSE 3306 33060 33061 +CMD ["mysqld"] + diff --git a/mysql-server/9.3/docker-entrypoint.sh b/mysql-server/9.3/docker-entrypoint.sh new file mode 100755 index 000000000..856f30060 --- /dev/null +++ b/mysql-server/9.3/docker-entrypoint.sh @@ -0,0 +1,230 @@ +#!/bin/bash +# Copyright (c) 2017, 2021, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +echo "[Entrypoint] MySQL Docker Image 9.3.0-1.2.21-server" +# Fetch value from server config +# We use mysqld --verbose --help instead of my_print_defaults because the +# latter only show values present in config files, and not server defaults +_get_config() { + local conf="$1"; shift + "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' +} + +# Generate a random password +_mkpw() { + letter=$(cat /dev/urandom| tr -dc a-zA-Z | dd bs=1 count=16 2> /dev/null ) + number=$(cat /dev/urandom| tr -dc 0-9 | dd bs=1 count=8 2> /dev/null) + special=$(cat /dev/urandom| tr -dc '=+@#%^&*_.,;:?/' | dd bs=1 count=8 2> /dev/null) + + echo $letter$number$special | fold -w 1 | shuf | tr -d '\n' +} + +# If command starts with an option, prepend mysqld +# This allows users to add command-line options without +# needing to specify the "mysqld" command +if [ "${1:0:1}" = '-' ]; then + set -- mysqld "$@" +fi + +# Check if entrypoint (and the container) is running as root +if [ $(id -u) = "0" ]; then + is_root=1 + install_devnull="install /dev/null -m0600 -omysql -gmysql" + MYSQLD_USER=mysql +else + install_devnull="install /dev/null -m0600" + MYSQLD_USER=$(id -u) +fi + +if [ "$1" = 'mysqld' ]; then + # Test that the server can start. We redirect stdout to /dev/null so + # only the error messages are left. + result=0 + output=$("$@" --validate-config) || result=$? + if [ ! "$result" = "0" ]; then + echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' + echo >&2 "[Entrypoint] $output" + exit 1 + fi + + # Get config + DATADIR="$(_get_config 'datadir' "$@")" + SOCKET="$(_get_config 'socket' "$@")" + + if [ ! -d "$DATADIR/mysql" ]; then + # If the password variable is a filename we use the contents of the file. We + # read this first to make sure that a proper error is generated for empty files. + if [ -f "$MYSQL_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + if [ -z "$MYSQL_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' + exit 1 + fi + fi + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] No password option specified for new database.' + echo >&2 '[Entrypoint] A random onetime password will be generated.' + MYSQL_RANDOM_ROOT_PASSWORD=true + MYSQL_ONETIME_PASSWORD=true + fi + if [ ! -d "$DATADIR" ]; then + mkdir -p "$DATADIR" + chown mysql:mysql "$DATADIR" + fi + + # The user can set a default_timezone either in a my.cnf file + # they mount into the container or on command line + # (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`) + # however the timezone tables will only be populated in a later + # stage of this script. By using +00:00 as timezone we override + # the user's choice during initialization. Later the server + # will be restarted using the user's option. + + echo '[Entrypoint] Initializing database' + "$@" --user=$MYSQLD_USER --initialize-insecure --default-time-zone=+00:00 + + echo '[Entrypoint] Database initialized' + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" --default-time-zone=+00:00 + + # To avoid using password on commandline, put it in a temporary file. + # The file is only populated when and if the root password is set. + PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + $install_devnull "$PASSFILE" + # Define the client command used throughout the script + # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") + + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break + fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 + fi + + mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql + + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(_mkpw)" + echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + fi + if [ -z "$MYSQL_ROOT_HOST" ]; then + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';" + else + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ + GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + fi + "${mysql[@]}" <<-EOSQL + DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; + ${ROOTCREATE} + FLUSH PRIVILEGES ; + EOSQL + if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then + # Put the password into the temporary config file + cat >"$PASSFILE" < "$SQL" +ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL + fi + + echo + echo '[Entrypoint] MySQL init process done. Ready for start up.' + echo + fi + + # Used by healthcheck to make sure it doesn't mistakenly report container + # healthy during startup + # Put the password into the temporary config file + touch /var/lib/mysql-files/healthcheck.cnf + cat >"/var/lib/mysql-files/healthcheck.cnf" < Date: Wed, 16 Apr 2025 08:17:27 +0000 Subject: [PATCH 373/386] Release version 1.0.21-router * Bump versions for Docker releases * Update Weekly pipeline version - Server/Router --- mysql-router/8.0/Dockerfile | 4 +- mysql-router/8.0/inspec/control.rb | 4 +- mysql-router/8.4/Dockerfile | 4 +- mysql-router/8.4/inspec/control.rb | 4 +- mysql-router/9.3/Dockerfile | 39 +++++++++ mysql-router/9.3/README.md | 88 ++++++++++++++++++++ mysql-router/9.3/inspec/control.rb | 20 +++++ mysql-router/9.3/run.sh | 129 +++++++++++++++++++++++++++++ 8 files changed, 284 insertions(+), 8 deletions(-) create mode 100644 mysql-router/9.3/Dockerfile create mode 100644 mysql-router/9.3/README.md create mode 100644 mysql-router/9.3/inspec/control.rb create mode 100755 mysql-router/9.3/run.sh diff --git a/mysql-router/8.0/Dockerfile b/mysql-router/8.0/Dockerfile index f95098235..66652e1bb 100644 --- a/mysql-router/8.0/Dockerfile +++ b/mysql-router/8.0/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.41 -ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.41 +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.42 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.42 ARG CONFIG_PACKAGE_NAME=mysql84-community-release-el9.rpm ARG REPO_NAME_SERVER=mysql80-community ARG REPO_NAME_TOOLS=mysql-tools-community diff --git a/mysql-router/8.0/inspec/control.rb b/mysql-router/8.0/inspec/control.rb index 7adf53942..88858dcde 100644 --- a/mysql-router/8.0/inspec/control.rb +++ b/mysql-router/8.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-client') do it { should be_installed } - its ('version') { should match '8.0.41.*' } + its ('version') { should match '8.0.42.*' } end describe package('mysql-router-community') do it { should be_installed } - its ('version') { should match '8.0.41.*' } + its ('version') { should match '8.0.42.*' } end end diff --git a/mysql-router/8.4/Dockerfile b/mysql-router/8.4/Dockerfile index fce1df31f..3146779d3 100644 --- a/mysql-router/8.4/Dockerfile +++ b/mysql-router/8.4/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.4.4 -ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.4.4 +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.4.5 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.4.5 ARG CONFIG_PACKAGE_NAME=mysql84-community-release-el9.rpm ARG REPO_NAME_SERVER=mysql-8.4-lts-community ARG REPO_NAME_TOOLS=mysql-tools-8.4-lts-community diff --git a/mysql-router/8.4/inspec/control.rb b/mysql-router/8.4/inspec/control.rb index 6d076d093..62144db58 100644 --- a/mysql-router/8.4/inspec/control.rb +++ b/mysql-router/8.4/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-client') do it { should be_installed } - its ('version') { should match '8.4.4.*' } + its ('version') { should match '8.4.5.*' } end describe package('mysql-router-community') do it { should be_installed } - its ('version') { should match '8.4.4.*' } + its ('version') { should match '8.4.5.*' } end end diff --git a/mysql-router/9.3/Dockerfile b/mysql-router/9.3/Dockerfile new file mode 100644 index 000000000..75564047c --- /dev/null +++ b/mysql-router/9.3/Dockerfile @@ -0,0 +1,39 @@ +# Copyright (c) 2018, 2023, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +FROM container-registry.oracle.com/os/oraclelinux:9-slim + +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-9.3.0 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-9.3.0 +ARG CONFIG_PACKAGE_NAME=mysql84-community-release-el9.rpm +ARG REPO_NAME_SERVER=mysql-innovation-community +ARG REPO_NAME_TOOLS=mysql-tools-innovation-community + +RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ + && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ + -c "MySQL Router" mysqlrouter \ + && rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/$CONFIG_PACKAGE_NAME \ + && microdnf install -y \ + --enablerepo=mysql-innovation-community $MYSQL_CLIENT_PACKAGE \ + && microdnf install -y --disablerepo=\* \ + --enablerepo=mysql-tools-innovation-community $MYSQL_ROUTER_PACKAGE \ + && microdnf clean all + +COPY run.sh /run.sh +HEALTHCHECK \ + CMD mysqladmin --port 6446 --protocol TCP ping 2>&1 | grep Access || exit 1 +EXPOSE 6446 6447 6448 6449 6450 8443 +USER 999:999 +ENTRYPOINT ["/run.sh"] +CMD ["mysqlrouter"] diff --git a/mysql-router/9.3/README.md b/mysql-router/9.3/README.md new file mode 100644 index 000000000..0f2711ba5 --- /dev/null +++ b/mysql-router/9.3/README.md @@ -0,0 +1,88 @@ +![logo](https://www.mysql.com/common/logos/logo-mysql-170x115.png) + +# What is MySQL Router? + +MySQL Router is part of InnoDB cluster, and is lightweight middleware that +provides transparent routing between your application and back-end MySQL +Servers. It can be used for a wide variety of use cases, such as providing high +availability and scalability by effectively routing database traffic to +appropriate back-end MySQL Servers. The pluggable architecture also enables +developers to extend MySQL Router for custom use cases. + +# Supported Tags and Respective Dockerfile Links + +* MySQL Router 8.0 (tag: [`latest`, `8.0`](https://github.com/mysql/mysql-docker/blob/mysql-router/8.0/Dockerfile)) ([mysql-router/8.0/Dockerfile](https://github.com/mysql/mysql-docker/blob/mysql-router/8.0/Dockerfile)) + +Images are updated when new MySQL Server maintenance releases and development milestones are published. Please note that non-GA releases are for preview purposes only and should not be used in production setups. + +# How to Use the MySQL Router Images + +The image currently uses the following mandatory variables: + +| Variable | Description | +| ------------------------ | ------------------------------------------- | +| MYSQL_HOST | MySQL host to connect to | +| MYSQL_PORT | Port to use | +| MYSQL_USER | User to connect with | +| MYSQL_PASSWORD | Password to connect with | + +Running in a container requires a working InnoDB cluster. + +The image uses the following optional variables: + +| Variable | Description | +| ------------------------------------ | ------------------------------------------- | +| MYSQL_INNODB_CLUSTER_MEMBERS | Wait for at least this number of cluster instances to be ONLINE | +| MYSQL_CREATE_ROUTER_USER | Whether to create a new account for the Router to use when it's running. Defaults to 1, set to 0 to disable. | +| MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS | Additional command line options applied while bootstrapping + +If supplied the run script waits for the given mysql host to be up, the InnoDB cluster to have +MYSQL_INNODB_CLUSTER_MEMBERS members and then uses the given server for its +bootstrap mode +[Bootstrapping](https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-deploying-bootstrapping.html). + +The image can be run via: + +``` +docker run -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -e MYSQL_INNODB_CLUSTER_MEMBERS=3 -ti mysql/mysql-router +``` + +Additional command line options for running MySQL Router after bootstrap can be passed a command options. For instance you can use a config file from your home directory like this: + +``` +docker run -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -ti -v $HOME/router-extra.conf:/tmp/router-extra.conf mysql/mysql-router mysqlrouter --extra-config=/tmp/router-extra.conf +``` + +It can be verified by typing: + +``` +docker ps +``` + +The following output should be displayed: + +``` +4954b1c80be1 mysql-router:8.0 "/run.sh mysqlrouter" About a minute ago Up About a minute (healthy) 6447/tcp, 6448/tcp, 0.0.0.0:6446->6446/tcp, 6449/tcp innodbcluster_mysql-router_1 +``` + +By default the container will run as user 999:999 which maps to mysqlrouter:mysqlrouter inside the container. + +# Exposed Ports + +The following TCP ports are exposed by the MySQL Router container: + +| Port | Description +| ----- | --------------------------------------------------------------------------------------- | +| 6446 | R/W connection port. Clients that connect to this port will be forwarded to the PRIMARY | +| 6447 | R/O connection port. Clients that connect to this port will be forwarded to a SECONDARY | +| 6448 | X Protocol R/W connection port. R/W port for X protocol client connections | +| 6449 | X Protocol R/O connection port. R/O port for X protocol client connections | +| 8443 | HTTPS REST interface port. | + +For more information about the REST interface API, see: + +https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-rest-api-reference.html + +For full usage documentation, see: + +https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-installation-docker.html diff --git a/mysql-router/9.3/inspec/control.rb b/mysql-router/9.3/inspec/control.rb new file mode 100644 index 000000000..d9c059bca --- /dev/null +++ b/mysql-router/9.3/inspec/control.rb @@ -0,0 +1,20 @@ +control 'container' do + impact 0.5 + describe podman.containers do + its('status') { should cmp /Up/ } + its('commands') { should cmp /sleep/ } + its('images') { should cmp /mysql-router:9.3/ } + its('names') { should include "mysql-router-9.3" } + end +end +control 'packages' do + impact 0.5 + describe package('mysql-community-client') do + it { should be_installed } + its ('version') { should match '9.3.0.*' } + end + describe package('mysql-router-community') do + it { should be_installed } + its ('version') { should match '9.3.0.*' } + end +end diff --git a/mysql-router/9.3/run.sh b/mysql-router/9.3/run.sh new file mode 100755 index 000000000..79bb35080 --- /dev/null +++ b/mysql-router/9.3/run.sh @@ -0,0 +1,129 @@ +#!/bin/bash +# Copyright (c) 2018, 2024, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +if [[ -n $MYSQL_USER_FILE && -f $MYSQL_USER_FILE ]]; then + MYSQL_USER=$(cat $MYSQL_USER_FILE) +fi + +if [ "$1" = 'mysqlrouter' ]; then + if [[ -z $MYSQL_HOST || -z $MYSQL_PORT || -z $MYSQL_USER || (-z $MYSQL_PASSWORD && -z $MYSQL_PASSWORD_FILE) ]]; then + echo "We require all of" + echo " MYSQL_HOST" + echo " MYSQL_PORT" + echo " MYSQL_USER or MYSQL_USER_FILE" + echo " MYSQL_PASSWORD or MYSQL_PASSWORD_FILE" + echo "to be set." + echo "In addition you can set" + echo " MYSQL_INNODB_CLUSTER_MEMBERS" + echo " MYSQL_CREATE_ROUTER_USER" + echo " MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS" + echo "Exiting." + exit 1 + fi + + PASSFILE=$(mktemp) + if [[ -n $MYSQL_PASSWORD_FILE && -f "$MYSQL_PASSWORD_FILE" ]]; then + cat "$MYSQL_PASSWORD_FILE" > "$PASSFILE" + echo "" >> "$PASSFILE" + else + echo "$MYSQL_PASSWORD" > "$PASSFILE" + fi + if [ -z $MYSQL_CREATE_ROUTER_USER ]; then + if [[ -n $MYSQL_PASSWORD_FILE && -f "$MYSQL_PASSWORD_FILE" ]]; then + cat "$MYSQL_PASSWORD_FILE" >> "$PASSFILE" + echo "" >> "$PASSFILE" + else + echo "$MYSQL_PASSWORD" >> "$PASSFILE" + fi + MYSQL_CREATE_ROUTER_USER=1 + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is not set, Router will generate a new account to be used at runtime." + echo "[Entrypoint] Set it to 0 to reuse $MYSQL_USER instead." + elif [ "$MYSQL_CREATE_ROUTER_USER" = "0" ]; then + if [[ -n $MYSQL_PASSWORD_FILE && -f "$MYSQL_PASSWORD_FILE" ]]; then + cat "$MYSQL_PASSWORD_FILE" >> "$PASSFILE" + echo "" >> "$PASSFILE" + else + echo "$MYSQL_PASSWORD" >> "$PASSFILE" + fi + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is 0, Router will reuse $MYSQL_USER account at runtime" + else + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is not 0, Router will generate a new account to be used at runtime" + fi + + if [[ -n $MYSQL_PASSWORD_FILE && -f "$MYSQL_PASSWORD_FILE" ]]; then + DEFAULTS_EXTRA_FILE=$(mktemp) + cat >"$DEFAULTS_EXTRA_FILE" <"$DEFAULTS_EXTRA_FILE" < "/dev/tcp/$MYSQL_HOST/$MYSQL_PORT") >/dev/null 2>&1; do + echo "[Entrypoint] Waiting for mysql server $MYSQL_HOST ($attempt_num/$max_tries)" + sleep $(( attempt_num++ )) + if (( attempt_num == max_tries )); then + exit 1 + fi + done + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST:$MYSQL_PORT. Checking for cluster state." + if ! [[ "$(mysql --defaults-extra-file="$DEFAULTS_EXTRA_FILE" -u "$MYSQL_USER" -h "$MYSQL_HOST" -P "$MYSQL_PORT" -e "show status;" 2> /dev/null)" ]]; then + echo "[Entrypoint] ERROR: Can not connect to database. Exiting." + exit 1 + fi + if [[ -n $MYSQL_INNODB_CLUSTER_MEMBERS ]]; then + attempt_num=0 + echo $attempt_num + echo $max_tries + until [ "$(mysql --defaults-extra-file="$DEFAULTS_EXTRA_FILE" -u "$MYSQL_USER" -h "$MYSQL_HOST" -P "$MYSQL_PORT" -N performance_schema -e "select count(MEMBER_STATE) >= $MYSQL_INNODB_CLUSTER_MEMBERS from replication_group_members where MEMBER_STATE = 'ONLINE';" 2> /dev/null)" -eq 1 ]; do + echo "[Entrypoint] Waiting for $MYSQL_INNODB_CLUSTER_MEMBERS cluster instances to become available via $MYSQL_HOST ($attempt_num/$max_tries)" + sleep $(( attempt_num++ )) + if (( attempt_num == max_tries )); then + exit 1 + fi + done + echo "[Entrypoint] Successfully contacted cluster with $MYSQL_INNODB_CLUSTER_MEMBERS members. Bootstrapping." + fi + if [ $(id -u) = "0" ]; then + opt_user=--user=mysqlrouter + fi + if [ "$MYSQL_CREATE_ROUTER_USER" = "0" ]; then + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap reusing account \"$MYSQL_USER\"." + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force --account-create=never --account=$MYSQL_USER $opt_user $MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS < "$PASSFILE" || exit 1 + else + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap." + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force $opt_user $MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS < "$PASSFILE" || exit 1 + fi + + rm "$DEFAULTS_EXTRA_FILE" + + sed -i -e 's/logging_folder=.*$/logging_folder=/' /tmp/mysqlrouter/mysqlrouter.conf + echo "[Entrypoint] Starting mysql-router." + exec "$@" --config /tmp/mysqlrouter/mysqlrouter.conf + + rm $PASSFILE +else + exec "$@" +fi From 8b08ccf608b54dba2d0c6ff910ecb318e85eb9ee Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 16 Apr 2025 09:27:22 +0000 Subject: [PATCH 374/386] Release version 1.0.21-router * Release version 1.0.21-router * Bump versions for Docker releases * Update Weekly pipeline version - Server/Router From 4e000b373dc8a2b9fb97fa7562cb8795bd710fb7 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 16 Apr 2025 15:02:55 +0000 Subject: [PATCH 375/386] Release version 1.0.21-router * Release version 1.0.21-router * Bump versions for Docker releases * Update Weekly pipeline version - Server/Router From 4d3f29e04ed502cb7baff899c7eaf87c6ffb1a68 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 16 Apr 2025 16:22:45 +0000 Subject: [PATCH 376/386] Release version 1.2.21-cluster * Bump versions for Docker releases --- mysql-cluster/8.0/Dockerfile | 4 +- mysql-cluster/8.0/docker-entrypoint.sh | 4 +- mysql-cluster/8.0/inspec/control.rb | 4 +- mysql-cluster/8.4/Dockerfile | 4 +- mysql-cluster/8.4/docker-entrypoint.sh | 4 +- mysql-cluster/8.4/inspec/control.rb | 4 +- mysql-cluster/9.3/Dockerfile | 47 +++++ mysql-cluster/9.3/cnf/my.cnf | 22 ++ mysql-cluster/9.3/cnf/mysql-cluster.cnf | 39 ++++ mysql-cluster/9.3/docker-entrypoint.sh | 264 ++++++++++++++++++++++++ mysql-cluster/9.3/healthcheck.sh | 24 +++ mysql-cluster/9.3/inspec/control.rb | 20 ++ mysql-cluster/9.3/prepare-image.sh | 25 +++ 13 files changed, 453 insertions(+), 12 deletions(-) create mode 100644 mysql-cluster/9.3/Dockerfile create mode 100644 mysql-cluster/9.3/cnf/my.cnf create mode 100644 mysql-cluster/9.3/cnf/mysql-cluster.cnf create mode 100755 mysql-cluster/9.3/docker-entrypoint.sh create mode 100755 mysql-cluster/9.3/healthcheck.sh create mode 100644 mysql-cluster/9.3/inspec/control.rb create mode 100755 mysql-cluster/9.3/prepare-image.sh diff --git a/mysql-cluster/8.0/Dockerfile b/mysql-cluster/8.0/Dockerfile index 61f6dfce4..926f37787 100644 --- a/mysql-cluster/8.0/Dockerfile +++ b/mysql-cluster/8.0/Dockerfile @@ -15,8 +15,8 @@ FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.0.41 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.41 +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.0.42 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.42 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ diff --git a/mysql-cluster/8.0/docker-entrypoint.sh b/mysql-cluster/8.0/docker-entrypoint.sh index f6f5c65d8..d5ef630d7 100755 --- a/mysql-cluster/8.0/docker-entrypoint.sh +++ b/mysql-cluster/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.41-1.2.20-cluster" +echo "[Entrypoint] MySQL Docker Image 8.0.42-1.2.21-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -227,7 +227,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.41-1.2.20-cluster" + echo "[Entrypoint] Starting MySQL 8.0.42-1.2.21-cluster" fi export MYSQLD_PARENT_PID=$$ ; exec "$@" --user= else diff --git a/mysql-cluster/8.0/inspec/control.rb b/mysql-cluster/8.0/inspec/control.rb index f695c9f51..75e7389e3 100644 --- a/mysql-cluster/8.0/inspec/control.rb +++ b/mysql-cluster/8.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.41.*' } + its ('version') { should match '8.0.42.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.41.*' } + its ('version') { should match '8.0.42.*' } end end diff --git a/mysql-cluster/8.4/Dockerfile b/mysql-cluster/8.4/Dockerfile index 0b8944515..bb479204b 100644 --- a/mysql-cluster/8.4/Dockerfile +++ b/mysql-cluster/8.4/Dockerfile @@ -15,8 +15,8 @@ FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.4.4 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.4.4 +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.4.5 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.4.5 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ diff --git a/mysql-cluster/8.4/docker-entrypoint.sh b/mysql-cluster/8.4/docker-entrypoint.sh index eb05cb23d..5275d7547 100755 --- a/mysql-cluster/8.4/docker-entrypoint.sh +++ b/mysql-cluster/8.4/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.4.4-1.2.20-cluster" +echo "[Entrypoint] MySQL Docker Image 8.4.5-1.2.21-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -227,7 +227,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.4.4-1.2.20-cluster" + echo "[Entrypoint] Starting MySQL 8.4.5-1.2.21-cluster" fi export MYSQLD_PARENT_PID=$$ ; exec "$@" --user= else diff --git a/mysql-cluster/8.4/inspec/control.rb b/mysql-cluster/8.4/inspec/control.rb index f8e648303..1f09cec38 100644 --- a/mysql-cluster/8.4/inspec/control.rb +++ b/mysql-cluster/8.4/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.4.4.*' } + its ('version') { should match '8.4.5.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.4.4.*' } + its ('version') { should match '8.4.5.*' } end end diff --git a/mysql-cluster/9.3/Dockerfile b/mysql-cluster/9.3/Dockerfile new file mode 100644 index 000000000..9bb5900a7 --- /dev/null +++ b/mysql-cluster/9.3/Dockerfile @@ -0,0 +1,47 @@ +# Copyright (c) 2017, 2023, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +FROM container-registry.oracle.com/os/oraclelinux:9-slim + +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-9.3.0 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-9.3.0 + +# Setup repositories for minimal packages (all versions) +RUN rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ + && rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm + +# Install server and shell 8.0 +RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ + && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --disablerepo=ol9_appstream \ + --enablerepo=mysql-cluster-innovation-community-minimal $MYSQL_SERVER_PACKAGE \ + && microdnf clean all \ + && mkdir /docker-entrypoint-initdb.d + +COPY prepare-image.sh / +RUN /prepare-image.sh && rm -f /prepare-image.sh + +ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock + +COPY docker-entrypoint.sh /entrypoint.sh +COPY healthcheck.sh /healthcheck.sh +COPY cnf/my.cnf /etc/ +COPY cnf/mysql-cluster.cnf /etc/ + +ENTRYPOINT ["/entrypoint.sh"] +HEALTHCHECK CMD /healthcheck.sh +EXPOSE 3306 33060-33061 2202 1186 +CMD ["mysqld"] + diff --git a/mysql-cluster/9.3/cnf/my.cnf b/mysql-cluster/9.3/cnf/my.cnf new file mode 100644 index 000000000..ec98b2dc1 --- /dev/null +++ b/mysql-cluster/9.3/cnf/my.cnf @@ -0,0 +1,22 @@ +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +[mysqld] +ndbcluster +ndb-connectstring=192.168.0.2 +user=mysql + +[mysql_cluster] +ndb-connectstring=192.168.0.2 diff --git a/mysql-cluster/9.3/cnf/mysql-cluster.cnf b/mysql-cluster/9.3/cnf/mysql-cluster.cnf new file mode 100644 index 000000000..16f79f1c0 --- /dev/null +++ b/mysql-cluster/9.3/cnf/mysql-cluster.cnf @@ -0,0 +1,39 @@ +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +[ndbd default] +NoOfReplicas=2 +DataMemory=80M +IndexMemory=18M + + +[ndb_mgmd] +NodeId=1 +hostname=192.168.0.2 +datadir=/var/lib/mysql + +[ndbd] +NodeId=2 +hostname=192.168.0.3 +datadir=/var/lib/mysql + +[ndbd] +NodeId=3 +hostname=192.168.0.4 +datadir=/var/lib/mysql + +[mysqld] +NodeId=4 +hostname=192.168.0.10 diff --git a/mysql-cluster/9.3/docker-entrypoint.sh b/mysql-cluster/9.3/docker-entrypoint.sh new file mode 100755 index 000000000..9c130f143 --- /dev/null +++ b/mysql-cluster/9.3/docker-entrypoint.sh @@ -0,0 +1,264 @@ +#!/bin/bash +# Copyright (c) 2017, 2021, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +echo "[Entrypoint] MySQL Docker Image " +# Fetch value from server config +# We use mysqld --verbose --help instead of my_print_defaults because the +# latter only show values present in config files, and not server defaults +_get_config() { + local conf="$1"; shift + "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' +} + +# Generate a random password +_mkpw() { + letter=$(cat /dev/urandom| tr -dc a-zA-Z | dd bs=1 count=16 2> /dev/null ) + number=$(cat /dev/urandom| tr -dc 0-9 | dd bs=1 count=8 2> /dev/null) + special=$(cat /dev/urandom| tr -dc '=+@#%^&*_.,;:?/' | dd bs=1 count=8 2> /dev/null) + + echo $letter$number$special | fold -w 1 | shuf | tr -d '\n' +} + +# If command starts with an option, prepend mysqld +# This allows users to add command-line options without +# needing to specify the "mysqld" command +if [ "${1:0:1}" = '-' ]; then + set -- mysqld "$@" +fi + +# Check if entrypoint (and the container) is running as root +if [ $(id -u) = "0" ]; then + is_root=1 + install_devnull="install /dev/null -m0600 -omysql -gmysql" + MYSQLD_USER=mysql +else + install_devnull="install /dev/null -m0600" + MYSQLD_USER=$(id -u) +fi + +if [ "$1" = 'mysqld' ]; then + # Test that the server can start. We redirect stdout to /dev/null so + # only the error messages are left. + result=0 + output=$("$@" --validate-config) || result=$? + if [ ! "$result" = "0" ]; then + echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' + echo >&2 "[Entrypoint] $output" + exit 1 + fi + + # Get config + DATADIR="$(_get_config 'datadir' "$@")" + SOCKET="$(_get_config 'socket' "$@")" + + if [ ! -d "$DATADIR/mysql" ]; then + # If the password variable is a filename we use the contents of the file. We + # read this first to make sure that a proper error is generated for empty files. + if [ -f "$MYSQL_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + if [ -z "$MYSQL_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' + exit 1 + fi + fi + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] No password option specified for new database.' + echo >&2 '[Entrypoint] A random onetime password will be generated.' + MYSQL_RANDOM_ROOT_PASSWORD=true + MYSQL_ONETIME_PASSWORD=true + fi + if [ ! -d "$DATADIR" ]; then + mkdir -p "$DATADIR" + chown mysql:mysql "$DATADIR" + fi + + # The user can set a default_timezone either in a my.cnf file + # they mount into the container or on command line + # (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`) + # however the timezone tables will only be populated in a later + # stage of this script. By using +00:00 as timezone we override + # the user's choice during initialization. Later the server + # will be restarted using the user's option. + + echo '[Entrypoint] Initializing database' + "$@" --user=$MYSQLD_USER --initialize-insecure --default-time-zone=+00:00 + + echo '[Entrypoint] Database initialized' + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" --default-time-zone=+00:00 + + # To avoid using password on commandline, put it in a temporary file. + # The file is only populated when and if the root password is set. + PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + $install_devnull "$PASSFILE" + # Define the client command used throughout the script + # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") + + if [ ! -z %%STARTUP_WAIT%% ]; + then + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break + fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 + fi + fi + + mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql + + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(_mkpw)" + echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + fi + if [ -z "$MYSQL_ROOT_HOST" ]; then + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';" + else + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ + GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + fi + "${mysql[@]}" <<-EOSQL + DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; + ${ROOTCREATE} + FLUSH PRIVILEGES ; + EOSQL + if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then + # Put the password into the temporary config file + cat >"$PASSFILE" < "$SQL" +ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL + fi + fi + + echo + echo '[Entrypoint] MySQL init process done. Ready for start up.' + echo + fi + + # Used by healthcheck to make sure it doesn't mistakenly report container + # healthy during startup + # Put the password into the temporary config file + touch /var/lib/mysql-files/healthcheck.cnf + cat >"/var/lib/mysql-files/healthcheck.cnf" < Date: Fri, 9 May 2025 17:01:42 +0200 Subject: [PATCH 377/386] Fix bug#37821740 When running mysqld --validate-config we are not passing the --user option. Thus the server has no chance to run as target user, thus if any component writes to filesystem this may be done as wrong user. However server doesn't fully recognize this flag. For this working properly we also need a fix to 37921092. Change-Id: Ib30bfbef85abbaa1c4900c14b9ad7b734a44bb69 --- mysql-server/gen_dockerfiles.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-server/gen_dockerfiles.sh b/mysql-server/gen_dockerfiles.sh index 76e9f9862..2f55e9b9f 100755 --- a/mysql-server/gen_dockerfiles.sh +++ b/mysql-server/gen_dockerfiles.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2017, 2023, Oracle and/or its affiliates. +# Copyright (c) 2017, 2025, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -60,7 +60,7 @@ declare -A SPEC_PORTS PORTS="3306 33060 33061" -VALIDATE_CONFIG="output=\$(\"\$@\" --validate-config) || result=\$?" +VALIDATE_CONFIG="output=\$(\"\$@\" --user=\$MYSQLD_USER --validate-config) || result=\$?" DOCKERFILE_TEMPLATES="template/Dockerfile" SPEC_PORTS="3306/tcp, 33060-33061/tcp" From eeb26fe923abb2d91d5ead2b70c98bfda924e736 Mon Sep 17 00:00:00 2001 From: Nawaz Nazeer Ahamed Date: Fri, 20 Jun 2025 10:02:36 +0200 Subject: [PATCH 378/386] Update server/router/cluster version for 8.0/8.x/9.x for July release & weekly docker pipeline Change-Id: I3c2d4a50aad30c99541ebe1b537caa1ae6d5b2a5 --- mysql-cluster/VERSION | 14 +++++++------- mysql-router/VERSION | 24 ++++++++++++------------ mysql-server/VERSION | 26 +++++++++++++------------- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/mysql-cluster/VERSION b/mysql-cluster/VERSION index 35c3f7bdd..67121c5a4 100644 --- a/mysql-cluster/VERSION +++ b/mysql-cluster/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.2.21-cluster +IMAGE_VERSION=1.2.22-cluster # LATEST is always set to the # current highest release, which is, @@ -25,14 +25,14 @@ LATEST_LTS="8.4" # like 'latest-8.4' or 'lts-84', etch declare -A MYSQL_CLUSTER_VERSIONS -MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.42 -MYSQL_CLUSTER_VERSIONS["8.4"]=8.4.5 -MYSQL_CLUSTER_VERSIONS["innovation"]=9.3.0 +MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.43 +MYSQL_CLUSTER_VERSIONS["8.4"]=8.4.6 +MYSQL_CLUSTER_VERSIONS["innovation"]=9.4.0 declare -A MYSQL_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["8.0"]=8.0.42 -MYSQL_SHELL_VERSIONS["8.4"]=8.4.5 -MYSQL_SHELL_VERSIONS["innovation"]=9.3.0 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.43 +MYSQL_SHELL_VERSIONS["8.4"]=8.4.6 +MYSQL_SHELL_VERSIONS["innovation"]=9.4.0 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["8.0"]="${MYSQL_CLUSTER_VERSIONS["8.0"]}-${IMAGE_VERSION}" diff --git a/mysql-router/VERSION b/mysql-router/VERSION index 856fffe18..2aedb4d61 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.0.21-router +IMAGE_VERSION=1.0.22-router # LATEST is always set to the # current highest release, which is, @@ -25,19 +25,19 @@ LATEST_LTS="8.4" # like 'latest-8.4' or 'lts-84', etch declare -A MYSQL_ROUTER_VERSIONS WEEKLY_ROUTER_VERSIONS -MYSQL_ROUTER_VERSIONS["8.0"]=8.0.42 -MYSQL_ROUTER_VERSIONS["8.4"]=8.4.5 -MYSQL_ROUTER_VERSIONS["innovation"]=9.3.0 +MYSQL_ROUTER_VERSIONS["8.0"]=8.0.43 +MYSQL_ROUTER_VERSIONS["8.4"]=8.4.6 +MYSQL_ROUTER_VERSIONS["innovation"]=9.4.0 WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.43 -WEEKLY_ROUTER_VERSIONS["8.4"]=8.4.6 -WEEKLY_ROUTER_VERSIONS["innovation"]=9.4.0 +WEEKLY_ROUTER_VERSIONS["8.4"]=8.4.7 +WEEKLY_ROUTER_VERSIONS["innovation"]=9.5.0 declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["8.0"]=8.0.42 -MYSQL_SERVER_VERSIONS["8.4"]=8.4.5 -MYSQL_SERVER_VERSIONS["innovation"]=9.3.0 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.43 +MYSQL_SERVER_VERSIONS["8.4"]=8.4.6 +MYSQL_SERVER_VERSIONS["innovation"]=9.4.0 -WEEKLY_SERVER_VERSIONS["8.0"]=8.0.43 -WEEKLY_SERVER_VERSIONS["8.4"]=8.4.6 -WEEKLY_SERVER_VERSIONS["innovation"]=9.4.0 +WEEKLY_SERVER_VERSIONS["8.0"]=8.0.44 +WEEKLY_SERVER_VERSIONS["8.4"]=8.4.7 +WEEKLY_SERVER_VERSIONS["innovation"]=9.5.0 diff --git a/mysql-server/VERSION b/mysql-server/VERSION index d3a02a007..cc68e8b9c 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.2.21-server +IMAGE_VERSION=1.2.22-server # LATEST is always set to the # current highest release, which is, @@ -25,19 +25,19 @@ LATEST_LTS="8.4" # like 'latest-8.4' or 'lts-84', etc. declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["8.0"]=8.0.42 -MYSQL_SERVER_VERSIONS["8.4"]=8.4.5 -MYSQL_SERVER_VERSIONS["innovation"]=9.3.0 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.43 +MYSQL_SERVER_VERSIONS["8.4"]=8.4.6 +MYSQL_SERVER_VERSIONS["innovation"]=9.4.0 -WEEKLY_SERVER_VERSIONS["8.0"]=8.0.43 -WEEKLY_SERVER_VERSIONS["8.4"]=8.4.6 -WEEKLY_SERVER_VERSIONS["innovation"]=9.4.0 +WEEKLY_SERVER_VERSIONS["8.0"]=8.0.44 +WEEKLY_SERVER_VERSIONS["8.4"]=8.4.7 +WEEKLY_SERVER_VERSIONS["innovation"]=9.5.0 declare -A MYSQL_SHELL_VERSIONS WEEKLY_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["8.0"]=8.0.42 -MYSQL_SHELL_VERSIONS["8.4"]=8.4.5 -MYSQL_SHELL_VERSIONS["innovation"]=9.3.0 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.43 +MYSQL_SHELL_VERSIONS["8.4"]=8.4.6 +MYSQL_SHELL_VERSIONS["innovation"]=9.4.0 -WEEKLY_SHELL_VERSIONS["8.0"]=8.0.43 -WEEKLY_SHELL_VERSIONS["8.4"]=8.4.6 -WEEKLY_SHELL_VERSIONS["innovation"]=9.4.0 +WEEKLY_SHELL_VERSIONS["8.0"]=8.0.44 +WEEKLY_SHELL_VERSIONS["8.4"]=8.4.7 +WEEKLY_SHELL_VERSIONS["innovation"]=9.5.0 From 13750a038e9946bb95684b74bba9065418f4212c Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Tue, 22 Jul 2025 12:24:44 +0000 Subject: [PATCH 379/386] Release version 1.2.22-server * Update server/router/cluster version for 8.0/8.x/9.x for July release & weekly docker pipeline * Fix bug#37821740 --- mysql-server/8.0/Dockerfile | 4 +- mysql-server/8.0/docker-entrypoint.sh | 6 +- mysql-server/8.0/inspec/control.rb | 4 +- mysql-server/8.4/Dockerfile | 4 +- mysql-server/8.4/docker-entrypoint.sh | 6 +- mysql-server/8.4/inspec/control.rb | 4 +- mysql-server/9.4/Dockerfile | 45 +++++ mysql-server/9.4/docker-entrypoint.sh | 230 ++++++++++++++++++++++++++ mysql-server/9.4/healthcheck.sh | 24 +++ mysql-server/9.4/inspec/control.rb | 20 +++ mysql-server/9.4/prepare-image.sh | 25 +++ 11 files changed, 358 insertions(+), 14 deletions(-) create mode 100644 mysql-server/9.4/Dockerfile create mode 100755 mysql-server/9.4/docker-entrypoint.sh create mode 100755 mysql-server/9.4/healthcheck.sh create mode 100644 mysql-server/9.4/inspec/control.rb create mode 100755 mysql-server/9.4/prepare-image.sh diff --git a/mysql-server/8.0/Dockerfile b/mysql-server/8.0/Dockerfile index ac624de20..033a6d0d8 100644 --- a/mysql-server/8.0/Dockerfile +++ b/mysql-server/8.0/Dockerfile @@ -15,8 +15,8 @@ FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.42 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.42 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.43 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.43 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ diff --git a/mysql-server/8.0/docker-entrypoint.sh b/mysql-server/8.0/docker-entrypoint.sh index 0eaeb87a9..cbc1216d2 100755 --- a/mysql-server/8.0/docker-entrypoint.sh +++ b/mysql-server/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.42-1.2.21-server" +echo "[Entrypoint] MySQL Docker Image 8.0.43-1.2.22-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -54,7 +54,7 @@ if [ "$1" = 'mysqld' ]; then # Test that the server can start. We redirect stdout to /dev/null so # only the error messages are left. result=0 - output=$("$@" --validate-config) || result=$? + output=$("$@" --user=$MYSQLD_USER --validate-config) || result=$? if [ ! "$result" = "0" ]; then echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' echo >&2 "[Entrypoint] $output" @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.42-1.2.21-server" + echo "[Entrypoint] Starting MySQL 8.0.43-1.2.22-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/8.0/inspec/control.rb b/mysql-server/8.0/inspec/control.rb index f3a1abbd1..c259763ee 100644 --- a/mysql-server/8.0/inspec/control.rb +++ b/mysql-server/8.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.42.*' } + its ('version') { should match '8.0.43.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.42.*' } + its ('version') { should match '8.0.43.*' } end end diff --git a/mysql-server/8.4/Dockerfile b/mysql-server/8.4/Dockerfile index 937a1dadc..c37b9c30a 100644 --- a/mysql-server/8.4/Dockerfile +++ b/mysql-server/8.4/Dockerfile @@ -15,8 +15,8 @@ FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.4.5 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.4.5 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.4.6 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.4.6 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ diff --git a/mysql-server/8.4/docker-entrypoint.sh b/mysql-server/8.4/docker-entrypoint.sh index a50c50bc9..eb196358c 100755 --- a/mysql-server/8.4/docker-entrypoint.sh +++ b/mysql-server/8.4/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.4.5-1.2.21-server" +echo "[Entrypoint] MySQL Docker Image 8.4.6-1.2.22-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -54,7 +54,7 @@ if [ "$1" = 'mysqld' ]; then # Test that the server can start. We redirect stdout to /dev/null so # only the error messages are left. result=0 - output=$("$@" --validate-config) || result=$? + output=$("$@" --user=$MYSQLD_USER --validate-config) || result=$? if [ ! "$result" = "0" ]; then echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' echo >&2 "[Entrypoint] $output" @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.4.5-1.2.21-server" + echo "[Entrypoint] Starting MySQL 8.4.6-1.2.22-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/8.4/inspec/control.rb b/mysql-server/8.4/inspec/control.rb index b757a4417..7a85eefc2 100644 --- a/mysql-server/8.4/inspec/control.rb +++ b/mysql-server/8.4/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.4.5.*' } + its ('version') { should match '8.4.6.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.4.5.*' } + its ('version') { should match '8.4.6.*' } end end diff --git a/mysql-server/9.4/Dockerfile b/mysql-server/9.4/Dockerfile new file mode 100644 index 000000000..b6f30f362 --- /dev/null +++ b/mysql-server/9.4/Dockerfile @@ -0,0 +1,45 @@ +# Copyright (c) 2017, 2023, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +FROM container-registry.oracle.com/os/oraclelinux:9-slim + +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-9.4.0 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-9.4.0 + +# Setup repositories for minimal packages (all versions) +RUN rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ + && rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm + +# Install server and shell 8.0 +RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ + && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --disablerepo=ol9_appstream \ + --enablerepo=mysql-innovation-community-minimal $MYSQL_SERVER_PACKAGE \ + && microdnf remove -y mysql-community-minimal-release mysql84-community-release \ + && microdnf clean all \ + && mkdir /docker-entrypoint-initdb.d + +COPY prepare-image.sh / +RUN /prepare-image.sh && rm -f /prepare-image.sh + +ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock + +COPY docker-entrypoint.sh /entrypoint.sh +COPY healthcheck.sh /healthcheck.sh +ENTRYPOINT ["/entrypoint.sh"] +HEALTHCHECK CMD /healthcheck.sh +EXPOSE 3306 33060 33061 +CMD ["mysqld"] + diff --git a/mysql-server/9.4/docker-entrypoint.sh b/mysql-server/9.4/docker-entrypoint.sh new file mode 100755 index 000000000..482605bea --- /dev/null +++ b/mysql-server/9.4/docker-entrypoint.sh @@ -0,0 +1,230 @@ +#!/bin/bash +# Copyright (c) 2017, 2021, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +echo "[Entrypoint] MySQL Docker Image 9.4.0-1.2.22-server" +# Fetch value from server config +# We use mysqld --verbose --help instead of my_print_defaults because the +# latter only show values present in config files, and not server defaults +_get_config() { + local conf="$1"; shift + "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' +} + +# Generate a random password +_mkpw() { + letter=$(cat /dev/urandom| tr -dc a-zA-Z | dd bs=1 count=16 2> /dev/null ) + number=$(cat /dev/urandom| tr -dc 0-9 | dd bs=1 count=8 2> /dev/null) + special=$(cat /dev/urandom| tr -dc '=+@#%^&*_.,;:?/' | dd bs=1 count=8 2> /dev/null) + + echo $letter$number$special | fold -w 1 | shuf | tr -d '\n' +} + +# If command starts with an option, prepend mysqld +# This allows users to add command-line options without +# needing to specify the "mysqld" command +if [ "${1:0:1}" = '-' ]; then + set -- mysqld "$@" +fi + +# Check if entrypoint (and the container) is running as root +if [ $(id -u) = "0" ]; then + is_root=1 + install_devnull="install /dev/null -m0600 -omysql -gmysql" + MYSQLD_USER=mysql +else + install_devnull="install /dev/null -m0600" + MYSQLD_USER=$(id -u) +fi + +if [ "$1" = 'mysqld' ]; then + # Test that the server can start. We redirect stdout to /dev/null so + # only the error messages are left. + result=0 + output=$("$@" --user=$MYSQLD_USER --validate-config) || result=$? + if [ ! "$result" = "0" ]; then + echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' + echo >&2 "[Entrypoint] $output" + exit 1 + fi + + # Get config + DATADIR="$(_get_config 'datadir' "$@")" + SOCKET="$(_get_config 'socket' "$@")" + + if [ ! -d "$DATADIR/mysql" ]; then + # If the password variable is a filename we use the contents of the file. We + # read this first to make sure that a proper error is generated for empty files. + if [ -f "$MYSQL_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + if [ -z "$MYSQL_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' + exit 1 + fi + fi + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] No password option specified for new database.' + echo >&2 '[Entrypoint] A random onetime password will be generated.' + MYSQL_RANDOM_ROOT_PASSWORD=true + MYSQL_ONETIME_PASSWORD=true + fi + if [ ! -d "$DATADIR" ]; then + mkdir -p "$DATADIR" + chown mysql:mysql "$DATADIR" + fi + + # The user can set a default_timezone either in a my.cnf file + # they mount into the container or on command line + # (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`) + # however the timezone tables will only be populated in a later + # stage of this script. By using +00:00 as timezone we override + # the user's choice during initialization. Later the server + # will be restarted using the user's option. + + echo '[Entrypoint] Initializing database' + "$@" --user=$MYSQLD_USER --initialize-insecure --default-time-zone=+00:00 + + echo '[Entrypoint] Database initialized' + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" --default-time-zone=+00:00 + + # To avoid using password on commandline, put it in a temporary file. + # The file is only populated when and if the root password is set. + PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + $install_devnull "$PASSFILE" + # Define the client command used throughout the script + # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") + + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break + fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 + fi + + mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql + + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(_mkpw)" + echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + fi + if [ -z "$MYSQL_ROOT_HOST" ]; then + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';" + else + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ + GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + fi + "${mysql[@]}" <<-EOSQL + DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; + ${ROOTCREATE} + FLUSH PRIVILEGES ; + EOSQL + if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then + # Put the password into the temporary config file + cat >"$PASSFILE" < "$SQL" +ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL + fi + + echo + echo '[Entrypoint] MySQL init process done. Ready for start up.' + echo + fi + + # Used by healthcheck to make sure it doesn't mistakenly report container + # healthy during startup + # Put the password into the temporary config file + touch /var/lib/mysql-files/healthcheck.cnf + cat >"/var/lib/mysql-files/healthcheck.cnf" < Date: Tue, 22 Jul 2025 12:54:54 +0000 Subject: [PATCH 380/386] Release version 1.0.22-router * Update server/router/cluster version for 8.0/8.x/9.x for July release & weekly docker pipeline --- mysql-router/8.0/Dockerfile | 4 +- mysql-router/8.0/inspec/control.rb | 4 +- mysql-router/8.4/Dockerfile | 4 +- mysql-router/8.4/inspec/control.rb | 4 +- mysql-router/9.4/Dockerfile | 39 +++++++++ mysql-router/9.4/README.md | 88 ++++++++++++++++++++ mysql-router/9.4/inspec/control.rb | 20 +++++ mysql-router/9.4/run.sh | 129 +++++++++++++++++++++++++++++ 8 files changed, 284 insertions(+), 8 deletions(-) create mode 100644 mysql-router/9.4/Dockerfile create mode 100644 mysql-router/9.4/README.md create mode 100644 mysql-router/9.4/inspec/control.rb create mode 100755 mysql-router/9.4/run.sh diff --git a/mysql-router/8.0/Dockerfile b/mysql-router/8.0/Dockerfile index 66652e1bb..f0db8b9b2 100644 --- a/mysql-router/8.0/Dockerfile +++ b/mysql-router/8.0/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.42 -ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.42 +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.43 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.43 ARG CONFIG_PACKAGE_NAME=mysql84-community-release-el9.rpm ARG REPO_NAME_SERVER=mysql80-community ARG REPO_NAME_TOOLS=mysql-tools-community diff --git a/mysql-router/8.0/inspec/control.rb b/mysql-router/8.0/inspec/control.rb index 88858dcde..7a8a5e789 100644 --- a/mysql-router/8.0/inspec/control.rb +++ b/mysql-router/8.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-client') do it { should be_installed } - its ('version') { should match '8.0.42.*' } + its ('version') { should match '8.0.43.*' } end describe package('mysql-router-community') do it { should be_installed } - its ('version') { should match '8.0.42.*' } + its ('version') { should match '8.0.43.*' } end end diff --git a/mysql-router/8.4/Dockerfile b/mysql-router/8.4/Dockerfile index 3146779d3..b4707b1ec 100644 --- a/mysql-router/8.4/Dockerfile +++ b/mysql-router/8.4/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.4.5 -ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.4.5 +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.4.6 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.4.6 ARG CONFIG_PACKAGE_NAME=mysql84-community-release-el9.rpm ARG REPO_NAME_SERVER=mysql-8.4-lts-community ARG REPO_NAME_TOOLS=mysql-tools-8.4-lts-community diff --git a/mysql-router/8.4/inspec/control.rb b/mysql-router/8.4/inspec/control.rb index 62144db58..8dca8a185 100644 --- a/mysql-router/8.4/inspec/control.rb +++ b/mysql-router/8.4/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-client') do it { should be_installed } - its ('version') { should match '8.4.5.*' } + its ('version') { should match '8.4.6.*' } end describe package('mysql-router-community') do it { should be_installed } - its ('version') { should match '8.4.5.*' } + its ('version') { should match '8.4.6.*' } end end diff --git a/mysql-router/9.4/Dockerfile b/mysql-router/9.4/Dockerfile new file mode 100644 index 000000000..b7a4fecee --- /dev/null +++ b/mysql-router/9.4/Dockerfile @@ -0,0 +1,39 @@ +# Copyright (c) 2018, 2023, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +FROM container-registry.oracle.com/os/oraclelinux:9-slim + +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-9.4.0 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-9.4.0 +ARG CONFIG_PACKAGE_NAME=mysql84-community-release-el9.rpm +ARG REPO_NAME_SERVER=mysql-innovation-community +ARG REPO_NAME_TOOLS=mysql-tools-innovation-community + +RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ + && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ + -c "MySQL Router" mysqlrouter \ + && rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/$CONFIG_PACKAGE_NAME \ + && microdnf install -y \ + --enablerepo=mysql-innovation-community $MYSQL_CLIENT_PACKAGE \ + && microdnf install -y --disablerepo=\* \ + --enablerepo=mysql-tools-innovation-community $MYSQL_ROUTER_PACKAGE \ + && microdnf clean all + +COPY run.sh /run.sh +HEALTHCHECK \ + CMD mysqladmin --port 6446 --protocol TCP ping 2>&1 | grep Access || exit 1 +EXPOSE 6446 6447 6448 6449 6450 8443 +USER 999:999 +ENTRYPOINT ["/run.sh"] +CMD ["mysqlrouter"] diff --git a/mysql-router/9.4/README.md b/mysql-router/9.4/README.md new file mode 100644 index 000000000..0f2711ba5 --- /dev/null +++ b/mysql-router/9.4/README.md @@ -0,0 +1,88 @@ +![logo](https://www.mysql.com/common/logos/logo-mysql-170x115.png) + +# What is MySQL Router? + +MySQL Router is part of InnoDB cluster, and is lightweight middleware that +provides transparent routing between your application and back-end MySQL +Servers. It can be used for a wide variety of use cases, such as providing high +availability and scalability by effectively routing database traffic to +appropriate back-end MySQL Servers. The pluggable architecture also enables +developers to extend MySQL Router for custom use cases. + +# Supported Tags and Respective Dockerfile Links + +* MySQL Router 8.0 (tag: [`latest`, `8.0`](https://github.com/mysql/mysql-docker/blob/mysql-router/8.0/Dockerfile)) ([mysql-router/8.0/Dockerfile](https://github.com/mysql/mysql-docker/blob/mysql-router/8.0/Dockerfile)) + +Images are updated when new MySQL Server maintenance releases and development milestones are published. Please note that non-GA releases are for preview purposes only and should not be used in production setups. + +# How to Use the MySQL Router Images + +The image currently uses the following mandatory variables: + +| Variable | Description | +| ------------------------ | ------------------------------------------- | +| MYSQL_HOST | MySQL host to connect to | +| MYSQL_PORT | Port to use | +| MYSQL_USER | User to connect with | +| MYSQL_PASSWORD | Password to connect with | + +Running in a container requires a working InnoDB cluster. + +The image uses the following optional variables: + +| Variable | Description | +| ------------------------------------ | ------------------------------------------- | +| MYSQL_INNODB_CLUSTER_MEMBERS | Wait for at least this number of cluster instances to be ONLINE | +| MYSQL_CREATE_ROUTER_USER | Whether to create a new account for the Router to use when it's running. Defaults to 1, set to 0 to disable. | +| MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS | Additional command line options applied while bootstrapping + +If supplied the run script waits for the given mysql host to be up, the InnoDB cluster to have +MYSQL_INNODB_CLUSTER_MEMBERS members and then uses the given server for its +bootstrap mode +[Bootstrapping](https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-deploying-bootstrapping.html). + +The image can be run via: + +``` +docker run -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -e MYSQL_INNODB_CLUSTER_MEMBERS=3 -ti mysql/mysql-router +``` + +Additional command line options for running MySQL Router after bootstrap can be passed a command options. For instance you can use a config file from your home directory like this: + +``` +docker run -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -ti -v $HOME/router-extra.conf:/tmp/router-extra.conf mysql/mysql-router mysqlrouter --extra-config=/tmp/router-extra.conf +``` + +It can be verified by typing: + +``` +docker ps +``` + +The following output should be displayed: + +``` +4954b1c80be1 mysql-router:8.0 "/run.sh mysqlrouter" About a minute ago Up About a minute (healthy) 6447/tcp, 6448/tcp, 0.0.0.0:6446->6446/tcp, 6449/tcp innodbcluster_mysql-router_1 +``` + +By default the container will run as user 999:999 which maps to mysqlrouter:mysqlrouter inside the container. + +# Exposed Ports + +The following TCP ports are exposed by the MySQL Router container: + +| Port | Description +| ----- | --------------------------------------------------------------------------------------- | +| 6446 | R/W connection port. Clients that connect to this port will be forwarded to the PRIMARY | +| 6447 | R/O connection port. Clients that connect to this port will be forwarded to a SECONDARY | +| 6448 | X Protocol R/W connection port. R/W port for X protocol client connections | +| 6449 | X Protocol R/O connection port. R/O port for X protocol client connections | +| 8443 | HTTPS REST interface port. | + +For more information about the REST interface API, see: + +https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-rest-api-reference.html + +For full usage documentation, see: + +https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-installation-docker.html diff --git a/mysql-router/9.4/inspec/control.rb b/mysql-router/9.4/inspec/control.rb new file mode 100644 index 000000000..eeea59c38 --- /dev/null +++ b/mysql-router/9.4/inspec/control.rb @@ -0,0 +1,20 @@ +control 'container' do + impact 0.5 + describe podman.containers do + its('status') { should cmp /Up/ } + its('commands') { should cmp /sleep/ } + its('images') { should cmp /mysql-router:9.4/ } + its('names') { should include "mysql-router-9.4" } + end +end +control 'packages' do + impact 0.5 + describe package('mysql-community-client') do + it { should be_installed } + its ('version') { should match '9.4.0.*' } + end + describe package('mysql-router-community') do + it { should be_installed } + its ('version') { should match '9.4.0.*' } + end +end diff --git a/mysql-router/9.4/run.sh b/mysql-router/9.4/run.sh new file mode 100755 index 000000000..79bb35080 --- /dev/null +++ b/mysql-router/9.4/run.sh @@ -0,0 +1,129 @@ +#!/bin/bash +# Copyright (c) 2018, 2024, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +if [[ -n $MYSQL_USER_FILE && -f $MYSQL_USER_FILE ]]; then + MYSQL_USER=$(cat $MYSQL_USER_FILE) +fi + +if [ "$1" = 'mysqlrouter' ]; then + if [[ -z $MYSQL_HOST || -z $MYSQL_PORT || -z $MYSQL_USER || (-z $MYSQL_PASSWORD && -z $MYSQL_PASSWORD_FILE) ]]; then + echo "We require all of" + echo " MYSQL_HOST" + echo " MYSQL_PORT" + echo " MYSQL_USER or MYSQL_USER_FILE" + echo " MYSQL_PASSWORD or MYSQL_PASSWORD_FILE" + echo "to be set." + echo "In addition you can set" + echo " MYSQL_INNODB_CLUSTER_MEMBERS" + echo " MYSQL_CREATE_ROUTER_USER" + echo " MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS" + echo "Exiting." + exit 1 + fi + + PASSFILE=$(mktemp) + if [[ -n $MYSQL_PASSWORD_FILE && -f "$MYSQL_PASSWORD_FILE" ]]; then + cat "$MYSQL_PASSWORD_FILE" > "$PASSFILE" + echo "" >> "$PASSFILE" + else + echo "$MYSQL_PASSWORD" > "$PASSFILE" + fi + if [ -z $MYSQL_CREATE_ROUTER_USER ]; then + if [[ -n $MYSQL_PASSWORD_FILE && -f "$MYSQL_PASSWORD_FILE" ]]; then + cat "$MYSQL_PASSWORD_FILE" >> "$PASSFILE" + echo "" >> "$PASSFILE" + else + echo "$MYSQL_PASSWORD" >> "$PASSFILE" + fi + MYSQL_CREATE_ROUTER_USER=1 + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is not set, Router will generate a new account to be used at runtime." + echo "[Entrypoint] Set it to 0 to reuse $MYSQL_USER instead." + elif [ "$MYSQL_CREATE_ROUTER_USER" = "0" ]; then + if [[ -n $MYSQL_PASSWORD_FILE && -f "$MYSQL_PASSWORD_FILE" ]]; then + cat "$MYSQL_PASSWORD_FILE" >> "$PASSFILE" + echo "" >> "$PASSFILE" + else + echo "$MYSQL_PASSWORD" >> "$PASSFILE" + fi + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is 0, Router will reuse $MYSQL_USER account at runtime" + else + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is not 0, Router will generate a new account to be used at runtime" + fi + + if [[ -n $MYSQL_PASSWORD_FILE && -f "$MYSQL_PASSWORD_FILE" ]]; then + DEFAULTS_EXTRA_FILE=$(mktemp) + cat >"$DEFAULTS_EXTRA_FILE" <"$DEFAULTS_EXTRA_FILE" < "/dev/tcp/$MYSQL_HOST/$MYSQL_PORT") >/dev/null 2>&1; do + echo "[Entrypoint] Waiting for mysql server $MYSQL_HOST ($attempt_num/$max_tries)" + sleep $(( attempt_num++ )) + if (( attempt_num == max_tries )); then + exit 1 + fi + done + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST:$MYSQL_PORT. Checking for cluster state." + if ! [[ "$(mysql --defaults-extra-file="$DEFAULTS_EXTRA_FILE" -u "$MYSQL_USER" -h "$MYSQL_HOST" -P "$MYSQL_PORT" -e "show status;" 2> /dev/null)" ]]; then + echo "[Entrypoint] ERROR: Can not connect to database. Exiting." + exit 1 + fi + if [[ -n $MYSQL_INNODB_CLUSTER_MEMBERS ]]; then + attempt_num=0 + echo $attempt_num + echo $max_tries + until [ "$(mysql --defaults-extra-file="$DEFAULTS_EXTRA_FILE" -u "$MYSQL_USER" -h "$MYSQL_HOST" -P "$MYSQL_PORT" -N performance_schema -e "select count(MEMBER_STATE) >= $MYSQL_INNODB_CLUSTER_MEMBERS from replication_group_members where MEMBER_STATE = 'ONLINE';" 2> /dev/null)" -eq 1 ]; do + echo "[Entrypoint] Waiting for $MYSQL_INNODB_CLUSTER_MEMBERS cluster instances to become available via $MYSQL_HOST ($attempt_num/$max_tries)" + sleep $(( attempt_num++ )) + if (( attempt_num == max_tries )); then + exit 1 + fi + done + echo "[Entrypoint] Successfully contacted cluster with $MYSQL_INNODB_CLUSTER_MEMBERS members. Bootstrapping." + fi + if [ $(id -u) = "0" ]; then + opt_user=--user=mysqlrouter + fi + if [ "$MYSQL_CREATE_ROUTER_USER" = "0" ]; then + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap reusing account \"$MYSQL_USER\"." + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force --account-create=never --account=$MYSQL_USER $opt_user $MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS < "$PASSFILE" || exit 1 + else + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap." + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force $opt_user $MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS < "$PASSFILE" || exit 1 + fi + + rm "$DEFAULTS_EXTRA_FILE" + + sed -i -e 's/logging_folder=.*$/logging_folder=/' /tmp/mysqlrouter/mysqlrouter.conf + echo "[Entrypoint] Starting mysql-router." + exec "$@" --config /tmp/mysqlrouter/mysqlrouter.conf + + rm $PASSFILE +else + exec "$@" +fi From 45956194fd6fdda02cc77227222442022a350d2f Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 23 Jul 2025 08:29:08 +0000 Subject: [PATCH 381/386] Release version 1.2.22-cluster * Update server/router/cluster version for 8.0/8.x/9.x for July release & weekly docker pipeline --- mysql-cluster/8.0/Dockerfile | 4 +- mysql-cluster/8.0/docker-entrypoint.sh | 4 +- mysql-cluster/8.0/inspec/control.rb | 4 +- mysql-cluster/8.4/Dockerfile | 4 +- mysql-cluster/8.4/docker-entrypoint.sh | 4 +- mysql-cluster/8.4/inspec/control.rb | 4 +- mysql-cluster/9.4/Dockerfile | 47 +++++ mysql-cluster/9.4/cnf/my.cnf | 22 ++ mysql-cluster/9.4/cnf/mysql-cluster.cnf | 39 ++++ mysql-cluster/9.4/docker-entrypoint.sh | 264 ++++++++++++++++++++++++ mysql-cluster/9.4/healthcheck.sh | 24 +++ mysql-cluster/9.4/inspec/control.rb | 20 ++ mysql-cluster/9.4/prepare-image.sh | 25 +++ 13 files changed, 453 insertions(+), 12 deletions(-) create mode 100644 mysql-cluster/9.4/Dockerfile create mode 100644 mysql-cluster/9.4/cnf/my.cnf create mode 100644 mysql-cluster/9.4/cnf/mysql-cluster.cnf create mode 100755 mysql-cluster/9.4/docker-entrypoint.sh create mode 100755 mysql-cluster/9.4/healthcheck.sh create mode 100644 mysql-cluster/9.4/inspec/control.rb create mode 100755 mysql-cluster/9.4/prepare-image.sh diff --git a/mysql-cluster/8.0/Dockerfile b/mysql-cluster/8.0/Dockerfile index 926f37787..fc06b6d44 100644 --- a/mysql-cluster/8.0/Dockerfile +++ b/mysql-cluster/8.0/Dockerfile @@ -15,8 +15,8 @@ FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.0.42 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.42 +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.0.43 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.43 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ diff --git a/mysql-cluster/8.0/docker-entrypoint.sh b/mysql-cluster/8.0/docker-entrypoint.sh index d5ef630d7..baa227cd6 100755 --- a/mysql-cluster/8.0/docker-entrypoint.sh +++ b/mysql-cluster/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.42-1.2.21-cluster" +echo "[Entrypoint] MySQL Docker Image 8.0.43-1.2.22-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -227,7 +227,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.42-1.2.21-cluster" + echo "[Entrypoint] Starting MySQL 8.0.43-1.2.22-cluster" fi export MYSQLD_PARENT_PID=$$ ; exec "$@" --user= else diff --git a/mysql-cluster/8.0/inspec/control.rb b/mysql-cluster/8.0/inspec/control.rb index 75e7389e3..1c65cf358 100644 --- a/mysql-cluster/8.0/inspec/control.rb +++ b/mysql-cluster/8.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.42.*' } + its ('version') { should match '8.0.43.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.42.*' } + its ('version') { should match '8.0.43.*' } end end diff --git a/mysql-cluster/8.4/Dockerfile b/mysql-cluster/8.4/Dockerfile index bb479204b..8d79a4272 100644 --- a/mysql-cluster/8.4/Dockerfile +++ b/mysql-cluster/8.4/Dockerfile @@ -15,8 +15,8 @@ FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.4.5 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.4.5 +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.4.6 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.4.6 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ diff --git a/mysql-cluster/8.4/docker-entrypoint.sh b/mysql-cluster/8.4/docker-entrypoint.sh index 5275d7547..a5caa46db 100755 --- a/mysql-cluster/8.4/docker-entrypoint.sh +++ b/mysql-cluster/8.4/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.4.5-1.2.21-cluster" +echo "[Entrypoint] MySQL Docker Image 8.4.6-1.2.22-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -227,7 +227,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.4.5-1.2.21-cluster" + echo "[Entrypoint] Starting MySQL 8.4.6-1.2.22-cluster" fi export MYSQLD_PARENT_PID=$$ ; exec "$@" --user= else diff --git a/mysql-cluster/8.4/inspec/control.rb b/mysql-cluster/8.4/inspec/control.rb index 1f09cec38..62c3aaeac 100644 --- a/mysql-cluster/8.4/inspec/control.rb +++ b/mysql-cluster/8.4/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.4.5.*' } + its ('version') { should match '8.4.6.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.4.5.*' } + its ('version') { should match '8.4.6.*' } end end diff --git a/mysql-cluster/9.4/Dockerfile b/mysql-cluster/9.4/Dockerfile new file mode 100644 index 000000000..eff903caf --- /dev/null +++ b/mysql-cluster/9.4/Dockerfile @@ -0,0 +1,47 @@ +# Copyright (c) 2017, 2023, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +FROM container-registry.oracle.com/os/oraclelinux:9-slim + +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-9.4.0 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-9.4.0 + +# Setup repositories for minimal packages (all versions) +RUN rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ + && rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm + +# Install server and shell 8.0 +RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ + && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --disablerepo=ol9_appstream \ + --enablerepo=mysql-cluster-innovation-community-minimal $MYSQL_SERVER_PACKAGE \ + && microdnf clean all \ + && mkdir /docker-entrypoint-initdb.d + +COPY prepare-image.sh / +RUN /prepare-image.sh && rm -f /prepare-image.sh + +ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock + +COPY docker-entrypoint.sh /entrypoint.sh +COPY healthcheck.sh /healthcheck.sh +COPY cnf/my.cnf /etc/ +COPY cnf/mysql-cluster.cnf /etc/ + +ENTRYPOINT ["/entrypoint.sh"] +HEALTHCHECK CMD /healthcheck.sh +EXPOSE 3306 33060-33061 2202 1186 +CMD ["mysqld"] + diff --git a/mysql-cluster/9.4/cnf/my.cnf b/mysql-cluster/9.4/cnf/my.cnf new file mode 100644 index 000000000..ec98b2dc1 --- /dev/null +++ b/mysql-cluster/9.4/cnf/my.cnf @@ -0,0 +1,22 @@ +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +[mysqld] +ndbcluster +ndb-connectstring=192.168.0.2 +user=mysql + +[mysql_cluster] +ndb-connectstring=192.168.0.2 diff --git a/mysql-cluster/9.4/cnf/mysql-cluster.cnf b/mysql-cluster/9.4/cnf/mysql-cluster.cnf new file mode 100644 index 000000000..16f79f1c0 --- /dev/null +++ b/mysql-cluster/9.4/cnf/mysql-cluster.cnf @@ -0,0 +1,39 @@ +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +[ndbd default] +NoOfReplicas=2 +DataMemory=80M +IndexMemory=18M + + +[ndb_mgmd] +NodeId=1 +hostname=192.168.0.2 +datadir=/var/lib/mysql + +[ndbd] +NodeId=2 +hostname=192.168.0.3 +datadir=/var/lib/mysql + +[ndbd] +NodeId=3 +hostname=192.168.0.4 +datadir=/var/lib/mysql + +[mysqld] +NodeId=4 +hostname=192.168.0.10 diff --git a/mysql-cluster/9.4/docker-entrypoint.sh b/mysql-cluster/9.4/docker-entrypoint.sh new file mode 100755 index 000000000..9c130f143 --- /dev/null +++ b/mysql-cluster/9.4/docker-entrypoint.sh @@ -0,0 +1,264 @@ +#!/bin/bash +# Copyright (c) 2017, 2021, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +echo "[Entrypoint] MySQL Docker Image " +# Fetch value from server config +# We use mysqld --verbose --help instead of my_print_defaults because the +# latter only show values present in config files, and not server defaults +_get_config() { + local conf="$1"; shift + "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' +} + +# Generate a random password +_mkpw() { + letter=$(cat /dev/urandom| tr -dc a-zA-Z | dd bs=1 count=16 2> /dev/null ) + number=$(cat /dev/urandom| tr -dc 0-9 | dd bs=1 count=8 2> /dev/null) + special=$(cat /dev/urandom| tr -dc '=+@#%^&*_.,;:?/' | dd bs=1 count=8 2> /dev/null) + + echo $letter$number$special | fold -w 1 | shuf | tr -d '\n' +} + +# If command starts with an option, prepend mysqld +# This allows users to add command-line options without +# needing to specify the "mysqld" command +if [ "${1:0:1}" = '-' ]; then + set -- mysqld "$@" +fi + +# Check if entrypoint (and the container) is running as root +if [ $(id -u) = "0" ]; then + is_root=1 + install_devnull="install /dev/null -m0600 -omysql -gmysql" + MYSQLD_USER=mysql +else + install_devnull="install /dev/null -m0600" + MYSQLD_USER=$(id -u) +fi + +if [ "$1" = 'mysqld' ]; then + # Test that the server can start. We redirect stdout to /dev/null so + # only the error messages are left. + result=0 + output=$("$@" --validate-config) || result=$? + if [ ! "$result" = "0" ]; then + echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' + echo >&2 "[Entrypoint] $output" + exit 1 + fi + + # Get config + DATADIR="$(_get_config 'datadir' "$@")" + SOCKET="$(_get_config 'socket' "$@")" + + if [ ! -d "$DATADIR/mysql" ]; then + # If the password variable is a filename we use the contents of the file. We + # read this first to make sure that a proper error is generated for empty files. + if [ -f "$MYSQL_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + if [ -z "$MYSQL_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' + exit 1 + fi + fi + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] No password option specified for new database.' + echo >&2 '[Entrypoint] A random onetime password will be generated.' + MYSQL_RANDOM_ROOT_PASSWORD=true + MYSQL_ONETIME_PASSWORD=true + fi + if [ ! -d "$DATADIR" ]; then + mkdir -p "$DATADIR" + chown mysql:mysql "$DATADIR" + fi + + # The user can set a default_timezone either in a my.cnf file + # they mount into the container or on command line + # (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`) + # however the timezone tables will only be populated in a later + # stage of this script. By using +00:00 as timezone we override + # the user's choice during initialization. Later the server + # will be restarted using the user's option. + + echo '[Entrypoint] Initializing database' + "$@" --user=$MYSQLD_USER --initialize-insecure --default-time-zone=+00:00 + + echo '[Entrypoint] Database initialized' + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" --default-time-zone=+00:00 + + # To avoid using password on commandline, put it in a temporary file. + # The file is only populated when and if the root password is set. + PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + $install_devnull "$PASSFILE" + # Define the client command used throughout the script + # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") + + if [ ! -z %%STARTUP_WAIT%% ]; + then + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break + fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 + fi + fi + + mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql + + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(_mkpw)" + echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + fi + if [ -z "$MYSQL_ROOT_HOST" ]; then + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';" + else + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ + GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + fi + "${mysql[@]}" <<-EOSQL + DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; + ${ROOTCREATE} + FLUSH PRIVILEGES ; + EOSQL + if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then + # Put the password into the temporary config file + cat >"$PASSFILE" < "$SQL" +ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL + fi + fi + + echo + echo '[Entrypoint] MySQL init process done. Ready for start up.' + echo + fi + + # Used by healthcheck to make sure it doesn't mistakenly report container + # healthy during startup + # Put the password into the temporary config file + touch /var/lib/mysql-files/healthcheck.cnf + cat >"/var/lib/mysql-files/healthcheck.cnf" < Date: Thu, 31 Jul 2025 10:08:21 +0530 Subject: [PATCH 382/386] ET#87664 please update router packages in 8.0 container registry to 8.0.44 updating the weekly router pkg to 8.0.44 Change-Id: I4b9474221ca68a788cc0f624c1b63d75a7520a49 --- mysql-router/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-router/VERSION b/mysql-router/VERSION index 2aedb4d61..3431d9105 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -29,7 +29,7 @@ MYSQL_ROUTER_VERSIONS["8.0"]=8.0.43 MYSQL_ROUTER_VERSIONS["8.4"]=8.4.6 MYSQL_ROUTER_VERSIONS["innovation"]=9.4.0 -WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.43 +WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.44 WEEKLY_ROUTER_VERSIONS["8.4"]=8.4.7 WEEKLY_ROUTER_VERSIONS["innovation"]=9.5.0 From f9d60068eac6c81fafa95db27b34fad0a1f2d540 Mon Sep 17 00:00:00 2001 From: Nawaz Nazeer Ahamed Date: Thu, 9 Oct 2025 23:23:44 +0530 Subject: [PATCH 383/386] ET#88709 - Bump up versions for 9.5.0 Docker releases Change-Id: Id56622a7f14f3d9e6877791389d48581b2729581 --- mysql-cluster/VERSION | 14 +++++++------- mysql-router/VERSION | 14 +++++++------- mysql-server/VERSION | 14 +++++++------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/mysql-cluster/VERSION b/mysql-cluster/VERSION index 67121c5a4..cc04b2b83 100644 --- a/mysql-cluster/VERSION +++ b/mysql-cluster/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.2.22-cluster +IMAGE_VERSION=1.2.23-cluster # LATEST is always set to the # current highest release, which is, @@ -25,14 +25,14 @@ LATEST_LTS="8.4" # like 'latest-8.4' or 'lts-84', etch declare -A MYSQL_CLUSTER_VERSIONS -MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.43 -MYSQL_CLUSTER_VERSIONS["8.4"]=8.4.6 -MYSQL_CLUSTER_VERSIONS["innovation"]=9.4.0 +MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.44 +MYSQL_CLUSTER_VERSIONS["8.4"]=8.4.7 +MYSQL_CLUSTER_VERSIONS["innovation"]=9.5.0 declare -A MYSQL_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["8.0"]=8.0.43 -MYSQL_SHELL_VERSIONS["8.4"]=8.4.6 -MYSQL_SHELL_VERSIONS["innovation"]=9.4.0 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.44 +MYSQL_SHELL_VERSIONS["8.4"]=8.4.7 +MYSQL_SHELL_VERSIONS["innovation"]=9.5.0 declare -A FULL_SERVER_VERSIONS FULL_SERVER_VERSIONS["8.0"]="${MYSQL_CLUSTER_VERSIONS["8.0"]}-${IMAGE_VERSION}" diff --git a/mysql-router/VERSION b/mysql-router/VERSION index 3431d9105..27e422f88 100644 --- a/mysql-router/VERSION +++ b/mysql-router/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.0.22-router +IMAGE_VERSION=1.0.23-router # LATEST is always set to the # current highest release, which is, @@ -25,18 +25,18 @@ LATEST_LTS="8.4" # like 'latest-8.4' or 'lts-84', etch declare -A MYSQL_ROUTER_VERSIONS WEEKLY_ROUTER_VERSIONS -MYSQL_ROUTER_VERSIONS["8.0"]=8.0.43 -MYSQL_ROUTER_VERSIONS["8.4"]=8.4.6 -MYSQL_ROUTER_VERSIONS["innovation"]=9.4.0 +MYSQL_ROUTER_VERSIONS["8.0"]=8.0.44 +MYSQL_ROUTER_VERSIONS["8.4"]=8.4.7 +MYSQL_ROUTER_VERSIONS["innovation"]=9.5.0 WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.44 WEEKLY_ROUTER_VERSIONS["8.4"]=8.4.7 WEEKLY_ROUTER_VERSIONS["innovation"]=9.5.0 declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["8.0"]=8.0.43 -MYSQL_SERVER_VERSIONS["8.4"]=8.4.6 -MYSQL_SERVER_VERSIONS["innovation"]=9.4.0 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.44 +MYSQL_SERVER_VERSIONS["8.4"]=8.4.7 +MYSQL_SERVER_VERSIONS["innovation"]=9.5.0 WEEKLY_SERVER_VERSIONS["8.0"]=8.0.44 WEEKLY_SERVER_VERSIONS["8.4"]=8.4.7 diff --git a/mysql-server/VERSION b/mysql-server/VERSION index cc68e8b9c..56e620e18 100644 --- a/mysql-server/VERSION +++ b/mysql-server/VERSION @@ -1,4 +1,4 @@ -IMAGE_VERSION=1.2.22-server +IMAGE_VERSION=1.2.23-server # LATEST is always set to the # current highest release, which is, @@ -25,18 +25,18 @@ LATEST_LTS="8.4" # like 'latest-8.4' or 'lts-84', etc. declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS -MYSQL_SERVER_VERSIONS["8.0"]=8.0.43 -MYSQL_SERVER_VERSIONS["8.4"]=8.4.6 -MYSQL_SERVER_VERSIONS["innovation"]=9.4.0 +MYSQL_SERVER_VERSIONS["8.0"]=8.0.44 +MYSQL_SERVER_VERSIONS["8.4"]=8.4.7 +MYSQL_SERVER_VERSIONS["innovation"]=9.5.0 WEEKLY_SERVER_VERSIONS["8.0"]=8.0.44 WEEKLY_SERVER_VERSIONS["8.4"]=8.4.7 WEEKLY_SERVER_VERSIONS["innovation"]=9.5.0 declare -A MYSQL_SHELL_VERSIONS WEEKLY_SHELL_VERSIONS -MYSQL_SHELL_VERSIONS["8.0"]=8.0.43 -MYSQL_SHELL_VERSIONS["8.4"]=8.4.6 -MYSQL_SHELL_VERSIONS["innovation"]=9.4.0 +MYSQL_SHELL_VERSIONS["8.0"]=8.0.44 +MYSQL_SHELL_VERSIONS["8.4"]=8.4.7 +MYSQL_SHELL_VERSIONS["innovation"]=9.5.0 WEEKLY_SHELL_VERSIONS["8.0"]=8.0.44 WEEKLY_SHELL_VERSIONS["8.4"]=8.4.7 From 87e8a274b956373bdf53f01413d3e5d5aa98327f Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Tue, 21 Oct 2025 17:17:58 +0000 Subject: [PATCH 384/386] Release version 1.2.23-server * ET#88709 - Bump up versions for 9.5.0 Docker releases --- mysql-server/8.0/Dockerfile | 4 +- mysql-server/8.0/docker-entrypoint.sh | 4 +- mysql-server/8.0/inspec/control.rb | 4 +- mysql-server/8.4/Dockerfile | 4 +- mysql-server/8.4/docker-entrypoint.sh | 4 +- mysql-server/8.4/inspec/control.rb | 4 +- mysql-server/9.5/Dockerfile | 45 +++++ mysql-server/9.5/docker-entrypoint.sh | 230 ++++++++++++++++++++++++++ mysql-server/9.5/healthcheck.sh | 24 +++ mysql-server/9.5/inspec/control.rb | 20 +++ mysql-server/9.5/prepare-image.sh | 25 +++ 11 files changed, 356 insertions(+), 12 deletions(-) create mode 100644 mysql-server/9.5/Dockerfile create mode 100755 mysql-server/9.5/docker-entrypoint.sh create mode 100755 mysql-server/9.5/healthcheck.sh create mode 100644 mysql-server/9.5/inspec/control.rb create mode 100755 mysql-server/9.5/prepare-image.sh diff --git a/mysql-server/8.0/Dockerfile b/mysql-server/8.0/Dockerfile index 033a6d0d8..d135ff3d2 100644 --- a/mysql-server/8.0/Dockerfile +++ b/mysql-server/8.0/Dockerfile @@ -15,8 +15,8 @@ FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.43 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.43 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.44 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.44 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ diff --git a/mysql-server/8.0/docker-entrypoint.sh b/mysql-server/8.0/docker-entrypoint.sh index cbc1216d2..1e759568d 100755 --- a/mysql-server/8.0/docker-entrypoint.sh +++ b/mysql-server/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.43-1.2.22-server" +echo "[Entrypoint] MySQL Docker Image 8.0.44-1.2.23-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.43-1.2.22-server" + echo "[Entrypoint] Starting MySQL 8.0.44-1.2.23-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/8.0/inspec/control.rb b/mysql-server/8.0/inspec/control.rb index c259763ee..1484d3361 100644 --- a/mysql-server/8.0/inspec/control.rb +++ b/mysql-server/8.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.43.*' } + its ('version') { should match '8.0.44.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.43.*' } + its ('version') { should match '8.0.44.*' } end end diff --git a/mysql-server/8.4/Dockerfile b/mysql-server/8.4/Dockerfile index c37b9c30a..a47e4b48b 100644 --- a/mysql-server/8.4/Dockerfile +++ b/mysql-server/8.4/Dockerfile @@ -15,8 +15,8 @@ FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.4.6 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.4.6 +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.4.7 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.4.7 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ diff --git a/mysql-server/8.4/docker-entrypoint.sh b/mysql-server/8.4/docker-entrypoint.sh index eb196358c..2e7bcf1d9 100755 --- a/mysql-server/8.4/docker-entrypoint.sh +++ b/mysql-server/8.4/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.4.6-1.2.22-server" +echo "[Entrypoint] MySQL Docker Image 8.4.7-1.2.23-server" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -220,7 +220,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.4.6-1.2.22-server" + echo "[Entrypoint] Starting MySQL 8.4.7-1.2.23-server" fi # 4th value of /proc/$pid/stat is the ppid, same as getppid() export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4) diff --git a/mysql-server/8.4/inspec/control.rb b/mysql-server/8.4/inspec/control.rb index 7a85eefc2..0792154e7 100644 --- a/mysql-server/8.4/inspec/control.rb +++ b/mysql-server/8.4/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.4.6.*' } + its ('version') { should match '8.4.7.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.4.6.*' } + its ('version') { should match '8.4.7.*' } end end diff --git a/mysql-server/9.5/Dockerfile b/mysql-server/9.5/Dockerfile new file mode 100644 index 000000000..ea2a63df5 --- /dev/null +++ b/mysql-server/9.5/Dockerfile @@ -0,0 +1,45 @@ +# Copyright (c) 2017, 2023, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +FROM container-registry.oracle.com/os/oraclelinux:9-slim + +ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-9.5.0 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-9.5.0 + +# Setup repositories for minimal packages (all versions) +RUN rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ + && rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm + +# Install server and shell 8.0 +RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ + && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --disablerepo=ol9_appstream \ + --enablerepo=mysql-innovation-community-minimal $MYSQL_SERVER_PACKAGE \ + && microdnf remove -y mysql-community-minimal-release mysql84-community-release \ + && microdnf clean all \ + && mkdir /docker-entrypoint-initdb.d + +COPY prepare-image.sh / +RUN /prepare-image.sh && rm -f /prepare-image.sh + +ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock + +COPY docker-entrypoint.sh /entrypoint.sh +COPY healthcheck.sh /healthcheck.sh +ENTRYPOINT ["/entrypoint.sh"] +HEALTHCHECK CMD /healthcheck.sh +EXPOSE 3306 33060 33061 +CMD ["mysqld"] + diff --git a/mysql-server/9.5/docker-entrypoint.sh b/mysql-server/9.5/docker-entrypoint.sh new file mode 100755 index 000000000..f0a9abec4 --- /dev/null +++ b/mysql-server/9.5/docker-entrypoint.sh @@ -0,0 +1,230 @@ +#!/bin/bash +# Copyright (c) 2017, 2021, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +echo "[Entrypoint] MySQL Docker Image 9.5.0-1.2.23-server" +# Fetch value from server config +# We use mysqld --verbose --help instead of my_print_defaults because the +# latter only show values present in config files, and not server defaults +_get_config() { + local conf="$1"; shift + "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' +} + +# Generate a random password +_mkpw() { + letter=$(cat /dev/urandom| tr -dc a-zA-Z | dd bs=1 count=16 2> /dev/null ) + number=$(cat /dev/urandom| tr -dc 0-9 | dd bs=1 count=8 2> /dev/null) + special=$(cat /dev/urandom| tr -dc '=+@#%^&*_.,;:?/' | dd bs=1 count=8 2> /dev/null) + + echo $letter$number$special | fold -w 1 | shuf | tr -d '\n' +} + +# If command starts with an option, prepend mysqld +# This allows users to add command-line options without +# needing to specify the "mysqld" command +if [ "${1:0:1}" = '-' ]; then + set -- mysqld "$@" +fi + +# Check if entrypoint (and the container) is running as root +if [ $(id -u) = "0" ]; then + is_root=1 + install_devnull="install /dev/null -m0600 -omysql -gmysql" + MYSQLD_USER=mysql +else + install_devnull="install /dev/null -m0600" + MYSQLD_USER=$(id -u) +fi + +if [ "$1" = 'mysqld' ]; then + # Test that the server can start. We redirect stdout to /dev/null so + # only the error messages are left. + result=0 + output=$("$@" --user=$MYSQLD_USER --validate-config) || result=$? + if [ ! "$result" = "0" ]; then + echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' + echo >&2 "[Entrypoint] $output" + exit 1 + fi + + # Get config + DATADIR="$(_get_config 'datadir' "$@")" + SOCKET="$(_get_config 'socket' "$@")" + + if [ ! -d "$DATADIR/mysql" ]; then + # If the password variable is a filename we use the contents of the file. We + # read this first to make sure that a proper error is generated for empty files. + if [ -f "$MYSQL_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + if [ -z "$MYSQL_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' + exit 1 + fi + fi + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] No password option specified for new database.' + echo >&2 '[Entrypoint] A random onetime password will be generated.' + MYSQL_RANDOM_ROOT_PASSWORD=true + MYSQL_ONETIME_PASSWORD=true + fi + if [ ! -d "$DATADIR" ]; then + mkdir -p "$DATADIR" + chown mysql:mysql "$DATADIR" + fi + + # The user can set a default_timezone either in a my.cnf file + # they mount into the container or on command line + # (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`) + # however the timezone tables will only be populated in a later + # stage of this script. By using +00:00 as timezone we override + # the user's choice during initialization. Later the server + # will be restarted using the user's option. + + echo '[Entrypoint] Initializing database' + "$@" --user=$MYSQLD_USER --initialize-insecure --default-time-zone=+00:00 + + echo '[Entrypoint] Database initialized' + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" --default-time-zone=+00:00 + + # To avoid using password on commandline, put it in a temporary file. + # The file is only populated when and if the root password is set. + PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + $install_devnull "$PASSFILE" + # Define the client command used throughout the script + # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") + + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break + fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 + fi + + mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql + + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(_mkpw)" + echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + fi + if [ -z "$MYSQL_ROOT_HOST" ]; then + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';" + else + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ + GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + fi + "${mysql[@]}" <<-EOSQL + DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; + ${ROOTCREATE} + FLUSH PRIVILEGES ; + EOSQL + if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then + # Put the password into the temporary config file + cat >"$PASSFILE" < "$SQL" +ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL + fi + + echo + echo '[Entrypoint] MySQL init process done. Ready for start up.' + echo + fi + + # Used by healthcheck to make sure it doesn't mistakenly report container + # healthy during startup + # Put the password into the temporary config file + touch /var/lib/mysql-files/healthcheck.cnf + cat >"/var/lib/mysql-files/healthcheck.cnf" < Date: Tue, 21 Oct 2025 17:45:18 +0000 Subject: [PATCH 385/386] Release version 1.0.23-router * ET#88709 - Bump up versions for 9.5.0 Docker releases * ET#87664 please update router packages in 8.0 container registry to 8.0.44 --- mysql-router/8.0/Dockerfile | 4 +- mysql-router/8.0/inspec/control.rb | 4 +- mysql-router/8.4/Dockerfile | 4 +- mysql-router/8.4/inspec/control.rb | 4 +- mysql-router/9.5/Dockerfile | 39 +++++++++ mysql-router/9.5/README.md | 88 ++++++++++++++++++++ mysql-router/9.5/inspec/control.rb | 20 +++++ mysql-router/9.5/run.sh | 129 +++++++++++++++++++++++++++++ 8 files changed, 284 insertions(+), 8 deletions(-) create mode 100644 mysql-router/9.5/Dockerfile create mode 100644 mysql-router/9.5/README.md create mode 100644 mysql-router/9.5/inspec/control.rb create mode 100755 mysql-router/9.5/run.sh diff --git a/mysql-router/8.0/Dockerfile b/mysql-router/8.0/Dockerfile index f0db8b9b2..8582ebb36 100644 --- a/mysql-router/8.0/Dockerfile +++ b/mysql-router/8.0/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.43 -ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.43 +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.44 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.44 ARG CONFIG_PACKAGE_NAME=mysql84-community-release-el9.rpm ARG REPO_NAME_SERVER=mysql80-community ARG REPO_NAME_TOOLS=mysql-tools-community diff --git a/mysql-router/8.0/inspec/control.rb b/mysql-router/8.0/inspec/control.rb index 7a8a5e789..ed523188e 100644 --- a/mysql-router/8.0/inspec/control.rb +++ b/mysql-router/8.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-client') do it { should be_installed } - its ('version') { should match '8.0.43.*' } + its ('version') { should match '8.0.44.*' } end describe package('mysql-router-community') do it { should be_installed } - its ('version') { should match '8.0.43.*' } + its ('version') { should match '8.0.44.*' } end end diff --git a/mysql-router/8.4/Dockerfile b/mysql-router/8.4/Dockerfile index b4707b1ec..cc806ad31 100644 --- a/mysql-router/8.4/Dockerfile +++ b/mysql-router/8.4/Dockerfile @@ -14,8 +14,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.4.6 -ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.4.6 +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.4.7 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.4.7 ARG CONFIG_PACKAGE_NAME=mysql84-community-release-el9.rpm ARG REPO_NAME_SERVER=mysql-8.4-lts-community ARG REPO_NAME_TOOLS=mysql-tools-8.4-lts-community diff --git a/mysql-router/8.4/inspec/control.rb b/mysql-router/8.4/inspec/control.rb index 8dca8a185..85f4d3ebb 100644 --- a/mysql-router/8.4/inspec/control.rb +++ b/mysql-router/8.4/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-community-client') do it { should be_installed } - its ('version') { should match '8.4.6.*' } + its ('version') { should match '8.4.7.*' } end describe package('mysql-router-community') do it { should be_installed } - its ('version') { should match '8.4.6.*' } + its ('version') { should match '8.4.7.*' } end end diff --git a/mysql-router/9.5/Dockerfile b/mysql-router/9.5/Dockerfile new file mode 100644 index 000000000..aea7149d4 --- /dev/null +++ b/mysql-router/9.5/Dockerfile @@ -0,0 +1,39 @@ +# Copyright (c) 2018, 2023, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +FROM container-registry.oracle.com/os/oraclelinux:9-slim + +ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-9.5.0 +ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-9.5.0 +ARG CONFIG_PACKAGE_NAME=mysql84-community-release-el9.rpm +ARG REPO_NAME_SERVER=mysql-innovation-community +ARG REPO_NAME_TOOLS=mysql-tools-innovation-community + +RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ + && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ + -c "MySQL Router" mysqlrouter \ + && rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/$CONFIG_PACKAGE_NAME \ + && microdnf install -y \ + --enablerepo=mysql-innovation-community $MYSQL_CLIENT_PACKAGE \ + && microdnf install -y --disablerepo=\* \ + --enablerepo=mysql-tools-innovation-community $MYSQL_ROUTER_PACKAGE \ + && microdnf clean all + +COPY run.sh /run.sh +HEALTHCHECK \ + CMD mysqladmin --port 6446 --protocol TCP ping 2>&1 | grep Access || exit 1 +EXPOSE 6446 6447 6448 6449 6450 8443 +USER 999:999 +ENTRYPOINT ["/run.sh"] +CMD ["mysqlrouter"] diff --git a/mysql-router/9.5/README.md b/mysql-router/9.5/README.md new file mode 100644 index 000000000..0f2711ba5 --- /dev/null +++ b/mysql-router/9.5/README.md @@ -0,0 +1,88 @@ +![logo](https://www.mysql.com/common/logos/logo-mysql-170x115.png) + +# What is MySQL Router? + +MySQL Router is part of InnoDB cluster, and is lightweight middleware that +provides transparent routing between your application and back-end MySQL +Servers. It can be used for a wide variety of use cases, such as providing high +availability and scalability by effectively routing database traffic to +appropriate back-end MySQL Servers. The pluggable architecture also enables +developers to extend MySQL Router for custom use cases. + +# Supported Tags and Respective Dockerfile Links + +* MySQL Router 8.0 (tag: [`latest`, `8.0`](https://github.com/mysql/mysql-docker/blob/mysql-router/8.0/Dockerfile)) ([mysql-router/8.0/Dockerfile](https://github.com/mysql/mysql-docker/blob/mysql-router/8.0/Dockerfile)) + +Images are updated when new MySQL Server maintenance releases and development milestones are published. Please note that non-GA releases are for preview purposes only and should not be used in production setups. + +# How to Use the MySQL Router Images + +The image currently uses the following mandatory variables: + +| Variable | Description | +| ------------------------ | ------------------------------------------- | +| MYSQL_HOST | MySQL host to connect to | +| MYSQL_PORT | Port to use | +| MYSQL_USER | User to connect with | +| MYSQL_PASSWORD | Password to connect with | + +Running in a container requires a working InnoDB cluster. + +The image uses the following optional variables: + +| Variable | Description | +| ------------------------------------ | ------------------------------------------- | +| MYSQL_INNODB_CLUSTER_MEMBERS | Wait for at least this number of cluster instances to be ONLINE | +| MYSQL_CREATE_ROUTER_USER | Whether to create a new account for the Router to use when it's running. Defaults to 1, set to 0 to disable. | +| MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS | Additional command line options applied while bootstrapping + +If supplied the run script waits for the given mysql host to be up, the InnoDB cluster to have +MYSQL_INNODB_CLUSTER_MEMBERS members and then uses the given server for its +bootstrap mode +[Bootstrapping](https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-deploying-bootstrapping.html). + +The image can be run via: + +``` +docker run -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -e MYSQL_INNODB_CLUSTER_MEMBERS=3 -ti mysql/mysql-router +``` + +Additional command line options for running MySQL Router after bootstrap can be passed a command options. For instance you can use a config file from your home directory like this: + +``` +docker run -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -ti -v $HOME/router-extra.conf:/tmp/router-extra.conf mysql/mysql-router mysqlrouter --extra-config=/tmp/router-extra.conf +``` + +It can be verified by typing: + +``` +docker ps +``` + +The following output should be displayed: + +``` +4954b1c80be1 mysql-router:8.0 "/run.sh mysqlrouter" About a minute ago Up About a minute (healthy) 6447/tcp, 6448/tcp, 0.0.0.0:6446->6446/tcp, 6449/tcp innodbcluster_mysql-router_1 +``` + +By default the container will run as user 999:999 which maps to mysqlrouter:mysqlrouter inside the container. + +# Exposed Ports + +The following TCP ports are exposed by the MySQL Router container: + +| Port | Description +| ----- | --------------------------------------------------------------------------------------- | +| 6446 | R/W connection port. Clients that connect to this port will be forwarded to the PRIMARY | +| 6447 | R/O connection port. Clients that connect to this port will be forwarded to a SECONDARY | +| 6448 | X Protocol R/W connection port. R/W port for X protocol client connections | +| 6449 | X Protocol R/O connection port. R/O port for X protocol client connections | +| 8443 | HTTPS REST interface port. | + +For more information about the REST interface API, see: + +https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-rest-api-reference.html + +For full usage documentation, see: + +https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-installation-docker.html diff --git a/mysql-router/9.5/inspec/control.rb b/mysql-router/9.5/inspec/control.rb new file mode 100644 index 000000000..8a56244bc --- /dev/null +++ b/mysql-router/9.5/inspec/control.rb @@ -0,0 +1,20 @@ +control 'container' do + impact 0.5 + describe podman.containers do + its('status') { should cmp /Up/ } + its('commands') { should cmp /sleep/ } + its('images') { should cmp /mysql-router:9.5/ } + its('names') { should include "mysql-router-9.5" } + end +end +control 'packages' do + impact 0.5 + describe package('mysql-community-client') do + it { should be_installed } + its ('version') { should match '9.5.0.*' } + end + describe package('mysql-router-community') do + it { should be_installed } + its ('version') { should match '9.5.0.*' } + end +end diff --git a/mysql-router/9.5/run.sh b/mysql-router/9.5/run.sh new file mode 100755 index 000000000..79bb35080 --- /dev/null +++ b/mysql-router/9.5/run.sh @@ -0,0 +1,129 @@ +#!/bin/bash +# Copyright (c) 2018, 2024, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +if [[ -n $MYSQL_USER_FILE && -f $MYSQL_USER_FILE ]]; then + MYSQL_USER=$(cat $MYSQL_USER_FILE) +fi + +if [ "$1" = 'mysqlrouter' ]; then + if [[ -z $MYSQL_HOST || -z $MYSQL_PORT || -z $MYSQL_USER || (-z $MYSQL_PASSWORD && -z $MYSQL_PASSWORD_FILE) ]]; then + echo "We require all of" + echo " MYSQL_HOST" + echo " MYSQL_PORT" + echo " MYSQL_USER or MYSQL_USER_FILE" + echo " MYSQL_PASSWORD or MYSQL_PASSWORD_FILE" + echo "to be set." + echo "In addition you can set" + echo " MYSQL_INNODB_CLUSTER_MEMBERS" + echo " MYSQL_CREATE_ROUTER_USER" + echo " MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS" + echo "Exiting." + exit 1 + fi + + PASSFILE=$(mktemp) + if [[ -n $MYSQL_PASSWORD_FILE && -f "$MYSQL_PASSWORD_FILE" ]]; then + cat "$MYSQL_PASSWORD_FILE" > "$PASSFILE" + echo "" >> "$PASSFILE" + else + echo "$MYSQL_PASSWORD" > "$PASSFILE" + fi + if [ -z $MYSQL_CREATE_ROUTER_USER ]; then + if [[ -n $MYSQL_PASSWORD_FILE && -f "$MYSQL_PASSWORD_FILE" ]]; then + cat "$MYSQL_PASSWORD_FILE" >> "$PASSFILE" + echo "" >> "$PASSFILE" + else + echo "$MYSQL_PASSWORD" >> "$PASSFILE" + fi + MYSQL_CREATE_ROUTER_USER=1 + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is not set, Router will generate a new account to be used at runtime." + echo "[Entrypoint] Set it to 0 to reuse $MYSQL_USER instead." + elif [ "$MYSQL_CREATE_ROUTER_USER" = "0" ]; then + if [[ -n $MYSQL_PASSWORD_FILE && -f "$MYSQL_PASSWORD_FILE" ]]; then + cat "$MYSQL_PASSWORD_FILE" >> "$PASSFILE" + echo "" >> "$PASSFILE" + else + echo "$MYSQL_PASSWORD" >> "$PASSFILE" + fi + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is 0, Router will reuse $MYSQL_USER account at runtime" + else + echo "[Entrypoint] MYSQL_CREATE_ROUTER_USER is not 0, Router will generate a new account to be used at runtime" + fi + + if [[ -n $MYSQL_PASSWORD_FILE && -f "$MYSQL_PASSWORD_FILE" ]]; then + DEFAULTS_EXTRA_FILE=$(mktemp) + cat >"$DEFAULTS_EXTRA_FILE" <"$DEFAULTS_EXTRA_FILE" < "/dev/tcp/$MYSQL_HOST/$MYSQL_PORT") >/dev/null 2>&1; do + echo "[Entrypoint] Waiting for mysql server $MYSQL_HOST ($attempt_num/$max_tries)" + sleep $(( attempt_num++ )) + if (( attempt_num == max_tries )); then + exit 1 + fi + done + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST:$MYSQL_PORT. Checking for cluster state." + if ! [[ "$(mysql --defaults-extra-file="$DEFAULTS_EXTRA_FILE" -u "$MYSQL_USER" -h "$MYSQL_HOST" -P "$MYSQL_PORT" -e "show status;" 2> /dev/null)" ]]; then + echo "[Entrypoint] ERROR: Can not connect to database. Exiting." + exit 1 + fi + if [[ -n $MYSQL_INNODB_CLUSTER_MEMBERS ]]; then + attempt_num=0 + echo $attempt_num + echo $max_tries + until [ "$(mysql --defaults-extra-file="$DEFAULTS_EXTRA_FILE" -u "$MYSQL_USER" -h "$MYSQL_HOST" -P "$MYSQL_PORT" -N performance_schema -e "select count(MEMBER_STATE) >= $MYSQL_INNODB_CLUSTER_MEMBERS from replication_group_members where MEMBER_STATE = 'ONLINE';" 2> /dev/null)" -eq 1 ]; do + echo "[Entrypoint] Waiting for $MYSQL_INNODB_CLUSTER_MEMBERS cluster instances to become available via $MYSQL_HOST ($attempt_num/$max_tries)" + sleep $(( attempt_num++ )) + if (( attempt_num == max_tries )); then + exit 1 + fi + done + echo "[Entrypoint] Successfully contacted cluster with $MYSQL_INNODB_CLUSTER_MEMBERS members. Bootstrapping." + fi + if [ $(id -u) = "0" ]; then + opt_user=--user=mysqlrouter + fi + if [ "$MYSQL_CREATE_ROUTER_USER" = "0" ]; then + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap reusing account \"$MYSQL_USER\"." + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force --account-create=never --account=$MYSQL_USER $opt_user $MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS < "$PASSFILE" || exit 1 + else + echo "[Entrypoint] Succesfully contacted mysql server at $MYSQL_HOST. Trying to bootstrap." + mysqlrouter --bootstrap "$MYSQL_USER@$MYSQL_HOST:$MYSQL_PORT" --directory /tmp/mysqlrouter --force $opt_user $MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS < "$PASSFILE" || exit 1 + fi + + rm "$DEFAULTS_EXTRA_FILE" + + sed -i -e 's/logging_folder=.*$/logging_folder=/' /tmp/mysqlrouter/mysqlrouter.conf + echo "[Entrypoint] Starting mysql-router." + exec "$@" --config /tmp/mysqlrouter/mysqlrouter.conf + + rm $PASSFILE +else + exec "$@" +fi From d154e425bdb9632135bb64d387adb2847125f59e Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Thu, 23 Oct 2025 13:42:15 +0000 Subject: [PATCH 386/386] Release version 1.2.23-cluster * ET#88709 - Bump up versions for 9.5.0 Docker releases --- mysql-cluster/8.0/Dockerfile | 4 +- mysql-cluster/8.0/docker-entrypoint.sh | 4 +- mysql-cluster/8.0/inspec/control.rb | 4 +- mysql-cluster/8.4/Dockerfile | 4 +- mysql-cluster/8.4/docker-entrypoint.sh | 4 +- mysql-cluster/8.4/inspec/control.rb | 4 +- mysql-cluster/9.5/Dockerfile | 47 +++++ mysql-cluster/9.5/cnf/my.cnf | 22 ++ mysql-cluster/9.5/cnf/mysql-cluster.cnf | 39 ++++ mysql-cluster/9.5/docker-entrypoint.sh | 264 ++++++++++++++++++++++++ mysql-cluster/9.5/healthcheck.sh | 24 +++ mysql-cluster/9.5/inspec/control.rb | 20 ++ mysql-cluster/9.5/prepare-image.sh | 25 +++ 13 files changed, 453 insertions(+), 12 deletions(-) create mode 100644 mysql-cluster/9.5/Dockerfile create mode 100644 mysql-cluster/9.5/cnf/my.cnf create mode 100644 mysql-cluster/9.5/cnf/mysql-cluster.cnf create mode 100755 mysql-cluster/9.5/docker-entrypoint.sh create mode 100755 mysql-cluster/9.5/healthcheck.sh create mode 100644 mysql-cluster/9.5/inspec/control.rb create mode 100755 mysql-cluster/9.5/prepare-image.sh diff --git a/mysql-cluster/8.0/Dockerfile b/mysql-cluster/8.0/Dockerfile index fc06b6d44..4a0b2022c 100644 --- a/mysql-cluster/8.0/Dockerfile +++ b/mysql-cluster/8.0/Dockerfile @@ -15,8 +15,8 @@ FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.0.43 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.43 +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.0.44 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.44 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ diff --git a/mysql-cluster/8.0/docker-entrypoint.sh b/mysql-cluster/8.0/docker-entrypoint.sh index baa227cd6..5db15e90f 100755 --- a/mysql-cluster/8.0/docker-entrypoint.sh +++ b/mysql-cluster/8.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.0.43-1.2.22-cluster" +echo "[Entrypoint] MySQL Docker Image 8.0.44-1.2.23-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -227,7 +227,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.0.43-1.2.22-cluster" + echo "[Entrypoint] Starting MySQL 8.0.44-1.2.23-cluster" fi export MYSQLD_PARENT_PID=$$ ; exec "$@" --user= else diff --git a/mysql-cluster/8.0/inspec/control.rb b/mysql-cluster/8.0/inspec/control.rb index 1c65cf358..29461dc88 100644 --- a/mysql-cluster/8.0/inspec/control.rb +++ b/mysql-cluster/8.0/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.0.43.*' } + its ('version') { should match '8.0.44.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.0.43.*' } + its ('version') { should match '8.0.44.*' } end end diff --git a/mysql-cluster/8.4/Dockerfile b/mysql-cluster/8.4/Dockerfile index 8d79a4272..80e05a436 100644 --- a/mysql-cluster/8.4/Dockerfile +++ b/mysql-cluster/8.4/Dockerfile @@ -15,8 +15,8 @@ FROM container-registry.oracle.com/os/oraclelinux:9-slim -ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.4.6 -ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.4.6 +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.4.7 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.4.7 # Setup repositories for minimal packages (all versions) RUN rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ diff --git a/mysql-cluster/8.4/docker-entrypoint.sh b/mysql-cluster/8.4/docker-entrypoint.sh index a5caa46db..1d184f09f 100755 --- a/mysql-cluster/8.4/docker-entrypoint.sh +++ b/mysql-cluster/8.4/docker-entrypoint.sh @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA set -e -echo "[Entrypoint] MySQL Docker Image 8.4.6-1.2.22-cluster" +echo "[Entrypoint] MySQL Docker Image 8.4.7-1.2.23-cluster" # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults @@ -227,7 +227,7 @@ EOF echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..." exit 0 else - echo "[Entrypoint] Starting MySQL 8.4.6-1.2.22-cluster" + echo "[Entrypoint] Starting MySQL 8.4.7-1.2.23-cluster" fi export MYSQLD_PARENT_PID=$$ ; exec "$@" --user= else diff --git a/mysql-cluster/8.4/inspec/control.rb b/mysql-cluster/8.4/inspec/control.rb index 62c3aaeac..33300173f 100644 --- a/mysql-cluster/8.4/inspec/control.rb +++ b/mysql-cluster/8.4/inspec/control.rb @@ -11,10 +11,10 @@ impact 0.5 describe package('mysql-cluster-community-server-minimal') do it { should be_installed } - its ('version') { should match '8.4.6.*' } + its ('version') { should match '8.4.7.*' } end describe package('mysql-shell') do it { should be_installed } - its ('version') { should match '8.4.6.*' } + its ('version') { should match '8.4.7.*' } end end diff --git a/mysql-cluster/9.5/Dockerfile b/mysql-cluster/9.5/Dockerfile new file mode 100644 index 000000000..06e095d5c --- /dev/null +++ b/mysql-cluster/9.5/Dockerfile @@ -0,0 +1,47 @@ +# Copyright (c) 2017, 2023, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +FROM container-registry.oracle.com/os/oraclelinux:9-slim + +ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-9.5.0 +ARG MYSQL_SHELL_PACKAGE=mysql-shell-9.5.0 + +# Setup repositories for minimal packages (all versions) +RUN rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ + && rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm + +# Install server and shell 8.0 +RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ + && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ + && microdnf install -y --disablerepo=ol9_appstream \ + --enablerepo=mysql-cluster-innovation-community-minimal $MYSQL_SERVER_PACKAGE \ + && microdnf clean all \ + && mkdir /docker-entrypoint-initdb.d + +COPY prepare-image.sh / +RUN /prepare-image.sh && rm -f /prepare-image.sh + +ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock + +COPY docker-entrypoint.sh /entrypoint.sh +COPY healthcheck.sh /healthcheck.sh +COPY cnf/my.cnf /etc/ +COPY cnf/mysql-cluster.cnf /etc/ + +ENTRYPOINT ["/entrypoint.sh"] +HEALTHCHECK CMD /healthcheck.sh +EXPOSE 3306 33060-33061 2202 1186 +CMD ["mysqld"] + diff --git a/mysql-cluster/9.5/cnf/my.cnf b/mysql-cluster/9.5/cnf/my.cnf new file mode 100644 index 000000000..ec98b2dc1 --- /dev/null +++ b/mysql-cluster/9.5/cnf/my.cnf @@ -0,0 +1,22 @@ +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +[mysqld] +ndbcluster +ndb-connectstring=192.168.0.2 +user=mysql + +[mysql_cluster] +ndb-connectstring=192.168.0.2 diff --git a/mysql-cluster/9.5/cnf/mysql-cluster.cnf b/mysql-cluster/9.5/cnf/mysql-cluster.cnf new file mode 100644 index 000000000..16f79f1c0 --- /dev/null +++ b/mysql-cluster/9.5/cnf/mysql-cluster.cnf @@ -0,0 +1,39 @@ +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +[ndbd default] +NoOfReplicas=2 +DataMemory=80M +IndexMemory=18M + + +[ndb_mgmd] +NodeId=1 +hostname=192.168.0.2 +datadir=/var/lib/mysql + +[ndbd] +NodeId=2 +hostname=192.168.0.3 +datadir=/var/lib/mysql + +[ndbd] +NodeId=3 +hostname=192.168.0.4 +datadir=/var/lib/mysql + +[mysqld] +NodeId=4 +hostname=192.168.0.10 diff --git a/mysql-cluster/9.5/docker-entrypoint.sh b/mysql-cluster/9.5/docker-entrypoint.sh new file mode 100755 index 000000000..9c130f143 --- /dev/null +++ b/mysql-cluster/9.5/docker-entrypoint.sh @@ -0,0 +1,264 @@ +#!/bin/bash +# Copyright (c) 2017, 2021, Oracle and/or its affiliates. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +echo "[Entrypoint] MySQL Docker Image " +# Fetch value from server config +# We use mysqld --verbose --help instead of my_print_defaults because the +# latter only show values present in config files, and not server defaults +_get_config() { + local conf="$1"; shift + "$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }' +} + +# Generate a random password +_mkpw() { + letter=$(cat /dev/urandom| tr -dc a-zA-Z | dd bs=1 count=16 2> /dev/null ) + number=$(cat /dev/urandom| tr -dc 0-9 | dd bs=1 count=8 2> /dev/null) + special=$(cat /dev/urandom| tr -dc '=+@#%^&*_.,;:?/' | dd bs=1 count=8 2> /dev/null) + + echo $letter$number$special | fold -w 1 | shuf | tr -d '\n' +} + +# If command starts with an option, prepend mysqld +# This allows users to add command-line options without +# needing to specify the "mysqld" command +if [ "${1:0:1}" = '-' ]; then + set -- mysqld "$@" +fi + +# Check if entrypoint (and the container) is running as root +if [ $(id -u) = "0" ]; then + is_root=1 + install_devnull="install /dev/null -m0600 -omysql -gmysql" + MYSQLD_USER=mysql +else + install_devnull="install /dev/null -m0600" + MYSQLD_USER=$(id -u) +fi + +if [ "$1" = 'mysqld' ]; then + # Test that the server can start. We redirect stdout to /dev/null so + # only the error messages are left. + result=0 + output=$("$@" --validate-config) || result=$? + if [ ! "$result" = "0" ]; then + echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.' + echo >&2 "[Entrypoint] $output" + exit 1 + fi + + # Get config + DATADIR="$(_get_config 'datadir' "$@")" + SOCKET="$(_get_config 'socket' "$@")" + + if [ ! -d "$DATADIR/mysql" ]; then + # If the password variable is a filename we use the contents of the file. We + # read this first to make sure that a proper error is generated for empty files. + if [ -f "$MYSQL_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)" + if [ -z "$MYSQL_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.' + exit 1 + fi + fi + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + echo >&2 '[Entrypoint] No password option specified for new database.' + echo >&2 '[Entrypoint] A random onetime password will be generated.' + MYSQL_RANDOM_ROOT_PASSWORD=true + MYSQL_ONETIME_PASSWORD=true + fi + if [ ! -d "$DATADIR" ]; then + mkdir -p "$DATADIR" + chown mysql:mysql "$DATADIR" + fi + + # The user can set a default_timezone either in a my.cnf file + # they mount into the container or on command line + # (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`) + # however the timezone tables will only be populated in a later + # stage of this script. By using +00:00 as timezone we override + # the user's choice during initialization. Later the server + # will be restarted using the user's option. + + echo '[Entrypoint] Initializing database' + "$@" --user=$MYSQLD_USER --initialize-insecure --default-time-zone=+00:00 + + echo '[Entrypoint] Database initialized' + "$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" --default-time-zone=+00:00 + + # To avoid using password on commandline, put it in a temporary file. + # The file is only populated when and if the root password is set. + PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) + $install_devnull "$PASSFILE" + # Define the client command used throughout the script + # "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly + mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;") + + if [ ! -z %%STARTUP_WAIT%% ]; + then + for i in {30..0}; do + if mysqladmin --socket="$SOCKET" ping &>/dev/null; then + break + fi + echo '[Entrypoint] Waiting for server...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 '[Entrypoint] Timeout during MySQL init.' + exit 1 + fi + fi + + mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql + + if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + MYSQL_ROOT_PASSWORD="$(_mkpw)" + echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" + fi + if [ -z "$MYSQL_ROOT_HOST" ]; then + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';" + else + ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \ + GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \ + GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;" + fi + "${mysql[@]}" <<-EOSQL + DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost'); + CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass'; + ${ROOTCREATE} + FLUSH PRIVILEGES ; + EOSQL + if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then + # Put the password into the temporary config file + cat >"$PASSFILE" < "$SQL" +ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE; +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + else + cat << EOF > "$SQL" +ALTER USER 'root'@'localhost' PASSWORD EXPIRE; +EOF + fi + set -- "$@" --init-file="$SQL" + unset SQL + fi + fi + + echo + echo '[Entrypoint] MySQL init process done. Ready for start up.' + echo + fi + + # Used by healthcheck to make sure it doesn't mistakenly report container + # healthy during startup + # Put the password into the temporary config file + touch /var/lib/mysql-files/healthcheck.cnf + cat >"/var/lib/mysql-files/healthcheck.cnf" <