-
Notifications
You must be signed in to change notification settings - Fork 2.4k
MariaDB 10.6.0 alpha release, 10.1 is EOL #10070
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MariaDB 10.6.0 alpha release, 10.1 is EOL #10070
Conversation
Diff for 54fa6fd:diff --git a/_bashbrew-cat b/_bashbrew-cat
index ad2b1ed..5b81d9f 100644
--- a/_bashbrew-cat
+++ b/_bashbrew-cat
@@ -1,10 +1,5 @@
-Maintainers: Tianon Gravi <[email protected]> (@tianon), Joseph Ferguson <[email protected]> (@yosifkit)
-GitRepo: https://github.com/docker-library/mariadb.git
-
-Tags: 10.1.48-bionic, 10.1-bionic, 10.1.48, 10.1
-Architectures: amd64, arm64v8, ppc64le
-GitCommit: 0d197a924990af521cded73d04f113b06488844f
-Directory: 10.1
+Maintainers: Daniel Black <[email protected]> (@grooverdan), Daniel Bartholomew <[email protected]> (@dbart)
+GitRepo: https://github.com/MariaDB/mariadb-docker.git
Tags: 10.2.37-bionic, 10.2-bionic, 10.2.37, 10.2
Architectures: amd64, arm64v8, ppc64le
@@ -25,3 +20,8 @@ Tags: 10.5.9-focal, 10.5-focal, 10-focal, focal, 10.5.9, 10.5, 10, latest
Architectures: amd64, arm64v8, ppc64le
GitCommit: 5d57b119775458cd37994a0f313ea3a29603efbb
Directory: 10.5
+
+Tags: 10.6.0-focal, 10.6-focal, alpha-focal, 10.6.0, 10.6, alpha
+Architectures: amd64, arm64v8, ppc64le
+GitCommit: 40c61c4726ab063708a7f4137b81b39773e7dbd1
+Directory: 10.6
diff --git a/_bashbrew-list b/_bashbrew-list
index 68482f5..cb2c53a 100644
--- a/_bashbrew-list
+++ b/_bashbrew-list
@@ -1,9 +1,5 @@
mariadb:10
mariadb:10-focal
-mariadb:10.1
-mariadb:10.1-bionic
-mariadb:10.1.48
-mariadb:10.1.48-bionic
mariadb:10.2
mariadb:10.2-bionic
mariadb:10.2.37
@@ -20,5 +16,11 @@ mariadb:10.5
mariadb:10.5-focal
mariadb:10.5.9
mariadb:10.5.9-focal
+mariadb:10.6
+mariadb:10.6-focal
+mariadb:10.6.0
+mariadb:10.6.0-focal
+mariadb:alpha
+mariadb:alpha-focal
mariadb:focal
mariadb:latest
diff --git a/mariadb_10.1/Dockerfile b/mariadb_alpha/Dockerfile
similarity index 90%
rename from mariadb_10.1/Dockerfile
rename to mariadb_alpha/Dockerfile
index 81c4963..12e7eb1 100644
--- a/mariadb_10.1/Dockerfile
+++ b/mariadb_alpha/Dockerfile
@@ -1,5 +1,5 @@
# vim:set ft=dockerfile:
-FROM ubuntu:bionic
+FROM ubuntu:focal
# 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
@@ -21,9 +21,10 @@ RUN set -ex; \
# https://github.com/tianon/gosu/releases
ENV GOSU_VERSION 1.12
RUN set -eux; \
- savedAptMark="$(apt-mark showmanual)"; \
apt-get update; \
- apt-get install -y --no-install-recommends ca-certificates wget; \
+ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates; \
+ savedAptMark="$(apt-mark showmanual)"; \
+ apt-get install -y --no-install-recommends wget; \
rm -rf /var/lib/apt/lists/*; \
dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \
wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \
@@ -47,7 +48,7 @@ RUN mkdir /docker-entrypoint-initdb.d
# install "xz-utils" for .sql.xz docker-entrypoint-initdb.d files
RUN set -ex; \
apt-get update; \
- apt-get install -y --no-install-recommends \
+ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
pwgen \
tzdata \
xz-utils \
@@ -71,13 +72,13 @@ RUN set -ex; \
apt-key list
# bashbrew-architectures: amd64 arm64v8 ppc64le
-ENV MARIADB_MAJOR 10.1
-ENV MARIADB_VERSION 1:10.1.48+maria-1~bionic
-# release-status:Stable
+ENV MARIADB_MAJOR 10.6
+ENV MARIADB_VERSION 1:10.6.0+maria~focal
+# release-status:Alpha
# (https://downloads.mariadb.org/mariadb/+releases/)
RUN set -e;\
- echo "deb http://ftp.osuosl.org/pub/mariadb/repo/$MARIADB_MAJOR/ubuntu bionic main" > /etc/apt/sources.list.d/mariadb.list; \
+ echo "deb https://ftp.osuosl.org/pub/mariadb/repo/$MARIADB_MAJOR/ubuntu focal main" > /etc/apt/sources.list.d/mariadb.list; \
{ \
echo 'Package: *'; \
echo 'Pin: release o=MariaDB'; \
@@ -97,7 +98,7 @@ RUN set -ex; \
apt-get install -y \
"mariadb-server=$MARIADB_VERSION" \
# mariadb-backup is installed at the same time so that `mysql-common` is only installed once from just mariadb repos
- mariadb-backup-10.1 \
+ mariadb-backup \
socat \
; \
rm -rf /var/lib/apt/lists/*; \
@@ -117,7 +118,6 @@ RUN set -ex; \
VOLUME /var/lib/mysql
COPY docker-entrypoint.sh /usr/local/bin/
-RUN ln -s usr/local/bin/docker-entrypoint.sh / # backwards compat
ENTRYPOINT ["docker-entrypoint.sh"]
EXPOSE 3306
diff --git a/mariadb_10.1/docker-entrypoint.sh b/mariadb_alpha/docker-entrypoint.sh
similarity index 69%
rename from mariadb_10.1/docker-entrypoint.sh
rename to mariadb_alpha/docker-entrypoint.sh
index 1c4d1ce..4830d16 100755
--- a/mariadb_10.1/docker-entrypoint.sh
+++ b/mariadb_alpha/docker-entrypoint.sh
@@ -39,6 +39,18 @@ file_env() {
unset "$fileVar"
}
+# set MARIADB_xyz from MYSQL_xyz when MARIADB_xyz is unset
+# and make them the same value (so user scripts can use either)
+_mariadb_file_env() {
+ local var="$1"; shift
+ local maria="MARIADB_${var#MYSQL_}"
+ file_env "$var" "$@"
+ file_env "$maria" "${!var}"
+ if [ "${!maria:-}" ]; then
+ export "$var"="${!maria}"
+ fi
+}
+
# check to see if this file is being run or sourced from another script
_is_sourced() {
# https://unix.stackexchange.com/a/215279
@@ -102,7 +114,7 @@ mysql_get_config() {
# match "datadir /some/path with/spaces in/it here" but not "--xyz=abc\n datadir (xyz)"
}
-# Do a temporary startup of the MySQL server, for init purposes
+# Do a temporary startup of the MariaDB server, for init purposes
docker_temp_server_start() {
"$@" --skip-networking --socket="${SOCKET}" &
mysql_note "Waiting for server startup"
@@ -127,15 +139,17 @@ docker_temp_server_start() {
# Stop the server. When using a local socket file mysqladmin will block until
# the shutdown is complete.
docker_temp_server_stop() {
- if ! mysqladmin --defaults-extra-file=<( _mysql_passfile ) shutdown -uroot --socket="${SOCKET}"; then
+ export MYSQL_PWD=$MARIADB_ROOT_PASSWORD
+ if ! mysqladmin shutdown -uroot --socket="${SOCKET}"; then
mysql_error "Unable to shut down server."
fi
+ unset MYSQL_PWD
}
# Verify that the minimally required password settings are set for new databases.
docker_verify_minimum_env() {
- if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then
- mysql_error $'Database is uninitialized and password option is not specified\n\tYou need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD'
+ if [ -z "$MARIADB_ROOT_PASSWORD" -a -z "$MARIADB_ALLOW_EMPTY_ROOT_PASSWORD" -a -z "$MARIADB_RANDOM_ROOT_PASSWORD" ]; then
+ mysql_error $'Database is uninitialized and password option is not specified\n\tYou need to specify one of MARIADB_ROOT_PASSWORD, MARIADB_ALLOW_EMPTY_ROOT_PASSWORD and MARIADB_RANDOM_ROOT_PASSWORD'
fi
}
@@ -175,12 +189,21 @@ docker_setup_env() {
DATADIR="$(mysql_get_config 'datadir' "$@")"
SOCKET="$(mysql_get_config 'socket' "$@")"
+
# Initialize values that might be stored in a file
- file_env 'MYSQL_ROOT_HOST' '%'
- file_env 'MYSQL_DATABASE'
- file_env 'MYSQL_USER'
- file_env 'MYSQL_PASSWORD'
- file_env 'MYSQL_ROOT_PASSWORD'
+ _mariadb_file_env 'MYSQL_ROOT_HOST' '%'
+ _mariadb_file_env 'MYSQL_DATABASE'
+ _mariadb_file_env 'MYSQL_USER'
+ _mariadb_file_env 'MYSQL_PASSWORD'
+ _mariadb_file_env 'MYSQL_ROOT_PASSWORD'
+
+ # set MARIADB_ from MYSQL_ when it is unset and then make them the same value
+ : "${MARIADB_ALLOW_EMPTY_ROOT_PASSWORD:=${MYSQL_ALLOW_EMPTY_PASSWORD:-}}"
+ export MYSQL_ALLOW_EMPTY_PASSWORD="$MARIADB_ALLOW_EMPTY_ROOT_PASSWORD" MARIADB_ALLOW_EMPTY_ROOT_PASSWORD
+ : "${MARIADB_RANDOM_ROOT_PASSWORD:=${MYSQL_RANDOM_ROOT_PASSWORD:-}}"
+ export MYSQL_RANDOM_ROOT_PASSWORD="$MARIADB_RANDOM_ROOT_PASSWORD" MARIADB_RANDOM_ROOT_PASSWORD
+ : "${MARIADB_INITDB_SKIP_TZINFO:=${MYSQL_INITDB_SKIP_TZINFO:-}}"
+ export MYSQL_INITDB_SKIP_TZINFO="$MARIADB_INITDB_SKIP_TZINFO" MARIADB_INITDB_SKIP_TZINFO
declare -g DATABASE_ALREADY_EXISTS
if [ -d "$DATADIR/mysql" ]; then
@@ -195,21 +218,38 @@ docker_setup_env() {
docker_process_sql() {
passfileArgs=()
if [ '--dont-use-mysql-root-password' = "$1" ]; then
- passfileArgs+=( "$1" )
shift
+ unset MYSQL_PWD
+ else
+ export MYSQL_PWD=$MARIADB_ROOT_PASSWORD
fi
+ local count=5
+ while [ $count -gt 0 ] && [ ! -S "${SOCKET}" ]
+ do
+ count=$(( $count - 1 ))
+ mysql_note "Waiting for MariaDB to start, $count more seconds"
+ sleep 1
+ done
# args sent in can override this db, since they will be later in the command
if [ -n "$MYSQL_DATABASE" ]; then
set -- --database="$MYSQL_DATABASE" "$@"
fi
- mysql --defaults-extra-file=<( _mysql_passfile "${passfileArgs[@]}") --protocol=socket -uroot -hlocalhost --socket="${SOCKET}" "$@"
+ mysql --protocol=socket -uroot -hlocalhost --socket="${SOCKET}" "$@"
+ unset MYSQL_PWD
+}
+
+# SQL escape the string $1 to be placed in a string literal.
+# escape, \ followed by '
+docker_sql_escape_string_literal() {
+ local escaped=${1//\\/\\\\}
+ echo "${escaped//\'/\\\'}"
}
# Initializes database with timezone info and root password, plus optional extra db/user
docker_setup_db() {
# Load timezone info into database
- if [ -z "$MYSQL_INITDB_SKIP_TZINFO" ]; then
+ if [ -z "$MARIADB_INITDB_SKIP_TZINFO" ]; then
{
# Aria in 10.4+ is slow due to "transactional" (crash safety)
# https://jira.mariadb.org/browse/MDEV-23326
@@ -219,9 +259,11 @@ docker_setup_db() {
echo "/*!100400 ALTER TABLE $table TRANSACTIONAL=0 */;"
done
- # sed is for https://bugs.mysql.com/bug.php?id=20545
+ # sed on "Local time zone" is for https://bugs.mysql.com/bug.php?id=20545
+ # Offset quoting is because of MDEV-25556 (10.6)
mysql_tzinfo_to_sql /usr/share/zoneinfo \
- | sed 's/Local time zone must be set--see zic manual page/FCTY/'
+ | sed -e 's/Local time zone must be set--see zic manual page/FCTY/' \
+ -e 's/Offset/`Offset`/'
for table in "${tztables[@]}"; do
echo "/*!100400 ALTER TABLE $table TRANSACTIONAL=1 */;"
@@ -230,30 +272,36 @@ docker_setup_db() {
# tell docker_process_sql to not use MYSQL_ROOT_PASSWORD since it is not set yet
fi
# Generate random root password
- if [ -n "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then
- export MYSQL_ROOT_PASSWORD="$(pwgen -1 32)"
- mysql_note "GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD"
+ if [ -n "$MARIADB_RANDOM_ROOT_PASSWORD" ]; then
+ export MARIADB_ROOT_PASSWORD="$(pwgen --numerals --capitalize --symbols --remove-chars="'\\" -1 32)"
+ export MYSQL_ROOT_PASSWORD=$MARIADB_ROOT_PASSWORD
+ mysql_note "GENERATED ROOT PASSWORD: $MARIADB_ROOT_PASSWORD"
fi
# Sets root password and creates root users for non-localhost hosts
local rootCreate=
+ local rootPasswordEscaped=$( docker_sql_escape_string_literal "${MARIADB_ROOT_PASSWORD}" )
+
# default root to listen for connections from anywhere
- if [ -n "$MYSQL_ROOT_HOST" ] && [ "$MYSQL_ROOT_HOST" != 'localhost' ]; then
+ if [ -n "$MARIADB_ROOT_HOST" ] && [ "$MARIADB_ROOT_HOST" != 'localhost' ]; then
# no, we don't care if read finds a terminating character in this heredoc
# https://unix.stackexchange.com/questions/265149/why-is-set-o-errexit-breaking-this-read-heredoc-expression/265151#265151
read -r -d '' rootCreate <<-EOSQL || true
- CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}' ;
- GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;
+ CREATE USER 'root'@'${MARIADB_ROOT_HOST}' IDENTIFIED BY '${rootPasswordEscaped}' ;
+ GRANT ALL ON *.* TO 'root'@'${MARIADB_ROOT_HOST}' WITH GRANT OPTION ;
EOSQL
fi
- # tell docker_process_sql to not use MYSQL_ROOT_PASSWORD since it is just now being set
- docker_process_sql --dont-use-mysql-root-password --database=mysql <<-EOSQL
+ # tell docker_process_sql to not use MARIADB_ROOT_PASSWORD since it is just now being set
+ # --binary-mode to save us from the semi-mad users go out of their way to confuse the encoding.
+ docker_process_sql --dont-use-mysql-root-password --database=mysql --binary-mode <<-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;
+ -- we need the SQL_MODE NO_BACKSLASH_ESCAPES mode to be clear for the password to be set
+ SET @@SESSION.SQL_MODE=REPLACE(@@SESSION.SQL_MODE, 'NO_BACKSLASH_ESCAPES', '');
DELETE FROM mysql.user WHERE user NOT IN ('mysql.sys', 'mariadb.sys', 'mysqlxsys', 'root') OR host NOT IN ('localhost') ;
- SET PASSWORD FOR 'root'@'localhost'=PASSWORD('${MYSQL_ROOT_PASSWORD}') ;
+ SET PASSWORD FOR 'root'@'localhost'=PASSWORD('${rootPasswordEscaped}') ;
-- 10.1: https://github.com/MariaDB/server/blob/d925aec1c10cebf6c34825a7de50afe4e630aff4/scripts/mysql_secure_installation.sh#L347-L365
-- 10.5: https://github.com/MariaDB/server/blob/00c3a28820c67c37ebbca72691f4897b57f2eed5/scripts/mysql_secure_installation.sh#L351-L369
DELETE FROM mysql.db WHERE Db='test' OR Db='test\_%' ;
@@ -265,31 +313,24 @@ docker_setup_db() {
EOSQL
# Creates a custom database and user if specified
- if [ -n "$MYSQL_DATABASE" ]; then
- mysql_note "Creating database ${MYSQL_DATABASE}"
- docker_process_sql --database=mysql <<<"CREATE DATABASE IF NOT EXISTS \`$MYSQL_DATABASE\` ;"
+ if [ -n "$MARIADB_DATABASE" ]; then
+ mysql_note "Creating database ${MARIADB_DATABASE}"
+ docker_process_sql --database=mysql <<<"CREATE DATABASE IF NOT EXISTS \`$MARIADB_DATABASE\` ;"
fi
- if [ -n "$MYSQL_USER" ] && [ -n "$MYSQL_PASSWORD" ]; then
- mysql_note "Creating user ${MYSQL_USER}"
- docker_process_sql --database=mysql <<<"CREATE USER '$MYSQL_USER'@'%' IDENTIFIED BY '$MYSQL_PASSWORD' ;"
-
- if [ -n "$MYSQL_DATABASE" ]; then
- mysql_note "Giving user ${MYSQL_USER} access to schema ${MYSQL_DATABASE}"
- docker_process_sql --database=mysql <<<"GRANT ALL ON \`${MYSQL_DATABASE//_/\\_}\`.* TO '$MYSQL_USER'@'%' ;"
- fi
+ if [ -n "$MARIADB_USER" ] && [ -n "$MARIADB_PASSWORD" ]; then
+ mysql_note "Creating user ${MARIADB_USER}"
+ # SQL escape the user password, \ followed by '
+ local userPasswordEscaped=$( docker_sql_escape_string_literal "${MARIADB_PASSWORD}" )
+ docker_process_sql --database=mysql --binary-mode <<-EOSQL_USER
+ SET @@SESSION.SQL_MODE=REPLACE(@@SESSION.SQL_MODE, 'NO_BACKSLASH_ESCAPES', '');
+ CREATE USER '$MARIADB_USER'@'%' IDENTIFIED BY '$userPasswordEscaped';
+ EOSQL_USER
+
+ if [ -n "$MARIADB_DATABASE" ]; then
+ mysql_note "Giving user ${MARIADB_USER} access to schema ${MARIADB_DATABASE}"
+ docker_process_sql --database=mysql <<<"GRANT ALL ON \`${MARIADB_DATABASE//_/\\_}\`.* TO '$MARIADB_USER'@'%' ;"
fi
-}
-
-_mysql_passfile() {
- # echo the password to the "file" the client uses
- # the client command will use process substitution to create a file on the fly
- # ie: --defaults-extra-file=<( _mysql_passfile )
- if [ '--dont-use-mysql-root-password' != "$1" ] && [ -n "$MYSQL_ROOT_PASSWORD" ]; then
- cat <<-EOF
- [client]
- password="${MYSQL_ROOT_PASSWORD}"
- EOF
fi
}
@@ -315,7 +356,7 @@ _main() {
# skip setup if they aren't running mysqld or want an option that stops mysqld
if [ "$1" = 'mysqld' ] && ! _mysql_want_help "$@"; then
- mysql_note "Entrypoint script for MySQL Server ${MARIADB_VERSION} started."
+ mysql_note "Entrypoint script for MariaDB Server ${MARIADB_VERSION} started."
mysql_check_config "$@"
# Load various environment variables
@@ -349,7 +390,7 @@ _main() {
mysql_note "Temporary server stopped"
echo
- mysql_note "MySQL init process done. Ready for start up."
+ mysql_note "MariaDB init process done. Ready for start up."
echo
fi
fi
|
docker_temp_server_stop() {
- if ! mysqladmin --defaults-extra-file=<( _mysql_passfile ) shutdown -uroot --socket="${SOCKET}"; then
+ export MYSQL_PWD=$MARIADB_ROOT_PASSWORD
+ if ! mysqladmin shutdown -uroot --socket="${SOCKET}"; then
mysql_error "Unable to shut down server."
fi
+ unset MYSQL_PWD
} This could probably be simplified to: docker_temp_server_stop() {
if ! MYSQL_PWD="$MARIADB_ROOT_PASSWORD" mysqladmin shutdown -uroot --socket="${SOCKET}"; then
mysql_error "Unable to shut down server."
fi
} (Then it's not touching the global environment.) There's a similar issue with the changes to + export MARIADB_ROOT_PASSWORD="$(pwgen --numerals --capitalize --symbols --remove-chars="'\\" -1 32)" If MARIADB_ROOT_PASSWORD="$(pwgen --numerals --capitalize --symbols --remove-chars="'\\" -1 32)"; export MARIADB_ROOT_PASSWORD or separate lines joining with the next statement, perhaps: MARIADB_ROOT_PASSWORD="$(pwgen --numerals --capitalize --symbols --remove-chars="'\\" -1 32)"
export MARIADB_ROOT_PASSWORD MYSQL_ROOT_PASSWORD=$MARIADB_ROOT_PASSWORD + local rootPasswordEscaped=$( docker_sql_escape_string_literal "${MARIADB_ROOT_PASSWORD}" ) similar problem/solution: local rootPasswordEscaped
rootPasswordEscaped=$( docker_sql_escape_string_literal "${MARIADB_ROOT_PASSWORD}" ) (and again for I usually style those as |
Overall though, LGTM and it's great to have this file updated to match the new maintainership 😄 👍 Do you want us to merge this now and take those as async advice or do you want to work on some of those pre-merge? |
(You probably also want to update all the other images with the new script/changes, right?) |
The other images are getting released in maybe the next 1-2 weeks so was going to incorporate those changes then. The idea that a released specific version tag could change is a little foreign/frighting to me.
A merge sounds good to me. Thanks for the review. I'll look at getting those fixes in soon. |
This is an unfortunate limitation of the way containers get consumed such that it's actually a core "feature" of the official images program: https://github.com/docker-library/repo-info/commits/master/repos/mariadb/remote/10.1.48.md (this is the history of times For users who want to make sure what they're consuming "never changes", that's what the content-addressable digest is for (ie, the current All that being said, we try to keep major/breaking changes to a minimum, but in our experience users will hit those regardless of whether they're in a specific version or whether you do it on a major/minor bump (and will complain loudly), so 🤷. |
set -e failures in pipelines will leave variables unset. Thanks @tianon ref: docker-library/official-images#10070
Hi,
We've done our 10.6.0 alpha release.
I've tested this against some updated tests https://github.com/grooverdan/official-images/blob/mariadb-tests/test/tests/mariadb-extras/run.sh that passes, (though it depends on local mysql for connections, so I do need to clean that up before submitting).
Next major release will be coming soon.