Sign inSign up

kleberbaum/mariadb

By kleberbaum

•Updated over 8 years ago

(self-proclaimed) best MariaDB container on Docker Hub based on Alpine Linux

Image
1

1.2K

kleberbaum/mariadb repository overview

⁠MariaDB for Docker

Build Status Docker Stars Docker Pulls ImageLayers

Size optimised docker image based on alpine⁠.

Extensively tested on netcup 2.99€/a VPS⁠.

⁠What is Alpine Linux?

Alpine Linux is a Linux distribution built around musl libc and BusyBox. The image is only 5 MB in size and has access to a package repository that is much more complete than other BusyBox based images. This makes Alpine Linux a great image base for utilities and even production applications. Read more about Alpine Linux here and you can see how their mantra fits in right at home with Docker images.

⁠What is MariaDB?

MariaDB Server is one of the most popular database servers in the world. It’s made by the original developers of MySQL and guaranteed to stay open source. Notable users include Wikipedia, WordPress.com and Google.

MariaDB turns data into structured information in a wide array of applications, ranging from banking to websites. It is an enhanced, drop-in replacement for MySQL. MariaDB is used because it is fast, scalable and robust, with a rich ecosystem of storage engines, plugins and many other tools make it very versatile for a wide variety of use cases.

MariaDB is developed as open source software and as a relational database it provides an SQL interface for accessing data. The latest versions of MariaDB also include GIS and JSON features.

⁠Features

  • Minimal size only 48 MB and only 4 layers
  • Memory usage is minimal on a simple install.
  • MariaDB the MySQL replacement

⁠Volume structure

  • /var/lib/mysql: Database files
  • /var/lib/mysql/mysql-bin: MariaDB logs

⁠Environment Variables:

⁠Main Mariadb parameters:
  • MYSQL_DATABASE: specify the name of the database
  • MYSQL_USER: specify the User for the database
  • MYSQL_PASSWORD: specify the User password for the database
  • MYSQL_ROOT_PASSWORD: specify the root password for Mariadb

⁠Creating an instance

docker run -it --name mysql -p 3306:3306 -v /var/lib/mysql:/var/lib/mysql -e MYSQL_DATABASE=wordpressdb -e MYSQL_USER=wordpressuser -e MYSQL_PASSWORD=hguyFt6S95dgfR4ryb -e MYSQL_ROOT_PASSWORD=hguyFtgfR4r9R4r76 yobasystems/alpine-mariadb

It will create a new db, and set mysql root password (default is RaNd0MpA$$W0Rd generated by pwgen) unless the data already exists.

⁠Docker Compose example:

####(Please pass your own credentials or let them be generated automatically, don't use these ones for production!!)

mysql:
  image: yobasystems/alpine-mariadb
  environment:
    MYSQL_ROOT_PASSWORD: hguyFtgfR4r9R4r76
    MYSQL_DATABASE: wordpressdb
    MYSQL_USER: wordpressuser
    MYSQL_PASSWORD: hguyFt6S95dgfR4ryb
  expose:
    - "3306"
  volumes:
    - /data/example/mysql:/var/lib/mysql
  restart: always

Tag summary

Content type

Image

Digest

Size

58.5 MB

Last updated

over 8 years ago

docker pull kleberbaum/mariadb