Sign inSign up

nbmaiti/alpine-mariadb

By nbmaiti

Updated over 4 years ago

Image
0

1.5K

nbmaiti/alpine-mariadb repository overview

alpine-mariadb

This docker image based on Alpine Linux to be as minimal as possible and was designed for x86/arm32v7/arm64.

Why Alpine Linux?

Alpine Linux is built around musl libc and busybox. This makes it smaller and more resource efficient than traditional GNU/Linux distributions. A container requires no more than 8 MB and a minimal installation to disk requires around 130 MB of storage. Not only do you get a fully-fledged Linux environment but a large selection of packages from the repository.

Why MariaDB Server?

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 and layers
  • Low memory usage
  • Open Source replacement (MariaDB instead of MySQL)

Environment Variables

Main environment variables of MariaDB.

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

MYSQL_CHARSET

default charset (utf8) for Mariadb

MYSQL_COLLATION

default collation (utf8_general_ci) for Mariadb

When setting charset, also make sure to choose a collation otherwise it will be the default.

CharsetDescriptionDefault collationmax len
big5Big5 Traditional Chinesebig5_chinese_ci2
dec8DEC West Europeandec8_swedish_ci1
cp850DOS West Europeancp850_general_ci1
hp8HP West Europeanhp8_english_ci1
koi8rKOI8-R Relcom Russiankoi8r_gener 1al_ci1
latin1cp1252 West Europeanlatin1_swedish_ci1
latin2ISO 8859-2 Central Europeanlatin2_general_ci1
swe77bit Swedishswe7_swedish_ci1
asciiUS ASCIIascii_general_ci1
ujisEUC-JP Japaneseujis_japanese_ci3
sjisShift-JIS Japanesesjis_japanese_ci2
hebrewISO 8859-8 Hebrewhebrew_general_ci1
tis620TIS620 Thaitis620_thai_ci1
euckrEUC-KR Koreaneuckr_korean_ci2
koi8uKOI8-U Ukrainiankoi8u_general_ci1
gb2312GB2312 Simplified Chinesegb2312_chinese_ci2
greekISO 8859-7 Greekgreek_general_ci1
cp1250Windows Central Europeancp1250_general_ci1
gbkGBK Simplified Chinesegbk_chinese_ci2
latin5ISO 8859-9 Turkislatin5_turkish_ci1
armscii8ARMSCII-8 Armenianarmscii8_general_ci1
utf8UTF-8 Unicodeutf8_general_ci3
ucs2UCS-2 Unicodeucs2_general_ci2
cp866DOS Russiancp866_general_ci1
keybcs2DOS Kamenicky Czech-Slovakkeybcs2_general_ci1
macceMac Central Europeanmacce_general_ci1
macromanMac West Europeanmacroman_general_ci1
cp852DOS Central Europeancp852_general_ci1
latin7ISO 8859-13 Balticlatin7_general_ci1
utf8mb4UTF-8 Unicodeutf8mb4_general_ci4
cp1251Windows Cyrilliccp1251_general_ci1
utf16UTF-16 Unicodeutf16_general_ci4
utf16leUTF-16LE Unicodeutf16le_general_ci4
cp1256Windows Arabiccp1256_general_ci1
cp1257Windows Balticcp1257_general_ci1
utf32UTF-32 Unicodeutf32_general_ci4
binaryBinary pseudo charsetbinary1
geostd8GEOSTD8 Georgiangeostd8_general_ci1
cp932SJIS for Windows Japanesecp932_japanese_ci2
eucjpmsUJIS for Windows Japaneseeucjpms_japanese_ci3

Volumes

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

Commands

When a container is started for the first time, a new database with the specified name will be created and initialized with the provided configuration variables. Furthermore, it will execute files with extensions .sh, .sql and .sql.gz that are found in /docker-entrypoint-initdb.d.

  • --character-set-server=utf8mb4
  • --collation-server=utf8mb4_unicode_ci
  • --explicit-defaults-for-timestamp=1

SQL files will be imported by default to the database specified by the MYSQL_DATABASE variable.

Example

Do not use this example in a production environment without changing the credentials!

version: '3'

services:
  mysql:
    image: nbmaiti/alpine-mariadb
    restart: always
    command: ['--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci']
    environment:
      MYSQL_ROOT_PASSWORD: ROOTPASSWORD
      MYSQL_USER: someuser
      MYSQL_PASSWORD: SOMEUSERPASSWORD
      MYSQL_DATABASE: some-database
    ports:
      - '3306:3306'
    volumes:
      - ./mysql:/var/lib/mysql

Credits

  • To the people who wrote the run script.

Tag summary

Content type

Image

Digest

Size

62.8 MB

Last updated

over 4 years ago

docker pull nbmaiti/alpine-mariadb