MetaBase UI Console(2)Docker on MySQL

MetaBaseUIConsole(2)DockeronMySQL

SetupMetaBaseonCentOS7

InstallJAVA

>sudoyuminstalljava-1.8.0-openjdk-devel

>java-version

openjdkversion"1.8.0_191"

OncethejavaENVarethere,wecandirectlyrunthecommand

>java-jarmetabase-metabase-2018-11-27.jar

TrytoSetupDockerforThat

CreateaDatabaseFirst

>createdatabasemetabase;

>grantallprivilegesonmetabase.*tometabase@"%"identifiedby'metabase';

>flushprivileges;

BackendwilluseMySQL.Makethedockerinformation.

DockerfilewilldescribealltheENVweneed.

#SetUpPHPFPM

#PrepretheOS

FROMcentos:7

MAINTAINERCarlLuo<[email protected]>

#installthesoftwarea

RUNyum-yupdate

RUNyuminstall-yjava-1.8.0-openjdk-devel

#installmetabase

RUNmkdir-p/tool/

ADDinstall/metabase.jar/tool/

WORKDIR/tool/

#starttheapplication

EXPOSE3000

RUNmkdir-p/app/

ADDstart.sh/app/

WORKDIR/app/

CMD["./start.sh"]

MakefilewilldescribealltheENVwehave.

PORT=3001

MB_DB_USER=metabase

MB_DB_PASS=metabase

MB_DB_HOST=localhost

IMAGE=sillycat/public

TAG=centos7-metabase

NAME=centos7-metabase-$(PORT)

prepare:

wgethttp://downloads.metabase.com/v0.31.1/metabase.jar-Pinstall/

docker-context:

build:docker-context

dockerbuild-t$(IMAGE):$(TAG).

run:

dockerrun-d-p$(PORT):3000-eMB_DB_USER=${MB_DB_USER}-eMB_DB_PASS=${MB_DB_PASS}-eMB_DB_HOST=${MB_DB_HOST}--name$(NAME)$(IMAGE):$(TAG)

debug:

dockerrun-ti-p$(PORT):3000--name$(NAME)$(IMAGE):$(TAG)/bin/bash

clean:

dockerstop${NAME}

dockerrm${NAME}

logs:

dockerlogs${NAME}

publish:

dockerpush${IMAGE}

start.shisthefiletoStartthemetabaseapplication

#!/bin/sh-ex

exportMB_DB_TYPE=mysql

exportMB_DB_DBNAME=metabase

exportMB_DB_PORT=3306

exportMB_JETTY_HOST=0.0.0.0

cd/tool/

java-jar-Xms2048M-Xmx2048M-XX:NewSize=512m-XX:MaxNewSize=1024mmetabase.jar

References:

相关推荐