Sign inSign up

rusxakep/mariadb

By rusxakep

•Updated almost 6 years ago
Archived

Docker MariaDB server w/ S6 Overlay, Zabbix Monitoring based on Alpine

0

131

rusxakep/mariadb repository overview

⁠github.com/rusxakep/docker-mariadb

Build Status Docker Pulls Docker Stars Docker
Layers

⁠Introduction

Dockerfile to build a MariaDB Server⁠ Image.

  • Configuration tweaked to use all around settings for general usage - Can be changed
  • Can use official Mysql/MariaDB environment variables (MYSQL_USER, MYSQL_PASSWORD, MYSQL_ROOT_PASSWORD)
  • Allows for automatically creating multiple databases on container initialization
  • Automatic Table/DB Upgrade support if MariaDB version has changed
  • Includes MySQL Tuner inside image to optimize your configuration
  • Zabbix Monitoring for metrics

Also has the capability of backing up embedded in the container based on the rusxakep/dbbackup⁠ image which includes the following features:

  • dump to local filesystem

  • Backup all databases

  • choose to have an MD5 sum after backup for verification

  • delete old backups after specific amount of time

  • choose compression type (none, gz, bz, xz)

  • select how often to run a dump

  • select when to start the first dump, whether time of day or relative to container start time

  • This Container uses a customized Alpine Linux base⁠ which includes s6 overlay⁠ enabled for PID 1 Init capabilities, zabbix-agent⁠ for individual container monitoring, Cron also installed along with other tools (bash,curl, less, logrotate, mariadb-client, nano, vim) for easier management. It also supports sending to external SMTP servers..

Changelog⁠

⁠Authors

⁠Table of Contents

⁠Prerequisites

⁠Installation

Automated builds of the image are available on Docker Hub⁠ and is the recommended method of installation.

docker pull rusxakep/mariadb
⁠Quick Start

⁠Configuration

⁠Data-Volumes

The following directories are used for configuration and can be mapped for persistent storage.

DirectoryDescription
/var/lib/mysqlMySQL Data Directory
/etc/mysql/conf.dOptional directory to put .cnf files for additional directives
/backupOptional directory for backups
⁠Environment Variables

Along with the Environment Variables from the Base image⁠, below is the complete list of available options that can be used to customize your installation.

ParameterDescriptionDefault
CHARACTER_SETSet Default Character Setutf8mb4
COLLATIONSet Default Collationutf8mb4_general_ci
ROOT_PASSRoot Password for Instance (e.g. password)
DB_AUTO_UPGRADEIf MariaDB has changed from first time image has been used, automatically upgrade DBs and tables to latest versions - TRUE / FALSETRUE
DB_CONFIGURATIONType of Configuration - standard, or defaultstandard
DB_NAMEOptional - Automatically Create Database - Seperate with commas for multiple databases
DB_USEROptional - Automatically Assign Username Priveleges to Database (e.g. mysqluser)
DB_PASSPassword for authentication to above database (e.g. password)
  • With regards to DB_CONFIGURATION
    • default - Means the default my.cnf file from MariaDB
    • standard - My own settings that I find work for my own DB servers.

This image can also backup databases on a scheduled basis as well. These environment variables are:

ParameterDescriptionDefault
DB_BACKUPEnable TRUE or disable FALSE embedded backup routinesFALSE
DB_BACKUP_COMPRESSIONUse either Gzip GZ, Bzip2 BZ, XZip XZ, or none NONEGZ
DB_BACKUP_DUMP_FREQHow often to do a dump, in minutes. Defaults to 1440 minutes, or once per day.
DB_BACKUP_DUMP_BEGINWhat time to do the first dump. Defaults to immediate. Must be in one of two formats
Absolute HHMM, e.g. 2330 or 0415
Relative +MM, i.e. how many minutes after starting the container, e.g. +0 (immediate), +10 (in 10 minutes), or +90 in an hour and a half
DB_BACKUP_CLEANUP_TIMEValue in minutes to delete old backups (only fired when dump freqency fires). 1440 would delete anything above 1 day old. You don't need to set this variable if you want to hold onto everything.
DB_BACKUP_MD5Generate MD5 Sum in Directory, TRUE or FALSETRUE
DB_BACKUP_PARALLEL_COMPRESSIONUse multiple cores when compressing backups TRUE or FALSETRUE
DB_BACKUP_SPLIT_DBIf using root as username and multiple DBs on system, set to TRUE to create Seperate DB Backups instead of all in one.FALSE
⁠Networking

The following ports are exposed.

PortDescription
3306MariaDB Server

⁠Maintenance

⁠Shell Access

For debugging and maintenance purposes you may want access the containers shell.

docker exec -it (whatever your container name is e.g. mariadb) bash
⁠Mysql Tuner

This image comes with Mysql Tuner⁠. Simply enter inside the container and execute mysql-tuner along with your arguments.

Manual Backups can be perforemd by entering the container and typing backup-now

⁠References

Tag Summary

No tags have been pushed to this repository yet.