From 0ef7cbd10ae91f0b73c1bc8a7e49278134cee248 Mon Sep 17 00:00:00 2001 From: Torsten Stolpmann Date: Fri, 1 Sep 2023 17:18:59 +0200 Subject: [PATCH] MariaDB: Update to version 10.11. Fixes #48. --- MariaDB/db/Dockerfile | 12 +++++++----- MariaDB/db/docker-entrypoint.sh | 20 ++++++++++---------- MariaDB/db/mysqld.cnf | 3 ++- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/MariaDB/db/Dockerfile b/MariaDB/db/Dockerfile index 4f72985..0b95723 100644 --- a/MariaDB/db/Dockerfile +++ b/MariaDB/db/Dockerfile @@ -1,5 +1,5 @@ # vim:set ft=dockerfile: -FROM ubuntu:bionic +FROM ubuntu:jammy LABEL maintainer "BreadSpoon " # add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added @@ -35,6 +35,8 @@ RUN set -ex; \ wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \ \ # verify the signature + mkdir ~/.gnupg; \ + echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf; \ export GNUPGHOME="$(mktemp -d)"; \ gpg --batch --keyserver hkp://keyserver.ubuntu.com --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \ gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \ @@ -78,12 +80,12 @@ RUN set -ex; \ apt-key list # bashbrew-architectures: amd64 arm64v8 ppc64le -ENV MARIADB_MAJOR 10.4 +ENV MARIADB_MAJOR 10.11 # release-status:Stable # (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 http://ftp.osuosl.org/pub/mariadb/repo/$MARIADB_MAJOR/ubuntu jammy main" > /etc/apt/sources.list.d/mariadb.list; \ { \ echo 'Package: *'; \ echo 'Pin: release o=MariaDB'; \ @@ -108,7 +110,7 @@ RUN set -ex; \ ; \ rm -rf /var/lib/apt/lists/*; \ # comment out any "user" entires in the MySQL config ("docker-entrypoint.sh" or "--user" will handle user switching) - sed -ri 's/^user\s/#&/' /etc/mysql/my.cnf /etc/mysql/conf.d/*; \ + sed -ri 's/^user\s/#&/' /etc/mysql/my.cnf /etc/mysql/mariadb.conf.d/*.cnf; \ # purge and re-create /var/lib/mysql with appropriate ownership rm -rf /var/lib/mysql; \ mkdir -p /var/lib/mysql /var/run/mysqld; \ @@ -133,4 +135,4 @@ RUN ln -s usr/local/bin/docker-entrypoint.sh / # backwards compat ENTRYPOINT ["docker-entrypoint.sh"] EXPOSE 3306 -CMD ["mysqld"] \ No newline at end of file +CMD ["mariadbd"] \ No newline at end of file diff --git a/MariaDB/db/docker-entrypoint.sh b/MariaDB/db/docker-entrypoint.sh index d633226..0dc6ea5 100644 --- a/MariaDB/db/docker-entrypoint.sh +++ b/MariaDB/db/docker-entrypoint.sh @@ -71,12 +71,12 @@ docker_process_init_files() { mysql_check_config() { local toRun=( "$@" --verbose --help --log-bin-index="$(mktemp -u)" ) errors if ! errors="$("${toRun[@]}" 2>&1 >/dev/null)"; then - mysql_error $'mysqld failed while attempting to check config\n\tcommand was: '"${toRun[*]}"$'\n\t'"$errors" + mysql_error $'mariadbd failed while attempting to check config\n\tcommand was: '"${toRun[*]}"$'\n\t'"$errors" fi } # Fetch value from server config -# We use mysqld --verbose --help instead of my_print_defaults because the +# We use mariadbd --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults mysql_get_config() { local conf="$1"; shift @@ -147,7 +147,7 @@ docker_init_database_dir() { # (this flag doesn't exist in 10.0 and below) installArgs+=( --auth-root-authentication-method=normal ) fi - # "Other options are passed to mysqld." (so we pass all "mysqld" arguments directly here) + # "Other options are passed to mariadbd." (so we pass all "mariadbd" arguments directly here) mysql_install_db "${installArgs[@]}" "${@:2}" mysql_note "Database files initialized" } @@ -267,7 +267,7 @@ _mysql_passfile() { fi } -# check arguments for an option that would cause mysqld to stop +# check arguments for an option that would cause mariadbd to stop # return true if there is one _mysql_want_help() { local arg @@ -282,14 +282,14 @@ _mysql_want_help() { } _main() { - # if command starts with an option, prepend mysqld + # if command starts with an option, prepend mariadbd if [ "${1:0:1}" = '-' ]; then - set -- mysqld "$@" + set -- mariadbd "$@" fi - # 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." + # skip setup if they aren't running mariadbd or want an option that stops mariadbd + if [ "$1" = 'mariadbd' ] && ! _mysql_want_help "$@"; then + mysql_note "Entrypoint script for MariaDB Server ${MARIADB_VERSION} started." mysql_check_config "$@" # Load various environment variables @@ -323,7 +323,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 diff --git a/MariaDB/db/mysqld.cnf b/MariaDB/db/mysqld.cnf index 9081684..cdab7e2 100644 --- a/MariaDB/db/mysqld.cnf +++ b/MariaDB/db/mysqld.cnf @@ -31,6 +31,7 @@ wait_timeout=604800 # End of adjustment # Issue #51 -character-set-server=utf8 +character-set-server=utf8mb4 +collation_server=utf8mb4_general_ci # End