From 17ddc89aa4eba37ce1195e850a278390b8e748a3 Mon Sep 17 00:00:00 2001 From: "Arnaud G. GIBERT" Date: Sat, 5 Oct 2024 18:04:31 +0200 Subject: [PATCH] - Now use server-mga9:1.1.3 image, - Variabilization of external server ports in env & compose file, - Now use docker_tools for .env building. --- Dockerfile | 6 +++--- ReadMe.txt | 2 +- ReleaseNotes.txt | 10 ++++++++++ compose.yaml | 6 +++--- .env => env | 10 ++++++++-- var/lib/.gitignore | 4 ++++ 6 files changed, 29 insertions(+), 9 deletions(-) rename .env => env (82%) create mode 100644 var/lib/.gitignore diff --git a/Dockerfile b/Dockerfile index cd0fb87..223c58a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ ARG IMG_URL_PREFIX="rx3" -FROM ${IMG_URL_PREFIX}/server-mga9:1.1.2 +FROM ${IMG_URL_PREFIX}/server-mga9:1.1.3 ARG IMG_NAME ARG IMG_FULL_NAME @@ -23,7 +23,7 @@ ARG MYSQLD='#!/bin/bash usermod -u ${MARIADB_UID} mysql \n\ groupmod -g ${MARIADB_GID} mysql \n\ \n\ -chown -R mysql:mysql /var/log/mysqld /var/run/mysqld \n\ +chown -R mysql:mysql /var/lib/mysql /var/log/mysqld /var/run/mysqld \n\ \n\ sed -i -e "s/^skip-networking/#skip-networking/" /etc/my.cnf.d/server.cnf \n\ sed -i -e "s/^plugin-load-add=/#plugin-load-add=/" /etc/my.cnf.d/cracklib_password_check.cnf \n\ @@ -34,7 +34,7 @@ echo "CREATE USER `root`@`${MARIADB_ROOT_HOST}` IDENTIFIED BY `${MARIADB_ROOT_PA \n\ if [[ -n "${MARIADB_DATABASE}" ]] \n\ then \n\ - echo "CREATE DATABASE IF NOT EXISTS $MARIADB_DATABASE;" >>/tmp/post.sql \n\ + echo "CREATE DATABASE IF NOT EXISTS ${MARIADB_DATABASE};" >>/tmp/post.sql \n\ fi \n\ \n\ if [[ -n "${MARIADB_USER}" ]] && [[ -n "${MARIADB_PASSWORD}" ]] \n\ diff --git a/ReadMe.txt b/ReadMe.txt index 924949b..5e9c82c 100644 --- a/ReadMe.txt +++ b/ReadMe.txt @@ -5,7 +5,7 @@ Welcome to Rx3/MariaDB-Mga9 docker image! This is project aims to build a MariaDB + Mageia 9 docker image used by others Rx3 packaging projects. Features: - - Curtently based on rx3/server-mga9:1.1.2 image, + - Curtently based on rx3/server-mga9:1.1.3 image, - Following env vars supported: - MARIADB_UID & MARIADB_GID, - MARIADB_ROOT_HOST & MARIADB_ROOT_PASSWORD, diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 6c13afb..a0d90a3 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -1,3 +1,13 @@ +------------------------------------------------------------------------------------------------------------------------------------ +Rx3/MariaDB-Mga9 V 1.0.1 - A. GIBERT - 2024/10/05 +------------------------------------------------------------------------------------------------------------------------------------ + +- Now use server-mga9:1.1.3 image, +- Variabilization of external server ports in env & compose file, +- Now use docker_tools for .env building. + + + ------------------------------------------------------------------------------------------------------------------------------------ Rx3/MariaDB-Mga9 V 1.0.1 - A. GIBERT - 2024/08/28 ------------------------------------------------------------------------------------------------------------------------------------ diff --git a/compose.yaml b/compose.yaml index 5fa3f18..0e565ae 100644 --- a/compose.yaml +++ b/compose.yaml @@ -31,10 +31,10 @@ services: MARIADB_PASSWORD: ${MARIADB_PASSWORD} volumes: - - ./mysql:/var/lib/mysql + - ./var/lib/mysql:/var/lib/mysql network_mode: bridge ports: - - "127.0.0.1:9012:9001" - - "127.0.0.1:8006:3306" + - "127.0.0.1:${DATABASE_SV_PORT}:9001" + - "127.0.0.1:${DATABASE_PORT}:3306" diff --git a/.env b/env similarity index 82% rename from .env rename to env index 8099725..904af1f 100644 --- a/.env +++ b/env @@ -17,7 +17,7 @@ IMG_URL_PREFIX="${IMG_REGISTRY}/${IMG_ORG}" IMG_NAME="mariadb-mga9" IMG_FULL_NAME="Rx3 MariaDB Mageia-9 Docker Image" -IMG_VERSION="1.0.1" +IMG_VERSION="1.0.2" IMG_URL="${IMG_URL_PREFIX}/${IMG_NAME}:${IMG_VERSION}" IMG_MAINTAINER='"Arnaud G. GIBERT" ' @@ -27,9 +27,15 @@ IMG_MAINTAINER='"Arnaud G. GIBERT" ' # User Settings #------------------------------------------------------------------------------- +ENV_PORT_OFFSET=0 +SV_PORT_OFFSET=1000 + +DATABASE_PORT=$(( 8006 + ${ENV_PORT_OFFSET})) +DATABASE_SV_PORT=$(( ${DATABASE_PORT} + ${SV_PORT_OFFSET})) + MARIADB_UID=983 MARIADB_GID=981 -MARIADB_ROOT_HOST= '%' # needs to be enclosed with quotes +MARIADB_ROOT_HOST='%' # needs to be enclosed with quotes MARIADB_ROOT_PASSWORD="mysqladmin" MARIADB_DATABASE="test" MARIADB_USER="test" diff --git a/var/lib/.gitignore b/var/lib/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/var/lib/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore