Switch to be independent of parent MariaDB instance.

This commit is contained in:
Buster "Silver Eagle" Neece 2022-05-08 15:42:49 -05:00
parent c113a7fe1b
commit a2c9f4d026
No known key found for this signature in database
GPG Key ID: 9FC8B9E008872109
3 changed files with 55 additions and 6 deletions

View File

@ -3,6 +3,11 @@
#
FROM ghcr.io/azuracast/icecast-kh-ac:2.4.0-kh15-ac2 AS icecast
#
# MariaDB stage (for later copy)
#
FROM mariadb:10.7-focal AS mariadb
#
# Golang dependencies build step
#
@ -16,7 +21,7 @@ RUN go install github.com/jwilder/dockerize@latest
#
# Final build image
#
FROM mariadb:10.7-focal
FROM ubuntu:focal
ENV TZ="UTC"
@ -27,6 +32,10 @@ COPY --from=dockerize /go/bin/dockerize /usr/local/bin
COPY --from=icecast /usr/local/bin/icecast /usr/local/bin/icecast
COPY --from=icecast /usr/local/share/icecast /usr/local/share/icecast
# Import MariaDB scripts.
COPY --from=mariadb /usr/local/bin/healthcheck.sh /usr/local/bin/db_healthcheck.sh
COPY --from=mariadb /usr/local/bin/docker-entrypoint.sh /usr/local/bin/db_entrypoint.sh
# Run base build process
COPY ./util/docker/common /bd_build/
RUN chmod a+x /bd_build/*.sh \

View File

@ -3,12 +3,51 @@ set -e
source /bd_build/buildconfig
set -x
$minimal_apt_get_install tzdata
$minimal_apt_get_install tzdata libjemalloc2 pwgen xz-utils zstd dirmngr apt-transport-https
sudo apt-get install software-properties-common
sudo apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc'
sudo add-apt-repository 'deb [arch=amd64,arm64,ppc64el,s390x] https://mirrors.gigenet.com/mariadb/repo/10.7/ubuntu focal main'
# Pulled from MariaDB Docker container
export MARIADB_MAJOR=10.7
{
echo "mariadb-server-$MARIADB_MAJOR" mysql-server/root_password password 'unused';
echo "mariadb-server-$MARIADB_MAJOR" mysql-server/root_password_again password 'unused';
} | debconf-set-selections;
apt update
$minimal_apt_get_install mariadb-server mariadb-backup socat
# Temporary work around for MDEV-27980, closes #417
sed --follow-symlinks -i -e 's/--loose-disable-plugin-file-key-management//' /usr/bin/mysql_install_db
# Purge and re-create /var/lib/mysql with appropriate ownership
rm -rf /var/lib/mysql;
mkdir -p /var/lib/mysql /var/run/mysqld;
chown -R mysql:mysql /var/lib/mysql /var/run/mysqld;
# ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime
chmod 777 /var/run/mysqld;
# comment out a few problematic configuration values
find /etc/mysql/ -name '*.cnf' -print0 \
| xargs -0 grep -lZE '^(bind-address|log|user\s)' \
| xargs -rt -0 sed -Ei 's/^(bind-address|log|user\s)/#&/';
# don't reverse lookup hostnames, they are usually another container
# Issue #327 Correct order of reading directories /etc/mysql/mariadb.conf.d before /etc/mysql/conf.d (mount-point per documentation)
if [ ! -L /etc/mysql/my.cnf ]; then
sed -i -e '/includedir/i[mariadb]\nskip-host-cache\nskip-name-resolve\n' /etc/mysql/my.cnf;
else
sed -i -e '/includedir/ {N;s/\(.*\)\n\(.*\)/[mariadbd]\nskip-host-cache\nskip-name-resolve\n\n\2\n\1/}' /etc/mysql/mariadb.cnf;
fi
# Customizations to MariaDB
echo "1" >> /etc/container_environment/MARIADB_AUTO_UPGRADE
mkdir /docker-entrypoint-initdb.d
cp /bd_build/mariadb/mariadb/db.sql /docker-entrypoint-initdb.d/00-azuracast.sql
cp /bd_build/mariadb/mariadb/db.cnf.tmpl /etc/mysql/db.cnf.tmpl
mv /usr/local/bin/healthcheck.sh /usr/local/bin/db_healthcheck.sh
mv /usr/local/bin/docker-entrypoint.sh /usr/local/bin/db_entrypoint.sh

View File

@ -8,7 +8,8 @@ $minimal_apt_get_install libao-dev libasound2-dev libavcodec-dev libavdevice-dev
libavutil-dev libfaad-dev libfdk-aac-dev libflac-dev libfreetype-dev libgd-dev libjack-dev \
libjpeg-dev liblo-dev libmad0-dev libmagic-dev libmp3lame-dev libopus-dev libpng-dev libportaudio2 \
libpulse-dev libsamplerate0-dev libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libshine-dev libsoundtouch-dev libspeex-dev \
libsrt-dev libswresample-dev libswscale-dev libtag1-dev libtheora-dev libtiff-dev libx11-dev libxpm-dev bubblewrap ffmpeg
libsrt-dev libswresample-dev libswscale-dev libtag1-dev libtheora-dev libtiff-dev libx11-dev libxpm-dev \
bubblewrap ffmpeg
# Optional audio plugins
$minimal_apt_get_install frei0r-plugins-dev ladspa-sdk multimedia-audio-plugins swh-plugins tap-plugins lsp-plugins-ladspa