-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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: 2022-09-19 out of cycle release #13184
Merged
yosifkit
merged 1 commit into
docker-library:master
from
grooverdan:mariadb-release-20220919
Sep 20, 2022
Merged
mariadb: 2022-09-19 out of cycle release #13184
yosifkit
merged 1 commit into
docker-library:master
from
grooverdan:mariadb-release-20220919
Sep 20, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fixes a few significant MDEVs on 10.6+ per https://mariadb.com/kb/en/mariadb-10610-release-notes/. Also adds the MARIADB_{ROOT_,}PASSWORD_HASH option thanks to @TheAlgorythm.
Diff for ab4941b:diff --git a/_bashbrew-cat b/_bashbrew-cat
index a911857..05b8e7d 100644
--- a/_bashbrew-cat
+++ b/_bashbrew-cat
@@ -3,40 +3,40 @@ GitRepo: https://github.com/MariaDB/mariadb-docker.git
Tags: 10.3.36-focal, 10.3-focal, 10.3.36, 10.3
Architectures: amd64, arm64v8, ppc64le
-GitCommit: 97e6715fb9f86010de510eef718f7341e3011c25
+GitCommit: 749c720c63306d1572849afc6ab1cfa02fd08338
Directory: 10.3
Tags: 10.4.26-focal, 10.4-focal, 10.4.26, 10.4
Architectures: amd64, arm64v8, ppc64le
-GitCommit: 97e6715fb9f86010de510eef718f7341e3011c25
+GitCommit: 749c720c63306d1572849afc6ab1cfa02fd08338
Directory: 10.4
Tags: 10.5.17-focal, 10.5-focal, 10.5.17, 10.5
Architectures: amd64, arm64v8, ppc64le, s390x
-GitCommit: 97e6715fb9f86010de510eef718f7341e3011c25
+GitCommit: 749c720c63306d1572849afc6ab1cfa02fd08338
Directory: 10.5
-Tags: 10.6.9-focal, 10.6-focal, 10.6.9, 10.6
+Tags: 10.6.10-focal, 10.6-focal, 10.6.10, 10.6
Architectures: amd64, arm64v8, ppc64le, s390x
-GitCommit: 97e6715fb9f86010de510eef718f7341e3011c25
+GitCommit: 749c720c63306d1572849afc6ab1cfa02fd08338
Directory: 10.6
-Tags: 10.7.5-focal, 10.7-focal, 10.7.5, 10.7
+Tags: 10.7.6-focal, 10.7-focal, 10.7.6, 10.7
Architectures: amd64, arm64v8, ppc64le, s390x
-GitCommit: 97e6715fb9f86010de510eef718f7341e3011c25
+GitCommit: 749c720c63306d1572849afc6ab1cfa02fd08338
Directory: 10.7
-Tags: 10.8.4-jammy, 10.8-jammy, 10.8.4, 10.8
+Tags: 10.8.5-jammy, 10.8-jammy, 10.8.5, 10.8
Architectures: amd64, arm64v8, ppc64le, s390x
-GitCommit: 97e6715fb9f86010de510eef718f7341e3011c25
+GitCommit: 749c720c63306d1572849afc6ab1cfa02fd08338
Directory: 10.8
-Tags: 10.9.2-jammy, 10.9-jammy, 10-jammy, jammy, 10.9.2, 10.9, 10, latest
+Tags: 10.9.3-jammy, 10.9-jammy, 10-jammy, jammy, 10.9.3, 10.9, 10, latest
Architectures: amd64, arm64v8, ppc64le, s390x
-GitCommit: 97e6715fb9f86010de510eef718f7341e3011c25
+GitCommit: 749c720c63306d1572849afc6ab1cfa02fd08338
Directory: 10.9
Tags: 10.10.1-rc-jammy, 10.10-rc-jammy, 10.10.1-rc, 10.10-rc
Architectures: amd64, arm64v8, ppc64le, s390x
-GitCommit: 97e6715fb9f86010de510eef718f7341e3011c25
+GitCommit: 749c720c63306d1572849afc6ab1cfa02fd08338
Directory: 10.10
diff --git a/_bashbrew-list b/_bashbrew-list
index 2838fd1..ca5c1ad 100644
--- a/_bashbrew-list
+++ b/_bashbrew-list
@@ -14,20 +14,20 @@ mariadb:10.5.17
mariadb:10.5.17-focal
mariadb:10.6
mariadb:10.6-focal
-mariadb:10.6.9
-mariadb:10.6.9-focal
+mariadb:10.6.10
+mariadb:10.6.10-focal
mariadb:10.7
mariadb:10.7-focal
-mariadb:10.7.5
-mariadb:10.7.5-focal
+mariadb:10.7.6
+mariadb:10.7.6-focal
mariadb:10.8
mariadb:10.8-jammy
-mariadb:10.8.4
-mariadb:10.8.4-jammy
+mariadb:10.8.5
+mariadb:10.8.5-jammy
mariadb:10.9
mariadb:10.9-jammy
-mariadb:10.9.2
-mariadb:10.9.2-jammy
+mariadb:10.9.3
+mariadb:10.9.3-jammy
mariadb:10.10-rc
mariadb:10.10-rc-jammy
mariadb:10.10.1-rc
diff --git a/mariadb_10.10-rc/docker-entrypoint.sh b/mariadb_10.10-rc/docker-entrypoint.sh
index 2f192b8..6f21eac 100755
--- a/mariadb_10.10-rc/docker-entrypoint.sh
+++ b/mariadb_10.10-rc/docker-entrypoint.sh
@@ -154,8 +154,15 @@ docker_temp_server_stop() {
# Verify that the minimally required password settings are set for new databases.
docker_verify_minimum_env() {
- if [ -z "$MARIADB_ROOT_PASSWORD" ] && [ -z "$MARIADB_ALLOW_EMPTY_ROOT_PASSWORD" ] && [ -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'
+ if [ -z "$MARIADB_ROOT_PASSWORD" ] && [ -z "$MARIADB_ROOT_PASSWORD_HASH" ] && [ -z "$MARIADB_ALLOW_EMPTY_ROOT_PASSWORD" ] && [ -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_ROOT_PASSWORD_HASH, MARIADB_ALLOW_EMPTY_ROOT_PASSWORD and MARIADB_RANDOM_ROOT_PASSWORD'
+ fi
+ # More preemptive exclusions of combinations should have been made before *PASSWORD_HASH was added, but for now we don't enforce due to compatibility.
+ if [ -n "$MARIADB_ROOT_PASSWORD" ] || [ -n "$MARIADB_ALLOW_EMPTY_ROOT_PASSWORD" ] || [ -n "$MARIADB_RANDOM_ROOT_PASSWORD" ] && [ -n "$MARIADB_ROOT_PASSWORD_HASH" ]; then
+ mysql_error "Cannot specify MARIADB_ROOT_PASSWORD_HASH and another MARIADB_ROOT_PASSWORD* option."
+ fi
+ if [ -n "$MARIADB_PASSWORD" ] && [ -n "$MARIADB_PASSWORD_HASH" ]; then
+ mysql_error "Cannot specify MARIADB_PASSWORD_HASH and MARIADB_PASSWORD option."
fi
}
@@ -212,6 +219,9 @@ docker_setup_env() {
_mariadb_file_env 'MYSQL_USER'
_mariadb_file_env 'MYSQL_PASSWORD'
_mariadb_file_env 'MYSQL_ROOT_PASSWORD'
+ # No MYSQL_ compatibility needed for new variables
+ file_env 'MARIADB_PASSWORD_HASH'
+ file_env 'MARIADB_ROOT_PASSWORD_HASH'
# set MARIADB_ from MYSQL_ when it is unset and then make them the same value
: "${MARIADB_ALLOW_EMPTY_ROOT_PASSWORD:=${MYSQL_ALLOW_EMPTY_PASSWORD:-}}"
@@ -278,19 +288,28 @@ docker_setup_db() {
export MARIADB_ROOT_PASSWORD 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
+
+ # Creates root users for non-localhost hosts
local rootCreate=
- local rootPasswordEscaped
- rootPasswordEscaped=$( docker_sql_escape_string_literal "${MARIADB_ROOT_PASSWORD}" )
# default root to listen for connections from anywhere
if [ -n "$MARIADB_ROOT_HOST" ] && [ "$MARIADB_ROOT_HOST" != 'localhost' ]; then
+ if [ -n "$MARIADB_ROOT_PASSWORD" ]; then
+ # Sets root password and creates root users for non-localhost hosts
+ local rootPasswordEscaped
+ rootPasswordEscaped=$( docker_sql_escape_string_literal "${MARIADB_ROOT_PASSWORD}" )
# 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'@'${MARIADB_ROOT_HOST}' IDENTIFIED BY '${rootPasswordEscaped}' ;
GRANT ALL ON *.* TO 'root'@'${MARIADB_ROOT_HOST}' WITH GRANT OPTION ;
EOSQL
+ else
+ read -r -d '' rootCreate <<-EOSQL || true
+ CREATE USER 'root'@'${MARIADB_ROOT_HOST}' IDENTIFIED BY PASSWORD '${MARIADB_ROOT_PASSWORD_HASH}' ;
+ GRANT ALL ON *.* TO 'root'@'${MARIADB_ROOT_HOST}' WITH GRANT OPTION ;
+ EOSQL
+ fi
fi
local mysqlAtLocalhost=
@@ -343,8 +362,9 @@ docker_setup_db() {
docker_process_sql --database=mysql <<<"CREATE DATABASE IF NOT EXISTS \`$MARIADB_DATABASE\` ;"
fi
- if [ -n "$MARIADB_USER" ] && [ -n "$MARIADB_PASSWORD" ]; then
+ if [ -n "$MARIADB_PASSWORD" ] || [ -n "$MARIADB_PASSWORD_HASH" ] && [ -n "$MARIADB_USER" ]; then
mysql_note "Creating user ${MARIADB_USER}"
+ if [ -n "$MARIADB_PASSWORD" ]; then
# SQL escape the user password, \ followed by '
local userPasswordEscaped
userPasswordEscaped=$( docker_sql_escape_string_literal "${MARIADB_PASSWORD}" )
@@ -352,6 +372,12 @@ docker_setup_db() {
SET @@SESSION.SQL_MODE=REPLACE(@@SESSION.SQL_MODE, 'NO_BACKSLASH_ESCAPES', '');
CREATE USER '$MARIADB_USER'@'%' IDENTIFIED BY '$userPasswordEscaped';
EOSQL_USER
+ else
+ 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 PASSWORD '$MARIADB_PASSWORD_HASH';
+ EOSQL_USER
+ fi
if [ -n "$MARIADB_DATABASE" ]; then
mysql_note "Giving user ${MARIADB_USER} access to schema ${MARIADB_DATABASE}"
diff --git a/mariadb_10.3/docker-entrypoint.sh b/mariadb_10.3/docker-entrypoint.sh
index a168efb..e94d5af 100755
--- a/mariadb_10.3/docker-entrypoint.sh
+++ b/mariadb_10.3/docker-entrypoint.sh
@@ -154,8 +154,15 @@ docker_temp_server_stop() {
# Verify that the minimally required password settings are set for new databases.
docker_verify_minimum_env() {
- if [ -z "$MARIADB_ROOT_PASSWORD" ] && [ -z "$MARIADB_ALLOW_EMPTY_ROOT_PASSWORD" ] && [ -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'
+ if [ -z "$MARIADB_ROOT_PASSWORD" ] && [ -z "$MARIADB_ROOT_PASSWORD_HASH" ] && [ -z "$MARIADB_ALLOW_EMPTY_ROOT_PASSWORD" ] && [ -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_ROOT_PASSWORD_HASH, MARIADB_ALLOW_EMPTY_ROOT_PASSWORD and MARIADB_RANDOM_ROOT_PASSWORD'
+ fi
+ # More preemptive exclusions of combinations should have been made before *PASSWORD_HASH was added, but for now we don't enforce due to compatibility.
+ if [ -n "$MARIADB_ROOT_PASSWORD" ] || [ -n "$MARIADB_ALLOW_EMPTY_ROOT_PASSWORD" ] || [ -n "$MARIADB_RANDOM_ROOT_PASSWORD" ] && [ -n "$MARIADB_ROOT_PASSWORD_HASH" ]; then
+ mysql_error "Cannot specify MARIADB_ROOT_PASSWORD_HASH and another MARIADB_ROOT_PASSWORD* option."
+ fi
+ if [ -n "$MARIADB_PASSWORD" ] && [ -n "$MARIADB_PASSWORD_HASH" ]; then
+ mysql_error "Cannot specify MARIADB_PASSWORD_HASH and MARIADB_PASSWORD option."
fi
}
@@ -212,6 +219,9 @@ docker_setup_env() {
_mariadb_file_env 'MYSQL_USER'
_mariadb_file_env 'MYSQL_PASSWORD'
_mariadb_file_env 'MYSQL_ROOT_PASSWORD'
+ # No MYSQL_ compatibility needed for new variables
+ file_env 'MARIADB_PASSWORD_HASH'
+ file_env 'MARIADB_ROOT_PASSWORD_HASH'
# set MARIADB_ from MYSQL_ when it is unset and then make them the same value
: "${MARIADB_ALLOW_EMPTY_ROOT_PASSWORD:=${MYSQL_ALLOW_EMPTY_PASSWORD:-}}"
@@ -278,19 +288,28 @@ docker_setup_db() {
export MARIADB_ROOT_PASSWORD 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
+
+ # Creates root users for non-localhost hosts
local rootCreate=
- local rootPasswordEscaped
- rootPasswordEscaped=$( docker_sql_escape_string_literal "${MARIADB_ROOT_PASSWORD}" )
# default root to listen for connections from anywhere
if [ -n "$MARIADB_ROOT_HOST" ] && [ "$MARIADB_ROOT_HOST" != 'localhost' ]; then
+ if [ -n "$MARIADB_ROOT_PASSWORD" ]; then
+ # Sets root password and creates root users for non-localhost hosts
+ local rootPasswordEscaped
+ rootPasswordEscaped=$( docker_sql_escape_string_literal "${MARIADB_ROOT_PASSWORD}" )
# 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'@'${MARIADB_ROOT_HOST}' IDENTIFIED BY '${rootPasswordEscaped}' ;
GRANT ALL ON *.* TO 'root'@'${MARIADB_ROOT_HOST}' WITH GRANT OPTION ;
EOSQL
+ else
+ read -r -d '' rootCreate <<-EOSQL || true
+ CREATE USER 'root'@'${MARIADB_ROOT_HOST}' IDENTIFIED BY PASSWORD '${MARIADB_ROOT_PASSWORD_HASH}' ;
+ GRANT ALL ON *.* TO 'root'@'${MARIADB_ROOT_HOST}' WITH GRANT OPTION ;
+ EOSQL
+ fi
fi
local mysqlAtLocalhost=
@@ -343,8 +362,9 @@ docker_setup_db() {
docker_process_sql --database=mysql <<<"CREATE DATABASE IF NOT EXISTS \`$MARIADB_DATABASE\` ;"
fi
- if [ -n "$MARIADB_USER" ] && [ -n "$MARIADB_PASSWORD" ]; then
+ if [ -n "$MARIADB_PASSWORD" ] || [ -n "$MARIADB_PASSWORD_HASH" ] && [ -n "$MARIADB_USER" ]; then
mysql_note "Creating user ${MARIADB_USER}"
+ if [ -n "$MARIADB_PASSWORD" ]; then
# SQL escape the user password, \ followed by '
local userPasswordEscaped
userPasswordEscaped=$( docker_sql_escape_string_literal "${MARIADB_PASSWORD}" )
@@ -352,6 +372,12 @@ docker_setup_db() {
SET @@SESSION.SQL_MODE=REPLACE(@@SESSION.SQL_MODE, 'NO_BACKSLASH_ESCAPES', '');
CREATE USER '$MARIADB_USER'@'%' IDENTIFIED BY '$userPasswordEscaped';
EOSQL_USER
+ else
+ 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 PASSWORD '$MARIADB_PASSWORD_HASH';
+ EOSQL_USER
+ fi
if [ -n "$MARIADB_DATABASE" ]; then
mysql_note "Giving user ${MARIADB_USER} access to schema ${MARIADB_DATABASE}"
diff --git a/mariadb_10.4/docker-entrypoint.sh b/mariadb_10.4/docker-entrypoint.sh
index a168efb..e94d5af 100755
--- a/mariadb_10.4/docker-entrypoint.sh
+++ b/mariadb_10.4/docker-entrypoint.sh
@@ -154,8 +154,15 @@ docker_temp_server_stop() {
# Verify that the minimally required password settings are set for new databases.
docker_verify_minimum_env() {
- if [ -z "$MARIADB_ROOT_PASSWORD" ] && [ -z "$MARIADB_ALLOW_EMPTY_ROOT_PASSWORD" ] && [ -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'
+ if [ -z "$MARIADB_ROOT_PASSWORD" ] && [ -z "$MARIADB_ROOT_PASSWORD_HASH" ] && [ -z "$MARIADB_ALLOW_EMPTY_ROOT_PASSWORD" ] && [ -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_ROOT_PASSWORD_HASH, MARIADB_ALLOW_EMPTY_ROOT_PASSWORD and MARIADB_RANDOM_ROOT_PASSWORD'
+ fi
+ # More preemptive exclusions of combinations should have been made before *PASSWORD_HASH was added, but for now we don't enforce due to compatibility.
+ if [ -n "$MARIADB_ROOT_PASSWORD" ] || [ -n "$MARIADB_ALLOW_EMPTY_ROOT_PASSWORD" ] || [ -n "$MARIADB_RANDOM_ROOT_PASSWORD" ] && [ -n "$MARIADB_ROOT_PASSWORD_HASH" ]; then
+ mysql_error "Cannot specify MARIADB_ROOT_PASSWORD_HASH and another MARIADB_ROOT_PASSWORD* option."
+ fi
+ if [ -n "$MARIADB_PASSWORD" ] && [ -n "$MARIADB_PASSWORD_HASH" ]; then
+ mysql_error "Cannot specify MARIADB_PASSWORD_HASH and MARIADB_PASSWORD option."
fi
}
@@ -212,6 +219,9 @@ docker_setup_env() {
_mariadb_file_env 'MYSQL_USER'
_mariadb_file_env 'MYSQL_PASSWORD'
_mariadb_file_env 'MYSQL_ROOT_PASSWORD'
+ # No MYSQL_ compatibility needed for new variables
+ file_env 'MARIADB_PASSWORD_HASH'
+ file_env 'MARIADB_ROOT_PASSWORD_HASH'
# set MARIADB_ from MYSQL_ when it is unset and then make them the same value
: "${MARIADB_ALLOW_EMPTY_ROOT_PASSWORD:=${MYSQL_ALLOW_EMPTY_PASSWORD:-}}"
@@ -278,19 +288,28 @@ docker_setup_db() {
export MARIADB_ROOT_PASSWORD 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
+
+ # Creates root users for non-localhost hosts
local rootCreate=
- local rootPasswordEscaped
- rootPasswordEscaped=$( docker_sql_escape_string_literal "${MARIADB_ROOT_PASSWORD}" )
# default root to listen for connections from anywhere
if [ -n "$MARIADB_ROOT_HOST" ] && [ "$MARIADB_ROOT_HOST" != 'localhost' ]; then
+ if [ -n "$MARIADB_ROOT_PASSWORD" ]; then
+ # Sets root password and creates root users for non-localhost hosts
+ local rootPasswordEscaped
+ rootPasswordEscaped=$( docker_sql_escape_string_literal "${MARIADB_ROOT_PASSWORD}" )
# 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'@'${MARIADB_ROOT_HOST}' IDENTIFIED BY '${rootPasswordEscaped}' ;
GRANT ALL ON *.* TO 'root'@'${MARIADB_ROOT_HOST}' WITH GRANT OPTION ;
EOSQL
+ else
+ read -r -d '' rootCreate <<-EOSQL || true
+ CREATE USER 'root'@'${MARIADB_ROOT_HOST}' IDENTIFIED BY PASSWORD '${MARIADB_ROOT_PASSWORD_HASH}' ;
+ GRANT ALL ON *.* TO 'root'@'${MARIADB_ROOT_HOST}' WITH GRANT OPTION ;
+ EOSQL
+ fi
fi
local mysqlAtLocalhost=
@@ -343,8 +362,9 @@ docker_setup_db() {
docker_process_sql --database=mysql <<<"CREATE DATABASE IF NOT EXISTS \`$MARIADB_DATABASE\` ;"
fi
- if [ -n "$MARIADB_USER" ] && [ -n "$MARIADB_PASSWORD" ]; then
+ if [ -n "$MARIADB_PASSWORD" ] || [ -n "$MARIADB_PASSWORD_HASH" ] && [ -n "$MARIADB_USER" ]; then
mysql_note "Creating user ${MARIADB_USER}"
+ if [ -n "$MARIADB_PASSWORD" ]; then
# SQL escape the user password, \ followed by '
local userPasswordEscaped
userPasswordEscaped=$( docker_sql_escape_string_literal "${MARIADB_PASSWORD}" )
@@ -352,6 +372,12 @@ docker_setup_db() {
SET @@SESSION.SQL_MODE=REPLACE(@@SESSION.SQL_MODE, 'NO_BACKSLASH_ESCAPES', '');
CREATE USER '$MARIADB_USER'@'%' IDENTIFIED BY '$userPasswordEscaped';
EOSQL_USER
+ else
+ 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 PASSWORD '$MARIADB_PASSWORD_HASH';
+ EOSQL_USER
+ fi
if [ -n "$MARIADB_DATABASE" ]; then
mysql_note "Giving user ${MARIADB_USER} access to schema ${MARIADB_DATABASE}"
diff --git a/mariadb_10.5/docker-entrypoint.sh b/mariadb_10.5/docker-entrypoint.sh
index a168efb..e94d5af 100755
--- a/mariadb_10.5/docker-entrypoint.sh
+++ b/mariadb_10.5/docker-entrypoint.sh
@@ -154,8 +154,15 @@ docker_temp_server_stop() {
# Verify that the minimally required password settings are set for new databases.
docker_verify_minimum_env() {
- if [ -z "$MARIADB_ROOT_PASSWORD" ] && [ -z "$MARIADB_ALLOW_EMPTY_ROOT_PASSWORD" ] && [ -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'
+ if [ -z "$MARIADB_ROOT_PASSWORD" ] && [ -z "$MARIADB_ROOT_PASSWORD_HASH" ] && [ -z "$MARIADB_ALLOW_EMPTY_ROOT_PASSWORD" ] && [ -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_ROOT_PASSWORD_HASH, MARIADB_ALLOW_EMPTY_ROOT_PASSWORD and MARIADB_RANDOM_ROOT_PASSWORD'
+ fi
+ # More preemptive exclusions of combinations should have been made before *PASSWORD_HASH was added, but for now we don't enforce due to compatibility.
+ if [ -n "$MARIADB_ROOT_PASSWORD" ] || [ -n "$MARIADB_ALLOW_EMPTY_ROOT_PASSWORD" ] || [ -n "$MARIADB_RANDOM_ROOT_PASSWORD" ] && [ -n "$MARIADB_ROOT_PASSWORD_HASH" ]; then
+ mysql_error "Cannot specify MARIADB_ROOT_PASSWORD_HASH and another MARIADB_ROOT_PASSWORD* option."
+ fi
+ if [ -n "$MARIADB_PASSWORD" ] && [ -n "$MARIADB_PASSWORD_HASH" ]; then
+ mysql_error "Cannot specify MARIADB_PASSWORD_HASH and MARIADB_PASSWORD option."
fi
}
@@ -212,6 +219,9 @@ docker_setup_env() {
_mariadb_file_env 'MYSQL_USER'
_mariadb_file_env 'MYSQL_PASSWORD'
_mariadb_file_env 'MYSQL_ROOT_PASSWORD'
+ # No MYSQL_ compatibility needed for new variables
+ file_env 'MARIADB_PASSWORD_HASH'
+ file_env 'MARIADB_ROOT_PASSWORD_HASH'
# set MARIADB_ from MYSQL_ when it is unset and then make them the same value
: "${MARIADB_ALLOW_EMPTY_ROOT_PASSWORD:=${MYSQL_ALLOW_EMPTY_PASSWORD:-}}"
@@ -278,19 +288,28 @@ docker_setup_db() {
export MARIADB_ROOT_PASSWORD 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
+
+ # Creates root users for non-localhost hosts
local rootCreate=
- local rootPasswordEscaped
- rootPasswordEscaped=$( docker_sql_escape_string_literal "${MARIADB_ROOT_PASSWORD}" )
# default root to listen for connections from anywhere
if [ -n "$MARIADB_ROOT_HOST" ] && [ "$MARIADB_ROOT_HOST" != 'localhost' ]; then
+ if [ -n "$MARIADB_ROOT_PASSWORD" ]; then
+ # Sets root password and creates root users for non-localhost hosts
+ local rootPasswordEscaped
+ rootPasswordEscaped=$( docker_sql_escape_string_literal "${MARIADB_ROOT_PASSWORD}" )
# 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'@'${MARIADB_ROOT_HOST}' IDENTIFIED BY '${rootPasswordEscaped}' ;
GRANT ALL ON *.* TO 'root'@'${MARIADB_ROOT_HOST}' WITH GRANT OPTION ;
EOSQL
+ else
+ read -r -d '' rootCreate <<-EOSQL || true
+ CREATE USER 'root'@'${MARIADB_ROOT_HOST}' IDENTIFIED BY PASSWORD '${MARIADB_ROOT_PASSWORD_HASH}' ;
+ GRANT ALL ON *.* TO 'root'@'${MARIADB_ROOT_HOST}' WITH GRANT OPTION ;
+ EOSQL
+ fi
fi
local mysqlAtLocalhost=
@@ -343,8 +362,9 @@ docker_setup_db() {
docker_process_sql --database=mysql <<<"CREATE DATABASE IF NOT EXISTS \`$MARIADB_DATABASE\` ;"
fi
- if [ -n "$MARIADB_USER" ] && [ -n "$MARIADB_PASSWORD" ]; then
+ if [ -n "$MARIADB_PASSWORD" ] || [ -n "$MARIADB_PASSWORD_HASH" ] && [ -n "$MARIADB_USER" ]; then
mysql_note "Creating user ${MARIADB_USER}"
+ if [ -n "$MARIADB_PASSWORD" ]; then
# SQL escape the user password, \ followed by '
local userPasswordEscaped
userPasswordEscaped=$( docker_sql_escape_string_literal "${MARIADB_PASSWORD}" )
@@ -352,6 +372,12 @@ docker_setup_db() {
SET @@SESSION.SQL_MODE=REPLACE(@@SESSION.SQL_MODE, 'NO_BACKSLASH_ESCAPES', '');
CREATE USER '$MARIADB_USER'@'%' IDENTIFIED BY '$userPasswordEscaped';
EOSQL_USER
+ else
+ 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 PASSWORD '$MARIADB_PASSWORD_HASH';
+ EOSQL_USER
+ fi
if [ -n "$MARIADB_DATABASE" ]; then
mysql_note "Giving user ${MARIADB_USER} access to schema ${MARIADB_DATABASE}"
diff --git a/mariadb_10.6/Dockerfile b/mariadb_10.6/Dockerfile
index 5eb289e..9be3a41 100644
--- a/mariadb_10.6/Dockerfile
+++ b/mariadb_10.6/Dockerfile
@@ -73,13 +73,13 @@ RUN set -ex; \
# bashbrew-architectures: amd64 arm64v8 ppc64le s390x
ARG MARIADB_MAJOR=10.6
ENV MARIADB_MAJOR $MARIADB_MAJOR
-ARG MARIADB_VERSION=1:10.6.9+maria~ubu2004
+ARG MARIADB_VERSION=1:10.6.10+maria~ubu2004
ENV MARIADB_VERSION $MARIADB_VERSION
# release-status:Stable
# (https://downloads.mariadb.org/rest-api/mariadb/)
# Allowing overriding of REPOSITORY, a URL that includes suite and component for testing and Enterprise Versions
-ARG REPOSITORY="http://archive.mariadb.org/mariadb-10.6.9/repo/ubuntu/ focal main"
+ARG REPOSITORY="http://archive.mariadb.org/mariadb-10.6.10/repo/ubuntu/ focal main"
RUN set -e;\
echo "deb ${REPOSITORY}" > /etc/apt/sources.list.d/mariadb.list; \
diff --git a/mariadb_10.6/docker-entrypoint.sh b/mariadb_10.6/docker-entrypoint.sh
index 2f192b8..6f21eac 100755
--- a/mariadb_10.6/docker-entrypoint.sh
+++ b/mariadb_10.6/docker-entrypoint.sh
@@ -154,8 +154,15 @@ docker_temp_server_stop() {
# Verify that the minimally required password settings are set for new databases.
docker_verify_minimum_env() {
- if [ -z "$MARIADB_ROOT_PASSWORD" ] && [ -z "$MARIADB_ALLOW_EMPTY_ROOT_PASSWORD" ] && [ -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'
+ if [ -z "$MARIADB_ROOT_PASSWORD" ] && [ -z "$MARIADB_ROOT_PASSWORD_HASH" ] && [ -z "$MARIADB_ALLOW_EMPTY_ROOT_PASSWORD" ] && [ -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_ROOT_PASSWORD_HASH, MARIADB_ALLOW_EMPTY_ROOT_PASSWORD and MARIADB_RANDOM_ROOT_PASSWORD'
+ fi
+ # More preemptive exclusions of combinations should have been made before *PASSWORD_HASH was added, but for now we don't enforce due to compatibility.
+ if [ -n "$MARIADB_ROOT_PASSWORD" ] || [ -n "$MARIADB_ALLOW_EMPTY_ROOT_PASSWORD" ] || [ -n "$MARIADB_RANDOM_ROOT_PASSWORD" ] && [ -n "$MARIADB_ROOT_PASSWORD_HASH" ]; then
+ mysql_error "Cannot specify MARIADB_ROOT_PASSWORD_HASH and another MARIADB_ROOT_PASSWORD* option."
+ fi
+ if [ -n "$MARIADB_PASSWORD" ] && [ -n "$MARIADB_PASSWORD_HASH" ]; then
+ mysql_error "Cannot specify MARIADB_PASSWORD_HASH and MARIADB_PASSWORD option."
fi
}
@@ -212,6 +219,9 @@ docker_setup_env() {
_mariadb_file_env 'MYSQL_USER'
_mariadb_file_env 'MYSQL_PASSWORD'
_mariadb_file_env 'MYSQL_ROOT_PASSWORD'
+ # No MYSQL_ compatibility needed for new variables
+ file_env 'MARIADB_PASSWORD_HASH'
+ file_env 'MARIADB_ROOT_PASSWORD_HASH'
# set MARIADB_ from MYSQL_ when it is unset and then make them the same value
: "${MARIADB_ALLOW_EMPTY_ROOT_PASSWORD:=${MYSQL_ALLOW_EMPTY_PASSWORD:-}}"
@@ -278,19 +288,28 @@ docker_setup_db() {
export MARIADB_ROOT_PASSWORD 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
+
+ # Creates root users for non-localhost hosts
local rootCreate=
- local rootPasswordEscaped
- rootPasswordEscaped=$( docker_sql_escape_string_literal "${MARIADB_ROOT_PASSWORD}" )
# default root to listen for connections from anywhere
if [ -n "$MARIADB_ROOT_HOST" ] && [ "$MARIADB_ROOT_HOST" != 'localhost' ]; then
+ if [ -n "$MARIADB_ROOT_PASSWORD" ]; then
+ # Sets root password and creates root users for non-localhost hosts
+ local rootPasswordEscaped
+ rootPasswordEscaped=$( docker_sql_escape_string_literal "${MARIADB_ROOT_PASSWORD}" )
# 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'@'${MARIADB_ROOT_HOST}' IDENTIFIED BY '${rootPasswordEscaped}' ;
GRANT ALL ON *.* TO 'root'@'${MARIADB_ROOT_HOST}' WITH GRANT OPTION ;
EOSQL
+ else
+ read -r -d '' rootCreate <<-EOSQL || true
+ CREATE USER 'root'@'${MARIADB_ROOT_HOST}' IDENTIFIED BY PASSWORD '${MARIADB_ROOT_PASSWORD_HASH}' ;
+ GRANT ALL ON *.* TO 'root'@'${MARIADB_ROOT_HOST}' WITH GRANT OPTION ;
+ EOSQL
+ fi
fi
local mysqlAtLocalhost=
@@ -343,8 +362,9 @@ docker_setup_db() {
docker_process_sql --database=mysql <<<"CREATE DATABASE IF NOT EXISTS \`$MARIADB_DATABASE\` ;"
fi
- if [ -n "$MARIADB_USER" ] && [ -n "$MARIADB_PASSWORD" ]; then
+ if [ -n "$MARIADB_PASSWORD" ] || [ -n "$MARIADB_PASSWORD_HASH" ] && [ -n "$MARIADB_USER" ]; then
mysql_note "Creating user ${MARIADB_USER}"
+ if [ -n "$MARIADB_PASSWORD" ]; then
# SQL escape the user password, \ followed by '
local userPasswordEscaped
userPasswordEscaped=$( docker_sql_escape_string_literal "${MARIADB_PASSWORD}" )
@@ -352,6 +372,12 @@ docker_setup_db() {
SET @@SESSION.SQL_MODE=REPLACE(@@SESSION.SQL_MODE, 'NO_BACKSLASH_ESCAPES', '');
CREATE USER '$MARIADB_USER'@'%' IDENTIFIED BY '$userPasswordEscaped';
EOSQL_USER
+ else
+ 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 PASSWORD '$MARIADB_PASSWORD_HASH';
+ EOSQL_USER
+ fi
if [ -n "$MARIADB_DATABASE" ]; then
mysql_note "Giving user ${MARIADB_USER} access to schema ${MARIADB_DATABASE}"
diff --git a/mariadb_10.7/Dockerfile b/mariadb_10.7/Dockerfile
index 2532aad..365b52a 100644
--- a/mariadb_10.7/Dockerfile
+++ b/mariadb_10.7/Dockerfile
@@ -73,13 +73,13 @@ RUN set -ex; \
# bashbrew-architectures: amd64 arm64v8 ppc64le s390x
ARG MARIADB_MAJOR=10.7
ENV MARIADB_MAJOR $MARIADB_MAJOR
-ARG MARIADB_VERSION=1:10.7.5+maria~ubu2004
+ARG MARIADB_VERSION=1:10.7.6+maria~ubu2004
ENV MARIADB_VERSION $MARIADB_VERSION
# release-status:Stable
# (https://downloads.mariadb.org/rest-api/mariadb/)
# Allowing overriding of REPOSITORY, a URL that includes suite and component for testing and Enterprise Versions
-ARG REPOSITORY="http://archive.mariadb.org/mariadb-10.7.5/repo/ubuntu/ focal main"
+ARG REPOSITORY="http://archive.mariadb.org/mariadb-10.7.6/repo/ubuntu/ focal main"
RUN set -e;\
echo "deb ${REPOSITORY}" > /etc/apt/sources.list.d/mariadb.list; \
diff --git a/mariadb_10.7/docker-entrypoint.sh b/mariadb_10.7/docker-entrypoint.sh
index 2f192b8..6f21eac 100755
--- a/mariadb_10.7/docker-entrypoint.sh
+++ b/mariadb_10.7/docker-entrypoint.sh
@@ -154,8 +154,15 @@ docker_temp_server_stop() {
# Verify that the minimally required password settings are set for new databases.
docker_verify_minimum_env() {
- if [ -z "$MARIADB_ROOT_PASSWORD" ] && [ -z "$MARIADB_ALLOW_EMPTY_ROOT_PASSWORD" ] && [ -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'
+ if [ -z "$MARIADB_ROOT_PASSWORD" ] && [ -z "$MARIADB_ROOT_PASSWORD_HASH" ] && [ -z "$MARIADB_ALLOW_EMPTY_ROOT_PASSWORD" ] && [ -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_ROOT_PASSWORD_HASH, MARIADB_ALLOW_EMPTY_ROOT_PASSWORD and MARIADB_RANDOM_ROOT_PASSWORD'
+ fi
+ # More preemptive exclusions of combinations should have been made before *PASSWORD_HASH was added, but for now we don't enforce due to compatibility.
+ if [ -n "$MARIADB_ROOT_PASSWORD" ] || [ -n "$MARIADB_ALLOW_EMPTY_ROOT_PASSWORD" ] || [ -n "$MARIADB_RANDOM_ROOT_PASSWORD" ] && [ -n "$MARIADB_ROOT_PASSWORD_HASH" ]; then
+ mysql_error "Cannot specify MARIADB_ROOT_PASSWORD_HASH and another MARIADB_ROOT_PASSWORD* option."
+ fi
+ if [ -n "$MARIADB_PASSWORD" ] && [ -n "$MARIADB_PASSWORD_HASH" ]; then
+ mysql_error "Cannot specify MARIADB_PASSWORD_HASH and MARIADB_PASSWORD option."
fi
}
@@ -212,6 +219,9 @@ docker_setup_env() {
_mariadb_file_env 'MYSQL_USER'
_mariadb_file_env 'MYSQL_PASSWORD'
_mariadb_file_env 'MYSQL_ROOT_PASSWORD'
+ # No MYSQL_ compatibility needed for new variables
+ file_env 'MARIADB_PASSWORD_HASH'
+ file_env 'MARIADB_ROOT_PASSWORD_HASH'
# set MARIADB_ from MYSQL_ when it is unset and then make them the same value
: "${MARIADB_ALLOW_EMPTY_ROOT_PASSWORD:=${MYSQL_ALLOW_EMPTY_PASSWORD:-}}"
@@ -278,19 +288,28 @@ docker_setup_db() {
export MARIADB_ROOT_PASSWORD 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
+
+ # Creates root users for non-localhost hosts
local rootCreate=
- local rootPasswordEscaped
- rootPasswordEscaped=$( docker_sql_escape_string_literal "${MARIADB_ROOT_PASSWORD}" )
# default root to listen for connections from anywhere
if [ -n "$MARIADB_ROOT_HOST" ] && [ "$MARIADB_ROOT_HOST" != 'localhost' ]; then
+ if [ -n "$MARIADB_ROOT_PASSWORD" ]; then
+ # Sets root password and creates root users for non-localhost hosts
+ local rootPasswordEscaped
+ rootPasswordEscaped=$( docker_sql_escape_string_literal "${MARIADB_ROOT_PASSWORD}" )
# 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'@'${MARIADB_ROOT_HOST}' IDENTIFIED BY '${rootPasswordEscaped}' ;
GRANT ALL ON *.* TO 'root'@'${MARIADB_ROOT_HOST}' WITH GRANT OPTION ;
EOSQL
+ else
+ read -r -d '' rootCreate <<-EOSQL || true
+ CREATE USER 'root'@'${MARIADB_ROOT_HOST}' IDENTIFIED BY PASSWORD '${MARIADB_ROOT_PASSWORD_HASH}' ;
+ GRANT ALL ON *.* TO 'root'@'${MARIADB_ROOT_HOST}' WITH GRANT OPTION ;
+ EOSQL
+ fi
fi
local mysqlAtLocalhost=
@@ -343,8 +362,9 @@ docker_setup_db() {
docker_process_sql --database=mysql <<<"CREATE DATABASE IF NOT EXISTS \`$MARIADB_DATABASE\` ;"
fi
- if [ -n "$MARIADB_USER" ] && [ -n "$MARIADB_PASSWORD" ]; then
+ if [ -n "$MARIADB_PASSWORD" ] || [ -n "$MARIADB_PASSWORD_HASH" ] && [ -n "$MARIADB_USER" ]; then
mysql_note "Creating user ${MARIADB_USER}"
+ if [ -n "$MARIADB_PASSWORD" ]; then
# SQL escape the user password, \ followed by '
local userPasswordEscaped
userPasswordEscaped=$( docker_sql_escape_string_literal "${MARIADB_PASSWORD}" )
@@ -352,6 +372,12 @@ docker_setup_db() {
SET @@SESSION.SQL_MODE=REPLACE(@@SESSION.SQL_MODE, 'NO_BACKSLASH_ESCAPES', '');
CREATE USER '$MARIADB_USER'@'%' IDENTIFIED BY '$userPasswordEscaped';
EOSQL_USER
+ else
+ 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 PASSWORD '$MARIADB_PASSWORD_HASH';
+ EOSQL_USER
+ fi
if [ -n "$MARIADB_DATABASE" ]; then
mysql_note "Giving user ${MARIADB_USER} access to schema ${MARIADB_DATABASE}"
diff --git a/mariadb_10.8/Dockerfile b/mariadb_10.8/Dockerfile
index f712b91..e8e1cef 100644
--- a/mariadb_10.8/Dockerfile
+++ b/mariadb_10.8/Dockerfile
@@ -73,13 +73,13 @@ RUN set -ex; \
# bashbrew-architectures: amd64 arm64v8 ppc64le s390x
ARG MARIADB_MAJOR=10.8
ENV MARIADB_MAJOR $MARIADB_MAJOR
-ARG MARIADB_VERSION=1:10.8.4+maria~ubu2204
+ARG MARIADB_VERSION=1:10.8.5+maria~ubu2204
ENV MARIADB_VERSION $MARIADB_VERSION
# release-status:Stable
# (https://downloads.mariadb.org/rest-api/mariadb/)
# Allowing overriding of REPOSITORY, a URL that includes suite and component for testing and Enterprise Versions
-ARG REPOSITORY="http://archive.mariadb.org/mariadb-10.8.4/repo/ubuntu/ jammy main"
+ARG REPOSITORY="http://archive.mariadb.org/mariadb-10.8.5/repo/ubuntu/ jammy main"
RUN set -e;\
echo "deb ${REPOSITORY}" > /etc/apt/sources.list.d/mariadb.list; \
diff --git a/mariadb_10.8/docker-entrypoint.sh b/mariadb_10.8/docker-entrypoint.sh
index 2f192b8..6f21eac 100755
--- a/mariadb_10.8/docker-entrypoint.sh
+++ b/mariadb_10.8/docker-entrypoint.sh
@@ -154,8 +154,15 @@ docker_temp_server_stop() {
# Verify that the minimally required password settings are set for new databases.
docker_verify_minimum_env() {
- if [ -z "$MARIADB_ROOT_PASSWORD" ] && [ -z "$MARIADB_ALLOW_EMPTY_ROOT_PASSWORD" ] && [ -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'
+ if [ -z "$MARIADB_ROOT_PASSWORD" ] && [ -z "$MARIADB_ROOT_PASSWORD_HASH" ] && [ -z "$MARIADB_ALLOW_EMPTY_ROOT_PASSWORD" ] && [ -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_ROOT_PASSWORD_HASH, MARIADB_ALLOW_EMPTY_ROOT_PASSWORD and MARIADB_RANDOM_ROOT_PASSWORD'
+ fi
+ # More preemptive exclusions of combinations should have been made before *PASSWORD_HASH was added, but for now we don't enforce due to compatibility.
+ if [ -n "$MARIADB_ROOT_PASSWORD" ] || [ -n "$MARIADB_ALLOW_EMPTY_ROOT_PASSWORD" ] || [ -n "$MARIADB_RANDOM_ROOT_PASSWORD" ] && [ -n "$MARIADB_ROOT_PASSWORD_HASH" ]; then
+ mysql_error "Cannot specify MARIADB_ROOT_PASSWORD_HASH and another MARIADB_ROOT_PASSWORD* option."
+ fi
+ if [ -n "$MARIADB_PASSWORD" ] && [ -n "$MARIADB_PASSWORD_HASH" ]; then
+ mysql_error "Cannot specify MARIADB_PASSWORD_HASH and MARIADB_PASSWORD option."
fi
}
@@ -212,6 +219,9 @@ docker_setup_env() {
_mariadb_file_env 'MYSQL_USER'
_mariadb_file_env 'MYSQL_PASSWORD'
_mariadb_file_env 'MYSQL_ROOT_PASSWORD'
+ # No MYSQL_ compatibility needed for new variables
+ file_env 'MARIADB_PASSWORD_HASH'
+ file_env 'MARIADB_ROOT_PASSWORD_HASH'
# set MARIADB_ from MYSQL_ when it is unset and then make them the same value
: "${MARIADB_ALLOW_EMPTY_ROOT_PASSWORD:=${MYSQL_ALLOW_EMPTY_PASSWORD:-}}"
@@ -278,19 +288,28 @@ docker_setup_db() {
export MARIADB_ROOT_PASSWORD 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
+
+ # Creates root users for non-localhost hosts
local rootCreate=
- local rootPasswordEscaped
- rootPasswordEscaped=$( docker_sql_escape_string_literal "${MARIADB_ROOT_PASSWORD}" )
# default root to listen for connections from anywhere
if [ -n "$MARIADB_ROOT_HOST" ] && [ "$MARIADB_ROOT_HOST" != 'localhost' ]; then
+ if [ -n "$MARIADB_ROOT_PASSWORD" ]; then
+ # Sets root password and creates root users for non-localhost hosts
+ local rootPasswordEscaped
+ rootPasswordEscaped=$( docker_sql_escape_string_literal "${MARIADB_ROOT_PASSWORD}" )
# 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'@'${MARIADB_ROOT_HOST}' IDENTIFIED BY '${rootPasswordEscaped}' ;
GRANT ALL ON *.* TO 'root'@'${MARIADB_ROOT_HOST}' WITH GRANT OPTION ;
EOSQL
+ else
+ read -r -d '' rootCreate <<-EOSQL || true
+ CREATE USER 'root'@'${MARIADB_ROOT_HOST}' IDENTIFIED BY PASSWORD '${MARIADB_ROOT_PASSWORD_HASH}' ;
+ GRANT ALL ON *.* TO 'root'@'${MARIADB_ROOT_HOST}' WITH GRANT OPTION ;
+ EOSQL
+ fi
fi
local mysqlAtLocalhost=
@@ -343,8 +362,9 @@ docker_setup_db() {
docker_process_sql --database=mysql <<<"CREATE DATABASE IF NOT EXISTS \`$MARIADB_DATABASE\` ;"
fi
- if [ -n "$MARIADB_USER" ] && [ -n "$MARIADB_PASSWORD" ]; then
+ if [ -n "$MARIADB_PASSWORD" ] || [ -n "$MARIADB_PASSWORD_HASH" ] && [ -n "$MARIADB_USER" ]; then
mysql_note "Creating user ${MARIADB_USER}"
+ if [ -n "$MARIADB_PASSWORD" ]; then
# SQL escape the user password, \ followed by '
local userPasswordEscaped
userPasswordEscaped=$( docker_sql_escape_string_literal "${MARIADB_PASSWORD}" )
@@ -352,6 +372,12 @@ docker_setup_db() {
SET @@SESSION.SQL_MODE=REPLACE(@@SESSION.SQL_MODE, 'NO_BACKSLASH_ESCAPES', '');
CREATE USER '$MARIADB_USER'@'%' IDENTIFIED BY '$userPasswordEscaped';
EOSQL_USER
+ else
+ 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 PASSWORD '$MARIADB_PASSWORD_HASH';
+ EOSQL_USER
+ fi
if [ -n "$MARIADB_DATABASE" ]; then
mysql_note "Giving user ${MARIADB_USER} access to schema ${MARIADB_DATABASE}"
diff --git a/mariadb_latest/Dockerfile b/mariadb_latest/Dockerfile
index 2271329..579cce0 100644
--- a/mariadb_latest/Dockerfile
+++ b/mariadb_latest/Dockerfile
@@ -71,13 +71,13 @@ RUN set -ex; \
apt-key list
# bashbrew-architectures: amd64 arm64v8 ppc64le s390x
-ARG MARIADB_VERSION=1:10.9.2+maria~ubu2204
+ARG MARIADB_VERSION=1:10.9.3+maria~ubu2204
ENV MARIADB_VERSION $MARIADB_VERSION
# release-status:Stable
# (https://downloads.mariadb.org/rest-api/mariadb/)
# Allowing overriding of REPOSITORY, a URL that includes suite and component for testing and Enterprise Versions
-ARG REPOSITORY="http://archive.mariadb.org/mariadb-10.9.2/repo/ubuntu/ jammy main"
+ARG REPOSITORY="http://archive.mariadb.org/mariadb-10.9.3/repo/ubuntu/ jammy main"
RUN set -e;\
echo "deb ${REPOSITORY}" > /etc/apt/sources.list.d/mariadb.list; \
diff --git a/mariadb_latest/docker-entrypoint.sh b/mariadb_latest/docker-entrypoint.sh
index 2f192b8..6f21eac 100755
--- a/mariadb_latest/docker-entrypoint.sh
+++ b/mariadb_latest/docker-entrypoint.sh
@@ -154,8 +154,15 @@ docker_temp_server_stop() {
# Verify that the minimally required password settings are set for new databases.
docker_verify_minimum_env() {
- if [ -z "$MARIADB_ROOT_PASSWORD" ] && [ -z "$MARIADB_ALLOW_EMPTY_ROOT_PASSWORD" ] && [ -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'
+ if [ -z "$MARIADB_ROOT_PASSWORD" ] && [ -z "$MARIADB_ROOT_PASSWORD_HASH" ] && [ -z "$MARIADB_ALLOW_EMPTY_ROOT_PASSWORD" ] && [ -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_ROOT_PASSWORD_HASH, MARIADB_ALLOW_EMPTY_ROOT_PASSWORD and MARIADB_RANDOM_ROOT_PASSWORD'
+ fi
+ # More preemptive exclusions of combinations should have been made before *PASSWORD_HASH was added, but for now we don't enforce due to compatibility.
+ if [ -n "$MARIADB_ROOT_PASSWORD" ] || [ -n "$MARIADB_ALLOW_EMPTY_ROOT_PASSWORD" ] || [ -n "$MARIADB_RANDOM_ROOT_PASSWORD" ] && [ -n "$MARIADB_ROOT_PASSWORD_HASH" ]; then
+ mysql_error "Cannot specify MARIADB_ROOT_PASSWORD_HASH and another MARIADB_ROOT_PASSWORD* option."
+ fi
+ if [ -n "$MARIADB_PASSWORD" ] && [ -n "$MARIADB_PASSWORD_HASH" ]; then
+ mysql_error "Cannot specify MARIADB_PASSWORD_HASH and MARIADB_PASSWORD option."
fi
}
@@ -212,6 +219,9 @@ docker_setup_env() {
_mariadb_file_env 'MYSQL_USER'
_mariadb_file_env 'MYSQL_PASSWORD'
_mariadb_file_env 'MYSQL_ROOT_PASSWORD'
+ # No MYSQL_ compatibility needed for new variables
+ file_env 'MARIADB_PASSWORD_HASH'
+ file_env 'MARIADB_ROOT_PASSWORD_HASH'
# set MARIADB_ from MYSQL_ when it is unset and then make them the same value
: "${MARIADB_ALLOW_EMPTY_ROOT_PASSWORD:=${MYSQL_ALLOW_EMPTY_PASSWORD:-}}"
@@ -278,19 +288,28 @@ docker_setup_db() {
export MARIADB_ROOT_PASSWORD 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
+
+ # Creates root users for non-localhost hosts
local rootCreate=
- local rootPasswordEscaped
- rootPasswordEscaped=$( docker_sql_escape_string_literal "${MARIADB_ROOT_PASSWORD}" )
# default root to listen for connections from anywhere
if [ -n "$MARIADB_ROOT_HOST" ] && [ "$MARIADB_ROOT_HOST" != 'localhost' ]; then
+ if [ -n "$MARIADB_ROOT_PASSWORD" ]; then
+ # Sets root password and creates root users for non-localhost hosts
+ local rootPasswordEscaped
+ rootPasswordEscaped=$( docker_sql_escape_string_literal "${MARIADB_ROOT_PASSWORD}" )
# 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'@'${MARIADB_ROOT_HOST}' IDENTIFIED BY '${rootPasswordEscaped}' ;
GRANT ALL ON *.* TO 'root'@'${MARIADB_ROOT_HOST}' WITH GRANT OPTION ;
EOSQL
+ else
+ read -r -d '' rootCreate <<-EOSQL || true
+ CREATE USER 'root'@'${MARIADB_ROOT_HOST}' IDENTIFIED BY PASSWORD '${MARIADB_ROOT_PASSWORD_HASH}' ;
+ GRANT ALL ON *.* TO 'root'@'${MARIADB_ROOT_HOST}' WITH GRANT OPTION ;
+ EOSQL
+ fi
fi
local mysqlAtLocalhost=
@@ -343,8 +362,9 @@ docker_setup_db() {
docker_process_sql --database=mysql <<<"CREATE DATABASE IF NOT EXISTS \`$MARIADB_DATABASE\` ;"
fi
- if [ -n "$MARIADB_USER" ] && [ -n "$MARIADB_PASSWORD" ]; then
+ if [ -n "$MARIADB_PASSWORD" ] || [ -n "$MARIADB_PASSWORD_HASH" ] && [ -n "$MARIADB_USER" ]; then
mysql_note "Creating user ${MARIADB_USER}"
+ if [ -n "$MARIADB_PASSWORD" ]; then
# SQL escape the user password, \ followed by '
local userPasswordEscaped
userPasswordEscaped=$( docker_sql_escape_string_literal "${MARIADB_PASSWORD}" )
@@ -352,6 +372,12 @@ docker_setup_db() {
SET @@SESSION.SQL_MODE=REPLACE(@@SESSION.SQL_MODE, 'NO_BACKSLASH_ESCAPES', '');
CREATE USER '$MARIADB_USER'@'%' IDENTIFIED BY '$userPasswordEscaped';
EOSQL_USER
+ else
+ 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 PASSWORD '$MARIADB_PASSWORD_HASH';
+ EOSQL_USER
+ fi
if [ -n "$MARIADB_DATABASE" ]; then
mysql_note "Giving user ${MARIADB_USER} access to schema ${MARIADB_DATABASE}" Relevant Maintainers:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes a few significant MDEVs on 10.6+ per
https://mariadb.com/kb/en/mariadb-10610-release-notes/.
Also adds the MARIADB_{ROOT_,}PASSWORD_HASH option thanks to @TheAlgorythm.