Public | Automated Build

Last pushed: a year ago
Short Description
My small MariaDB Container
Full Description

docker-mariadb

This is a docker container with mariadb. The intention to build this container is to make it as small as possible. Therefore, this container is based on alpine.

Usage

Setup

Run make init to start the initial setup or copy config.env.dist to config.env.
Edit the remaining parameters such as MYSQL_USERNAME and MYSQL_PASSWORD with your own data in the config.env file.
For more parameters, see section below.

Parameters

Parameter required optional
MYSQL_USER :white_check_mark:
MYSQL_PASS :white_check_mark:
INIT_DATABASE :white_check_mark:

Build the Container

Run make build to build the container localy. This will build a local container like sysreport/mariadb:latest. You can change this by editing the Makefile.

Run the Container

Please check, before you start the container, whether the port 3306 is already in use.
netstat -an | grep 3306 is your friend to check whether 3306 is or not in use.

Run make run to start the container with the name mariadb.
You can change the name of the container by editing the Makefile. The run command use the config.env file for configuration.
If you do not want to use the Makefile, you can also run:
docker run -d -p 3306:3306 --name mariadb --env-file config.env sysreport/mariadb
or without the config.env file
docker run -d -p 3306:3306 --name mariadb -e "MYSQL_USER=username" -e "MYSQL_PASS=password" -e "INIT_DATABASE=firstDB" sysreport/mariadb

Stop and Delete the Container or Image

Using make stop or make rm, the container can be stopped or deleted.
If you do not want to use the Makefile, you can also run:
docker stop mariadb
docker rm mariadb

With make clean the image is clear away.
If you do not want to use the Makefile, you can also run:
docker rmi sysreport/mariadb:latest

Versions

Branch MariaDB Version Docker Tag
master 10.1.19 latest
develop 10.1.19 develop
10.1.19 10.1.19 mariadb-10.1.19

Docker Compose

mariadb:
    image: sysreport/mariadb:latest
    container_name: mariadb
    ports:
        - "3306:3306"
    volumes:
        - ./mariadb/mysql:/var/lib/mysql
    environment:
        MYSQL_USER: username
        MYSQL_PASS: password
        INIT_DATABASE: firstDB
Docker Pull Command
Owner
sysreport
Source Repository