On Wed, Nov 11, 2020 at 02:03:59PM +0800, Liu Yinsi wrote:
[why] when build kibana images in x86_machine, error message:
[root@localhost kibana]# ./build Sending build context to Docker daemon 5.12kB Step 1/3 : FROM gagara/kibana-oss-arm64:7.6.2 7.6.2: Pulling from gagara/kibana-oss-arm64 38163f410fa0: Pull complete 69a4d016f221: Pull complete 95e6c6e7c9ca: Pull complete d13f429dd982: Pull complete 508bb3330fb2: Pull complete 9634e726f1b6: Pull complete 9c26c37850c8: Pull complete 0d0ad8467060: Pull complete 940f92726f8b: Pull complete Digest: sha256:541632b7e9780a007f8a8be82ac8853ddcebcb04a596c00500b73f77eacfbd16 Status: Downloaded newer image for gagara/kibana-oss-arm64:7.6.2 ---> f482a0472f78 Step 2/3 : MAINTAINER Wu Zhende wuzhende666@163.com ---> Running in cfa86d8ce976 Removing intermediate container cfa86d8ce976 ---> 3be6c5f24d4b Step 3/3 : RUN sed -i 's/server.host: "0"/server.host: "0.0.0.0"/' config/kibana.yml ---> Running in ff455f66df8b standard_init_linux.go:220: exec user process caused "exec format error" libcontainer: container start initialization failed: standard_init_linux.go:220: exec user process caused "exec format error" The command '/bin/sh -c sed -i 's/server.host: "0"/server.host: "0.0.0.0"/' config/kibana.yml' returned a non-zero code: 1
That's too large, how about just show the key information?
Thanks, Xueliang
because arm base image not support to build in x86 machine.
[how]
- use images dict to store arm and x86 base images
- use $(arch) to choose base image according to different system architecture
Signed-off-by: Liu Yinsi liuyinsi@163.com
container/kibana/Dockerfile | 4 +++- container/kibana/build | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/container/kibana/Dockerfile b/container/kibana/Dockerfile index 35802fe..6e0dba0 100644 --- a/container/kibana/Dockerfile +++ b/container/kibana/Dockerfile @@ -1,7 +1,9 @@ # SPDX-License-Identifier: MulanPSL-2.0+ # Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved.
-FROM gagara/kibana-oss-arm64:7.6.2 +ARG BASE_IMAGE
+FROM BASE_IMAGE
# docker image borrowed from hub.docker.com/r/gagara/kibana-oss-arm64
diff --git a/container/kibana/build b/container/kibana/build index a7e4717..52d5a2a 100755 --- a/container/kibana/build +++ b/container/kibana/build @@ -3,4 +3,10 @@ # Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. # frozen_string_literal: true
-system 'docker build -t kibana:7.6.2 .' +BASE_IMAGE_DICT = {
- 'aarch64' => 'gagara/kibana-oss-arm64:7.6.2',
- 'x86_64' => 'kibana:7.6.2' }.freeze
+BASE_IMAGE = BASE_IMAGE_DICT[%x(arch).chomp]
+system "docker build -t kibana:7.6.2 --build-arg BASE_IMAGE=#{BASE_IMAGE} ."
2.23.0