Create a container image for arm64 of Kibana and register it in GitHub Container Registry. Start Elastic Stack with Docker Compose on Raspberry Pi 4 (64bit)

I released a container image of Kibana for arm64. Please use it if you like.

ghcr.io/moritalous/ghcr/kibana-arm64

Dockerfile for arm64

Kibana doesn't work on arm64 because the release file contains the entire Node.js executable binary, which is for x64. So, replace the Node.js execution binary (under / usr / share / kibana / node) with the one of arm64.

Also change dumb-init to the arm64 version.

The source is the official Dockerfile published on GitHub.

#
# ** THIS IS AN AUTO-GENERATED FILE **
#

################################################################################
# Build stage 0
# Extract Kibana and make various file manipulations.
################################################################################
FROM centos:7 AS prep_files
# Add tar and gzip
RUN yum update -y && yum install -y tar gzip && yum clean all
RUN cd /opt && curl --retry 8 -s -L -O https://artifacts.elastic.co/downloads/kibana/kibana-7.9.1-linux-x86_64.tar.gz && cd -
RUN mkdir /usr/share/kibana
WORKDIR /usr/share/kibana
RUN tar --strip-components=1 -zxf /opt/kibana-7.9.1-linux-x86_64.tar.gz
+ 
+ RUN cd /opt && curl --retry 8 -s -L -O https://nodejs.org/dist/v10.22.0/node-+v10.22.0-linux-arm64.tar.gz && cd -
+ RUN rm -rf /usr/share/kibana/node
+ RUN mkdir /usr/share/kibana/node
+ RUN cd /usr/share/kibana/node && tar --strip-components=1 -zxf /opt/node-v10.22.0-linux-arm64.tar.gz && cd -

# Ensure that group permissions are the same as user permissions.
# This will help when relying on GID-0 to run Kibana, rather than UID-1000.
# OpenShift does this, for example.
# REF: https://docs.openshift.org/latest/creating_images/guidelines.html
RUN chmod -R g=u /usr/share/kibana
RUN find /usr/share/kibana -type d -exec chmod g+s {} \;

################################################################################
# Build stage 1
# Copy prepared files from the previous stage and complete the image.
################################################################################
FROM centos:7
EXPOSE 5601

# Add Reporting dependencies.
RUN yum update -y && yum install -y fontconfig freetype shadow-utils && yum clean all

# Add an init process, check the checksum to make sure it's a match
- RUN curl -L -o /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_amd64
- RUN echo "37f2c1f0372a45554f1b89924fbb134fc24c3756efaedf11e07f599494e0eff9  /usr/local/bin/dumb-init" | sha256sum -c -
+ RUN curl -L -o /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_arm64
+ RUN echo "45b1bbf56cc03edda81e4220535a025bfe3ed6e93562222b9be4471005b3eeb3  /usr/local/bin/dumb-init" | sha256sum -c -
RUN chmod +x /usr/local/bin/dumb-init


# Bring in Kibana from the initial stage.
COPY --from=prep_files --chown=1000:0 /usr/share/kibana /usr/share/kibana
WORKDIR /usr/share/kibana
RUN ln -s /usr/share/kibana /opt/kibana

ENV ELASTIC_CONTAINER true
ENV PATH=/usr/share/kibana/bin:$PATH

# Set some Kibana configuration defaults.
COPY --chown=1000:0 config/kibana.yml /usr/share/kibana/config/kibana.yml

# Add the launcher/wrapper script. It knows how to interpret environment
# variables and translate them to Kibana CLI options.
COPY --chown=1000:0 bin/kibana-docker /usr/local/bin/

# Ensure gid 0 write permissions for OpenShift.
RUN chmod g+ws /usr/share/kibana && find /usr/share/kibana -gid 0 -and -not -perm /g+w -exec chmod g+w {} \;

# Remove the suid bit everywhere to mitigate "Stack Clash"
RUN find / -xdev -perm -4000 -exec chmod u-s {} +

# Provide a non-root user to run the process.
RUN groupadd --gid 1000 kibana && useradd --uid 1000 --gid 1000 --home-dir /usr/share/kibana --no-create-home kibana
USER kibana

LABEL org.label-schema.schema-version="1.0" org.label-schema.vendor="Elastic" org.label-schema.name="kibana" org.label-schema.version="7.9.1" org.label-schema.url="https://www.elastic.co/products/kibana" org.label-schema.vcs-url="https://github.com/elastic/kibana" org.label-schema.license="Elastic License" org.label-schema.usage="https://www.elastic.co/guide/en/kibana/index.html" org.label-schema.build-date="2020-09-01T22:38:56.015Z" license="Elastic License"

ENTRYPOINT ["/usr/local/bin/dumb-init", "--"]

CMD ["/usr/local/bin/kibana-docker"]

Build

docker build -t moritalous/kibana-arm64:7.9.1 .

Image confirmation

$ docker images
REPOSITORY                                      TAG                 IMAGE ID            CREATED             SIZE
moritalous/kibana-arm64                         7.9.1               96c8b0365e7e        About an hour ago   1.29GB
$ 

Register with GitHub Container Registry

Follow the official procedure.

Log in

cat TOKEN.txt | docker login ghcr.io -u [USERNAME] --password-stdin

Tag

docker tag 96c8b0365e7e ghcr.io/moritalous/ghcr/kibana-arm64:7.9.1

push

docker push ghcr.io/moritalous/ghcr/kibana-arm64

Docker Compose

https://www.elastic.co/guide/en/elastic-stack-get-started/current/get-started-docker.html をほぼそのまま利用します。違うのはKibanaのコンテナイメージがghcr.io/moritalous/ghcr/kibana-arm64:7.9.1となるだけです。

Don't forget the following settings.

sysctl -w vm.max_map_count=262144

https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html

Recommended Posts

Create a container image for arm64 of Kibana and register it in GitHub Container Registry. Start Elastic Stack with Docker Compose on Raspberry Pi 4 (64bit)
Create a Docker Image for redoc-cli and register it on Docker Hub
Create a Kibana container image for ARM64 (Raspberry Pi/Mac M1)
Create a Java (Gradle) project with VS Code and develop it on a Docker container
Create a Java (Maven) project with VS Code and develop it on a Docker container
The story of pushing a Docker container to GitHub Package Registry and Docker Hub with GitHub Actions
Build a NAS with DLNA function at the speed of a second with Raspberry Pi and Docker Compose
2. Create Docker image and register Registry
Graph the sensor information of Raspberry Pi in Java and check it with a web browser
Starting with installing Docker on EC2 and running Yellowfin in a container
Create a Docker container for your development web server in Ansible on MacOS
Install Docker on Raspberry Pi 4 and Raspberry Pi OS 64bit
Maybe it works! Create an image with Docker and share it!
[Docker] Build a site on Hugo and publish it on GitHub
Getting Started with GitHub Container Registry instead of Docker Hub
I created a Docker image of a container for learning OpenAI Gym
Summary of steps for developing in Docker container with VS Code
Minimal Workflow to push Docker image to Github Container Registry with Github Actions
Image Spring Boot app using jib-maven-plugin and start it with Docker
Push the Docker Image distributed by Docker Hub to Google Container Registry and start the VM based on that Image