Kibana 7.11.1 failing on Docker 7 Raspberry PI4 (arm7)

Hi,

I am trying to run Kibana 7.11.1 as a Docker container on Raspberry Pi 4. I can build the image, however I hit the following error on docker run:

    {"type":"log","@timestamp":"2021-02-21T13:02:58+00:00","tags":["fatal","root"],"pid":16,"message":"Error: /usr/share/kibana/node_modules/re2/build/Release/re2.node: wrong ELF class: ELFCLASS64\n    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1122:18)\n    at Module.load (internal/modules/cjs/loader.js:928:32)\n    at Function.Module._load (internal/modules/cjs/loader.js:769:14)\n    at Module.require (internal/modules/cjs/loader.js:952:19)\n    at Module.Hook._require.Module.require (/usr/share/kibana/node_modules/require-in-the-middle/index.js:80:39)\n    at Module.Hook._require.Module.require (/usr/share/kibana/node_modules/require-in-the-middle/index.js:80:39)\n    at Module.Hook._require.Module.require (/usr/share/kibana/node_modules/require-in-the-middle/index.js:80:39)\n    at Module.Hook._require.Module.require (/usr/share/kibana/node_modules/require-in-the-middle/index.js:80:39)\n    at Module.Hook._require.Module.require (/usr/share/kibana/node_modules/require-in-the-middle/index.js:80:39)\n    at require (internal/modules/cjs/helpers.js:88:18)\n    at Object.<anonymous> (/usr/share/kibana/node_modules/re2/re2.js:3:13)\n    at Module._compile (internal/modules/cjs/loader.js:1063:30)\n    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)\n    at Module.load (internal/modules/cjs/loader.js:928:32)\n    at Function.Module._load (internal/modules/cjs/loader.js:769:14)\n    at Module.require (internal/modules/cjs/loader.js:952:19)"}

     FATAL  Error: /usr/share/kibana/node_modules/re2/build/Release/re2.node: wrong ELF class: ELFCLASS64

__

Here is my Dockerfile as a reference:
    FROM balenalib/raspberrypi3-debian:latest

    ENV ES_VERSION=7.11.1 \
        ES_OS=linux \
        ES_ARCH=x86_64 \
        JAVA_VERSION=11 \
        KIBANA_HOME=/usr/share/kibana \
        ES_HOST=127.0.0.1 \
        SERVER_HOST=0.0.0.0 \
        ES_PORT=9200 \
        ES_PROTO=http \
        NODE_HOME=/usr/share/nodejs \
        NODE_VERSION=14.15.4 \
        NODE_ARCH=armv7l

    COPY ./kibana_env.sh ./kibana_start.sh /

    RUN chmod +x /kibana_env.sh && \
      chmod +x /kibana_start.sh && \
      apt-get update && \
      apt-get -qy install bash curl libkrb5-dev ca-certificates openjdk-$JAVA_VERSION-jdk openjdk-$JAVA_VERSION-jre telnet net-tools && \
      curl -fsSL https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$NODE_ARCH.tar.gz  -o node.tgz && \
      curl -fsSL https://artifacts.elastic.co/downloads/kibana/kibana-$ES_VERSION-$ES_OS-$ES_ARCH.tar.gz -o kibana.tgz && \
      tar xvzf kibana.tgz > /dev/null 2>&1 && \
      tar xvzf node.tgz > /dev/null 2>&1 && \
      mv kibana-$ES_VERSION-$ES_OS-$ES_ARCH $KIBANA_HOME && \
      mv node-v$NODE_VERSION-linux-$NODE_ARCH $NODE_HOME && \
      ln -s $NODE_HOME/bin/node /usr/bin && \
      rm -rf node.tgz && \
      rm -rf kibana.tgz && \
      sed -i "s/.*NODE\=.*/NODE=\/usr\/bin\/node/g" $KIBANA_HOME/bin/kibana && \
      echo $KIBANA_HOME/bin/kibana --allow-root > $KIBANA_HOME/kibana_start.sh && \
      chmod +x $KIBANA_HOME/kibana_start.sh && \
      echo "server.host: KIBANA_HOST" >> $KIBANA_HOME/config/kibana.yml && \
      echo "elasticsearch.hosts: [\"ES_PROTO://ES_HOST:ES_PORT\"]" >> $KIBANA_HOME/config/kibana.yml

    EXPOSE 5601

    CMD [ "/kibana_start.sh" ]

I can't see Kibana dist for 32bit OS on Download Kibana Free | Get Started Now | Elastic | Elastic
You might have to install one of the supported OS. See Elastic Support Matrix | Elasticsearch

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.

Hi

I recognise the Dockerfile of this repo: oss / elasticstack / elasticstack-arm · GitLab

It was wrote for the 7.9.x and 7.10.x versions and worked well that time. Now I upgraded it with the 7.13.2 version and solve this issue : just made a rebuild the "re2" lib of nodejs on a 32 bits OS and copy the result in the Dockerfile sources.

You can directly pull those images on the docker hub (no need to rebuild if you don't make some changes):
https://hub.docker.com/repository/docker/comworkio/kibana
https://hub.docker.com/repository/docker/comworkio/elasticsearch

Those images are working well on 32 and 64 bits OS with this upgrade. Now elastic are officially providing images for ARM 64 but I'll continue to maintain this repo because I think it remain many people that are using 32 bits OS on their raspberrypi because it still the recommended version of the raspberrypi OS by the raspberrypi foundation, the ARM64 version is still in beta. Of course I also tested those image on manjaro for ARM64 and it also working pretty fine.

1 Like