From 7fa7016fca87c542e5b07c63d9e929b6f026db46 Mon Sep 17 00:00:00 2001 From: axl89 Date: Fri, 12 Aug 2016 13:02:57 +0200 Subject: [PATCH] Added default MYSQL_DATABASE environment variable (cherry picked from commit 689a867f3b05cff063462f0570cdc7107319257f) --- pandora_console/DB_Dockerfile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pandora_console/DB_Dockerfile b/pandora_console/DB_Dockerfile index bfe01639c2..eb6465f6c1 100644 --- a/pandora_console/DB_Dockerfile +++ b/pandora_console/DB_Dockerfile @@ -2,8 +2,13 @@ FROM mysql:5.5 MAINTAINER Pandora FMS Team WORKDIR /pandorafms/pandora_console + ADD pandoradb.sql /docker-entrypoint-initdb.d ADD pandoradb_data.sql /docker-entrypoint-initdb.d -RUN /bin/bash -c 'echo "CREATE DATABASE pandora" > /docker-entrypoint-initdb.d/create_pandoradb.sql' -RUN /bin/bash -c 'sed -i "1iUSE pandora" /docker-entrypoint-initdb.d/pandoradb.sql' -RUN /bin/bash -c 'sed -i "1iUSE pandora" /docker-entrypoint-initdb.d/pandoradb_data.sql' + +ENV MYSQL_DATABASE=pandora + +RUN echo " \n\ +sed -i \"1iUSE \$MYSQL_DATABASE\" /docker-entrypoint-initdb.d/pandoradb.sql \n\ +sed -i \"1iUSE \$MYSQL_DATABASE\" /docker-entrypoint-initdb.d/pandoradb_data.sql \n\ +" >> /docker-entrypoint-initdb.d/create_pandoradb.sh