From 64ce777c4a43c20edd1a1de6d9b7c65fb97eeee9 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 +++--- ReleaseNotes.txt | 10 ++++++++++ compose.yaml | 6 +++--- .env => env | 10 ++++++++-- var/lib/.gitignore | 4 ++++ 5 files changed, 28 insertions(+), 8 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/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