From 2714fe8dd623964d32118f0d2b2ae57560e3030f Mon Sep 17 00:00:00 2001 From: Scott Koranda Date: Mon, 10 Apr 2017 11:23:29 -0500 Subject: [PATCH] added example for mariadb --- comanage-registry-mariadb/README.md | 66 +++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 comanage-registry-mariadb/README.md diff --git a/comanage-registry-mariadb/README.md b/comanage-registry-mariadb/README.md new file mode 100644 index 0000000..75bb0c4 --- /dev/null +++ b/comanage-registry-mariadb/README.md @@ -0,0 +1,66 @@ + + +# MariaDB for COmanage Registry + +A simple example demonstrating how to create and image and container +based on MariaDB to use with COmanage Registry containers. + +## Build + +There is no image to build. You can directly use the official MariaDB +image hosted on DockerHub. + +## Run + +Create a user-defined network bridge with + +``` +docker network create --driver=bridge \ + --subnet=192.168.0.0/16 \ + --gateway=192.168.0.100 \ + comanage-registry-internal-network +``` + +and then mount a host directory such as `/tmp/mariadb-data` +to `/var/lib/mysql` inside the container to persist +data. Use the environment variables + +``` +MYSQL_ROOT_PASSWORD +MYSQL_DATABASE +MYSQL_USER +MYSQL_PASSWORD +``` + +to set the password for the MySQL root user, the name of the COmanage +Registry database, and the name and password of the database user. For example + +``` +docker run -d --name comanage-registry-database \ + --network comanage-registry-internal-network \ + -v /tmp/mariadb-data:/var/lib/mysql \ + -e MYSQL_ROOT_PASSWORD=XXXXXXXX \ + -e MYSQL_DATABASE=registry \ + -e MYSQL_USER=registry_user \ + -e MYSQL_PASSWORD=xxxxxxxx \ + mariadb +```