Signed-off-by: Wu Zhende wuzhende666@163.com --- container/kibana/Dockerfile | 7 +++++-- container/kibana/build | 10 +++++++++- 2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/container/kibana/Dockerfile b/container/kibana/Dockerfile index 970eb5a..7085618 100644 --- a/container/kibana/Dockerfile +++ b/container/kibana/Dockerfile @@ -5,8 +5,11 @@ ARG BASE_IMAGE
FROM ${BASE_IMAGE}
-# docker image borrowed from hub.docker.com/r/gagara/kibana-oss-arm64 +ARG USER +ARG PASSWORD
MAINTAINER Wu Zhende wuzhende666@163.com
-RUN sed -i 's/server.host: "0"/server.host: "0.0.0.0"/' config/kibana.yml +RUN sed -i 's/server.host: "0"/server.host: "0.0.0.0"/' config/kibana.yml && \ + sed -i "6i\elasticsearch.username: ${USER}" config/kibana.yml && \ + sed -i "6i\elasticsearch.password: ${PASSWORD}" config/kibana.yml diff --git a/container/kibana/build b/container/kibana/build index 9c75aeb..c7bcd40 100755 --- a/container/kibana/build +++ b/container/kibana/build @@ -3,8 +3,16 @@ # Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. # frozen_string_literal: true
+require 'set' require_relative '../defconfig'
+names = Set.new %w[ + ES_USER + ES_PASSWORD +] + +defaults = relevant_service_authentication(names) + docker_skip_rebuild "kibana:7.11.1"
BASE_IMAGE_DICT = { @@ -13,4 +21,4 @@ BASE_IMAGE_DICT = {
BASE_IMAGE = BASE_IMAGE_DICT[%x(arch).chomp]
-system "docker build -t kibana:7.11.1 --build-arg BASE_IMAGE=#{BASE_IMAGE} ." +system "docker build -t kibana:7.11.1 --build-arg BASE_IMAGE=#{BASE_IMAGE} --build-arg USER=#{defaults['ES_USER']} --build-arg PASSWORD=#{defaults['ES_PASSWORD']} ."