Compare commits

..

No commits in common. "master" and "mariadb-mga9-1.0.0" have entirely different histories.

10 changed files with 73 additions and 158 deletions

36
.env Normal file
View File

@ -0,0 +1,36 @@
# Rx3 MariaDB Mageia-9 Docker Image
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# Global Settings
#-------------------------------------------------------------------------------
IMG_ORG="rx3"
IMG_REGISTRY="docker.xor.rx3:5000"
IMG_URL_PREFIX="${IMG_REGISTRY}/${IMG_ORG}"
#-------------------------------------------------------------------------------
# Image Settings
#-------------------------------------------------------------------------------
IMG_NAME="mariadb-mga9"
IMG_FULL_NAME="Rx3 MariaDB Mageia-9 Docker Image"
IMG_VERSION="1.0.0"
IMG_URL="${IMG_URL_PREFIX}/${IMG_NAME}:${IMG_VERSION}"
IMG_MAINTAINER='"Arnaud G. GIBERT" <arnaud@rx3.net>'
#-------------------------------------------------------------------------------
# User Settings
#-------------------------------------------------------------------------------
MARIADB_UID=983
MARIADB_GID=981
MARIADB_ROOT_HOST= '%' # needs to be enclosed with quotes
MARIADB_ROOT_PASSWORD="mysqladmin"
MARIADB_DATABASE="test"
MARIADB_USER="test"
MARIADB_PASSWORD="testadmin"

View File

@ -1,28 +1,20 @@
# Rx3-Docker/MariaDB Docker Image
# Rx3 MariaDB Mageia-9 Docker Image
#-------------------------------------------------------------------------------
ARG IMG_FROM_URL="rx3-docker/server:latest"
ARG IMG_URL_PREFIX="rx3"
FROM ${IMG_FROM_URL}
FROM ${IMG_URL_PREFIX}/server-mga9:1.1.1
ARG IMG_NAME
ARG IMG_NAME_FULL
ARG IMG_FULL_NAME
ARG IMG_VERSION
ARG IMG_MAINTAINER
LABEL org.rx3.${IMG_NAME}.name=${IMG_NAME_FULL}
LABEL org.rx3.${IMG_NAME}.name=${IMG_FULL_NAME}
LABEL org.rx3.${IMG_NAME}.version=${IMG_VERSION}
LABEL org.rx3.${IMG_NAME}.maintainer=${IMG_MAINTAINER}
LABEL maintainer=${IMG_MAINTAINER}
ARG MARIADDB_LIB
ARG MARIADDB_LOG
ARG MARIADDB_PORT
ARG POSTSQL_LOG
ARG MARIADB_LOG_FILE="${MARIADDB_LOG}/mariadb.err"
ARG POSTSQL_LOG_FILE="${POSTSQL_LOG}/postsql.log"
#---------------------------------------------------------------------------------------------------
@ -31,21 +23,18 @@ ARG MYSQLD='#!/bin/bash
usermod -u ${MARIADB_UID} mysql \n\
groupmod -g ${MARIADB_GID} mysql \n\
\n\
chown -R mysql:mysql '${MARIADDB_LIB}' '${MARIADDB_LOG}' /var/run/mysqld \n\
chown -R mysql: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%hostname$%hostname\\n\\nlog_error='${MARIADB_LOG_FILE}'%" /etc/my.cnf.d/server.cnf \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\
\n\
rm -Rf /var/log/mysqld* \n\
\n\
echo "CREATE USER `root`@`${MARIADB_ROOT_HOST}` IDENTIFIED BY `${MARIADB_ROOT_PASSWORD}`; \n\
GRANT ALL ON *.* TO `root`@`${MARIADB_ROOT_HOST}` WITH GRANT OPTION; \n\
GRANT PROXY ON ``@`%` TO `root`@`${MARIADB_ROOT_HOST}` WITH GRANT OPTION;" >>/tmp/post.sql \n\
\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\
@ -70,7 +59,7 @@ command=/usr/sbin/mysqld'
#---------------------------------------------------------------------------------------------------
ARG POSTSQL='#!/bin/bash \n\
\n\
function log() { echo "$(date --rfc-3339=ns) PostSQL: $*" | tee -a '${POSTSQL_LOG_FILE}'; } \n\
function log() { echo "$(date --rfc-3339=ns) PostSQL: $*" | tee -a /var/log/postsql.log; } \n\
\n\
log "Starting" \n\
\n\
@ -116,7 +105,6 @@ RUN urpmi --force mariadb
VOLUME ${MARIADDB_LIB}
VOLUME ${MARIADDB_LOG}
VOLUME /var/lib/mysql
EXPOSE ${MARIADDB_PORT}
EXPOSE 3306

