dimanche 7 février 2016

Making MariaDB work on musl for Alpine Linux


First of all, I wish to thank the father of MariaDB, Michael Widenius commited my code to MariaDB.

It has been a long journey to making MariaDB  musl compatible and we've finally done it. 



The world of lightweight, portable and secure distros


Alpine Linux :

Alpine linux is a security-oriented distro based on musl libc and busybox.

Portability: The image itself is an 82 MB iso file. So, as you may guess, no bloatware, virtually no vulnerabilities 
and very portable. Heck! that thing can run from my oldest 128MB thumb drive.

Resource efficiency: And don't forget also that this tiny distro is resource efficient too. You might need around 8-256MB of RAM to get it up and running.

Security: Quoted from the official website itself  "The kernel is patched with grsecurity/PaX out of the box, and all userland binaries are compiled as Position Independent Executables (PIE) with stack smashing protection. These proactive security features prevent exploitation of entire classes of zero-day and other vulnerabilities. "

Musl libc :

We've already talked about musl libc in a previous post. For those who weren't following, please refer to: this article

So, how do i use it ?

I'm glad you asked ! Well for starters, you can run MariaDB on Alpine Linux by compiling MariaDB from source.
The way its done is by downloading MariaDB from the most recent source tree.
And compiling it using your favourite compiler.

But for it to be compatible with musl we need to disable TokuDB.

Of course, TokuDB compatibility under musl is still a work in progress and will be available in no time.

Commands to get MariaDB to run with musl :

cd to source directory
cmake . -DWITHOUT_TOKUDB=1
make

There you go ! You are now running MariaDB on a secure box using musl libc :)

Aucun commentaire:

Enregistrer un commentaire