Skip to content

Commit

Permalink
Merge pull request #76 from stolp/KD-48
Browse files Browse the repository at this point in the history
MariaDB: Update to version 10.11. Fixes #48.
  • Loading branch information
stolp authored Sep 2, 2023
2 parents 68f36bd + 0ef7cbd commit b6b9f7a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
12 changes: 7 additions & 5 deletions MariaDB/db/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# vim:set ft=dockerfile:
FROM ubuntu:bionic
FROM ubuntu:jammy
LABEL maintainer "BreadSpoon <[email protected]>"

# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
Expand Down Expand Up @@ -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; \
Expand Down Expand Up @@ -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'; \
Expand All @@ -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; \
Expand All @@ -133,4 +135,4 @@ RUN ln -s usr/local/bin/docker-entrypoint.sh / # backwards compat
ENTRYPOINT ["docker-entrypoint.sh"]

EXPOSE 3306
CMD ["mysqld"]
CMD ["mariadbd"]
20 changes: 10 additions & 10 deletions MariaDB/db/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
}
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion MariaDB/db/mysqld.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b6b9f7a

Please sign in to comment.