View File

@ -1,11 +1,11 @@
Welcome to Rx3-Docker/MariaDB docker image!
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-docker/server:1.2.0-mga9 image,
- Curtently based on rx3/server-mga9:1.1.1 image,
- Following env vars supported:
- MARIADB_UID & MARIADB_GID,
- MARIADB_ROOT_HOST & MARIADB_ROOT_PASSWORD,
@ -19,4 +19,4 @@ Your Rx3 Team.
--
arnaud@rx3.net
https://git.rx3.org/gitea/rx3-docker/mariadb
https://git.rx3.org/gitea/rx3/mariadb-mga9

View File

@ -1,42 +1,3 @@
------------------------------------------------------------------------------------------------------------------------------------
Rx3-Docker/MariaDB-Mga9 V 1.1.0 - A. GIBERT - 2024/11/17
------------------------------------------------------------------------------------------------------------------------------------
- Move & Rename repo from Rx3/MariaDB-MGA9 to Rx3-Docker/MariaDB,
- New version naming standard,
- Now use docker_tools for .env building,
- Now use docker_service_add macro,
- Use now rx3-docker/server:1.2.0-mga9 image,
- Add /var/log/init, /var/log/supervisor & var/log/mysql volumes.
------------------------------------------------------------------------------------------------------------------------------------
Rx3/MariaDB-Mga9 V 1.0.2 - A. GIBERT - 2024/11/05
------------------------------------------------------------------------------------------------------------------------------------
- Add healthcheck example in compose file.
------------------------------------------------------------------------------------------------------------------------------------
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
------------------------------------------------------------------------------------------------------------------------------------
- Now based on server-mga9:1.1.2 image.
------------------------------------------------------------------------------------------------------------------------------------
Rx3/MariaDB-Mga9 V 1.0.0 - A. GIBERT - 2024/08/27
------------------------------------------------------------------------------------------------------------------------------------

View File

