I'm not sure whether you're aware of this issue experienced by docker users: https://github.com/docker-library/mariadb/issues/95
When you start latest stable MariaDB with Docker for Mac/Win and /var/lib/mysql mounted from the host machine it fails with error:
As noted by tianon in the github issue:
Docker and MariaDB work fine together; the bit that doesn't work is the custom filesystem employed by Docker for Windows and Docker for Mac for sharing files across the VM boundary, which is not all that surprising for a database, which often use features like mmap for performance but thus also require support from the underlying filesystem. There are many reports of similar issues with vboxsf, for example.
Any fixes would have to happen either in Docker's shared filesystem or in MariaDB itself (not something we can really fix in this Docker image), so I'd recommend checking their respective upstream bugtrackers for any discussion of fixing the problem.
Also, it worth saying that older MariaDB versions work fine, for example 10.1.22
Docker images where the problem happens: