docker-mariadb

A Dockerfile that produces a container that will run MariaDB ,a drop-in replacement for MySQL.

Image Creation

This example creates the image with the tag paintedfox/mariadb, but you canchange this to use your own username.

$ docker build -t="paintedfox/mariadb" .

Alternately, you can run the following if you have make installed...

$ make

You can also specify a custom docker username like so:

$ make DOCKER_USER=paintedfox

Container Creation / Running

The MariaDB server is configured to store data in /data inside the container.You can map the container's /data volume to a volume on the host so the databecomes independant of the running container.

This example uses /tmp/mariadb to store the MariaDB data, but you can modifythis to your needs.

When the container runs, it creates a root with a random password. Youcan set the username and password for the root by setting the container'senvironment variables. This lets you discover the username and password of theroot from within a linked container or from the output of docker inspect
mariadb.

If you ran the mariadb container with the flags -e USER=<user> and -e
PASS=<pass>, then the linked container should have these variables availablein its environment. Since we aliased the database container with the namedb, the environment variables from the database container are copied into thelinked container with the prefix DB_ENV_.