@ -1,54 +1,40 @@
# Rx3-Docker/MariaDB Docker Image
# Rx3 MariaDB Mageia-9 Docker Image
#-------------------------------------------------------------------------------
name: ${DATABASE_IMG_NAME}
name: ${IMG_NAME}
services:
database:
container_name: ${DATABASE_HOST_NAME}
hostname: ${DATABASE_HOST_NAME}
container_name: ${IMG_NAME}
image: ${DATABASE_IMG_URL}
image: ${IMG_URL}
build:
context: .
context: .
args:
IMG_NAME: ${DATABASE_IMG_NAME}
IMG_NAME_FULL: ${DATABASE_IMG_NAME_FULL}
IMG_VERSION: ${DATABASE_IMG_VERSION}
IMG_MAINTAINER: ${DATABASE_IMG_MAINTAINER}
IMG_FROM_URL: ${DATABASE_IMG_FROM_URL}
MARIADDB_LIB: ${DATABASE_LIB_INT}
MARIADDB_LOG: ${DATABASE_LOG_MAIN_INT}
MARIADDB_PORT: ${DATABASE_PORT_MAIN_INT}
POSTSQL_LOG: ${DATABASE_LOG_POST_INT}
- IMG_NAME=${IMG_NAME}
- IMG_FULL_NAME=${IMG_FULL_NAME}
- IMG_VERSION=${IMG_VERSION}
- IMG_MAINTAINER=${IMG_MAINTAINER}
- IMG_URL_PREFIX=${IMG_URL_PREFIX}
restart: unless-stopped
restart: unless-stopped
environment:
MARIADB_UID: ${DATABASE_USER_ID}
MARIADB_GID: ${DATABASE_GROUP_ID}
MARIADB_ROOT_HOST: ${MARIADB_ROOT_HOST}
MARIADB_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD}
MARIADB_DATABASE: ${MARIADB_DATABASE}
MARIADB_USER: ${MARIADB_USER}
MARIADB_PASSWORD: ${MARIADB_PASSWORD}
healthcheck:
test: ["CMD", 'mysqladmin', 'ping', '-h', 'localhost', '-u', 'root', '-p${MARIADB_ROOT_PASSWORD}' ]
interval: 10s
timeout: 3s
retries: 3
MARIADB_UID: ${MARIADB_UID}
MARIADB_GID: ${MARIADB_GID}
MARIADB_ROOT_HOST: ${MARIADB_ROOT_HOST}
MARIADB_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD}
MARIADB_DATABASE: ${MARIADB_DATABASE}
MARIADB_USER: ${MARIADB_USER}
MARIADB_PASSWORD: ${MARIADB_PASSWORD}
volumes:
- ./${DATABASE_LIB_EXT}:${DATABASE_LIB_INT}
- ./${DATABASE_LOG_INIT_EXT}:${DATABASE_LOG_INIT_INT}
- ./${DATABASE_LOG_SV_EXT}:${DATABASE_LOG_SV_INT}
- ./${DATABASE_LOG_MAIN_EXT}:${DATABASE_LOG_MAIN_INT}
- ./mysql:/var/lib/mysql
network_mode: bridge
ports:
- "127.0.0.1:${DATABASE_PORT_SV_EXT}:${DATABASE_PORT_SV_INT}"
- "127.0.0.1:${DATABASE_PORT_MAIN_EXT}:${DATABASE_PORT_MAIN_INT}"
- "127.0.0.1:9012:9001"
- "127.0.0.1:8006:3306"

View File

@ -1,40 +0,0 @@
# Rx3-Docker/MariaDB Docker Image
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# Global Settings
#-------------------------------------------------------------------------------
ORG_NAME="rx3-docker"
ORG_REGISTRY="docker.xor.rx3:5000"
ORG_MAINTAINER='"Arnaud G. GIBERT" <arnaud@rx3.net>'
ORG_URL_PREFIX="${ORG_REGISTRY}/${ORG_NAME}"
#-------------------------------------------------------------------------------
# Image Settings
#-------------------------------------------------------------------------------
HOST_NAME_PREFIX=""
PORT_ENV_OFFSET=0
PORT_SV_OFFSET=1000
#------------------+----------+--------------------+--------------------------+------------------------------------------+------------+--------------------+---------------+------------+--------------+------------+-------+-------+-------+-------+--------------+--------------+
# | Variable | Target Image | From Image | Module | Main Port | Admin Port | User | Group |
# | Prefix | URL Prefix | Name | Name Full + Version | URL Prefix | Name + Version | Name | Version | Ext | Int | Ext | Int | Name / Id | Name / Id |
#------------------+----------+--------------------+--------------------------+------------------------------------------+------------+--------------------+---------------+------------+--------------+------------+-------+-------+-------+-------+--------------+--------------+
docker_service_add DATABASE ${ORG_URL_PREFIX} mariadb "Rx3-Docker/MariaDB Docker Image" 1.1.0-mga9 ${ORG_URL_PREFIX} server 1.2.0-mga9 mysql - 8006 3306 - - 983 981
MARIADB_ROOT_HOST='%' # needs to be enclosed with quotes
MARIADB_ROOT_PASSWORD="mysqladmin"
MARIADB_DATABASE="test"
MARIADB_USER="test"
MARIADB_PASSWORD="testadmin"

View File

@ -1,4 +0,0 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

View File

@ -1,4 +0,0 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

View File

@ -1,4 +0,0 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

View File

@ -1,4 +0,0 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore