This is an Alpine Linux based image for MariaDB database server.
MariaDB is a community-developed fork of the MySQL relational database management system intended to remain free under the GNU GPL. Being a fork of a leading open source software system, it is notable for being led by the original developers of MySQL, who forked it due to concerns over its acquisition by Oracle. Contributors are required to share their copyright with the MariaDB Foundation.
The intent is also to maintain high compatibility with MySQL, ensuring a "drop-in" replacement capability with library binary equivalency and exact matching with MySQL APIs and commands. It includes the XtraDB storage engine for replacing InnoDB, as well as a new storage engine, Aria, that intends to be both a transactional and non-transactional engine perhaps even included in future versions of MySQL.
More info on Wikipedia
MariaDB service on this container will run as non-root
(mysql
) user. This add an extra layer of security and are generally recommended for production environments. This container also allow mapping of the user id
dan group id
of the user running docker to mysql
user and group, which will enable the use of more restrictive file permission.
$ docker run --name mariadb -v /path/to/mariadb-data-on-host:/data -v /path/to/mysql/config.cnf:/etc/mysql/my.cnf:ro -e TZ=Asia/Jakarta -e EUID=$(id -u) -e EGID=$(id -g) martinussuherman/alpine-tz-ep-mariadb
This will set the timezone
to Asia/Jakarta (you will want to change it to your own timezone) and map the user id
dan group id
of the current user to mysql
user and group.
version: '3'
services:
mariadb:
image: martinussuherman/alpine-tz-ep-mariadb
environment:
- TZ=Asia/Jakarta
- EUID=1001
- EGID=1001
volumes:
- /path/to/mysql/config.cnf:/etc/mysql/my.cnf:ro
- /path/to/mariadb-data-on-host:/data
Note: you will want to change the value for EUID
and EGID
with your current user user id
dan group id
.