If you use the official Docker image for MariaDB, maybe you found out that the promising MyRocks storage engine isn't enabled in the MariaDB 10.2 image.

However with some basic Docker instructions it is really easy to build a MyRocks-enabled MariaDB 10.2 docker image and run it on demand.

First of all, just create a simple Dockerfile in your current directory:

FROM mariadb:10.2
RUN apt-get update && apt-get -y install mariadb-plugins-rocksdb && rm -rf /var/cache/apt/lists/*

Then, making sure that you've pulled the latest MariaDB image from the Docker Hub, build it and run it:

docker pull mariadb:10.2
docker build -t myrocks .
docker run -d -p 3306:3306 --name myrocks -e MYSQL_ROOT_PASSWORD=my-secret-pw myrocks
mysql -h 127.0.0.1 -P3306 -u root -pmy-secret-password 

Quickly check that MyRocks is enabled:

$ mysql -uroot -pmy-secret-pw -h127.0.0.1 -P3306
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 10.2.10-MariaDB-10.2.10+maria~jessie mariadb.org binary distribution

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show engines;
+--------------------+---------+----------------------------------------------------------------------------------+--------------+------+------------+
| Engine             | Support | Comment                                                                          | Transactions | XA   | Savepoints |
+--------------------+---------+----------------------------------------------------------------------------------+--------------+------+------------+
| ROCKSDB            | YES     | RocksDB storage engine                                                           | YES          | YES  | YES        |
| CSV                | YES     | CSV storage engine                                                               | NO           | NO   | NO         |
| SEQUENCE           | YES     | Generated tables filled with sequential values                                   | YES          | NO   | YES        |
| MRG_MyISAM         | YES     | Collection of identical MyISAM tables                                            | NO           | NO   | NO         |
| MyISAM             | YES     | MyISAM storage engine                                                            | NO           | NO   | NO         |
| InnoDB             | DEFAULT | Supports transactions, row-level locking, foreign keys and encryption for tables | YES          | YES  | YES        |
| MEMORY             | YES     | Hash based, stored in memory, useful for temporary tables                        | NO           | NO   | NO         |
| Aria               | YES     | Crash-safe tables with MyISAM heritage                                           | NO           | NO   | NO         |
| PERFORMANCE_SCHEMA | YES     | Performance Schema                                                               | NO           | NO   | NO         |
+--------------------+---------+----------------------------------------------------------------------------------+--------------+------+------------+
9 rows in set (0.00 sec)

Enjoy your MyRocks-enabled MariaDB Docker image!

Next Post Previous Post