I don't have an ARM64 container image for Kibana, so I made it myself, but I'm happy to say that a tarball version of ARM64 has been provided, so I'll use it to create a container image.
Raspberry Pi 4B (RAM 4GB)
RaspiOS 64bit (Buster) --podman (docker is also acceptable)
Mac mini 2020 Apple M1 (RAM 16GB)
macOS Big Sur 11.1
Docker 2.10.1 AppleSilicon Preview7
Since the elastic docker file is published on github, I will clone it.
python
# git clone --depth=1 -b 7.10 https://github.com/elastic/dockerfiles
Cloning into 'dockerfiles'...
remote: Enumerating objects: 30, done.
remote: Counting objects: 100% (30/30), done.
remote: Compressing objects: 100% (23/23), done.
remote: Total 30 (delta 0), reused 17 (delta 0), pack-reused 0
Unpacking objects: 100% (30/30), done.
Edit the Dockerfile for ARM64.
python
# cd dockerfiles/kibana/
~/dockerfiles/kibana# cp Dockerfile Dockerfile.org
~/dockerfiles/kibana# vi Dockerfile
~/dockerfiles/kibana# diff Dockerfile Dockerfile.org
16c16
< curl --retry 8 -s -L -O https://artifacts.elastic.co/downloads/kibana/kibana-7.10.1-linux-aarch64.tar.gz && \
---
> curl --retry 8 -s -L -O https://artifacts.elastic.co/downloads/kibana/kibana-7.10.1-linux-x86_64.tar.gz && \
22c22
< RUN tar --strip-components=1 -zxf /opt/kibana-7.10.1-linux-aarch64.tar.gz
---
> RUN tar --strip-components=1 -zxf /opt/kibana-7.10.1-linux-x86_64.tar.gz
43c43
< fontconfig freetype shadow-utils nss && \
---
> fontconfig freetype shadow-utils libnss3.so && \
50,51c50,51
< 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_aarch64
< RUN echo "45b1bbf56cc03edda81e4220535a025bfe3ed6e93562222b9be4471005b3eeb3 /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_amd64
> RUN echo "37f2c1f0372a45554f1b89924fbb134fc24c3756efaedf11e07f599494e0eff9 /usr/local/bin/dumb-init" | sha256sum -c -
Then build. It takes a lot of time because I chmod a lot of files. Also, the times are podman. (It can be docker)
python
~/dockerfiles/kibana# podman build -t kibana:7.10.1 .
STEP 1: FROM centos:8 AS builder
STEP 2: RUN cd /opt && curl --retry 8 -s -L -O https://artifacts.elastic.co/downloads/kibana/kibana-7.10.1-linux-aarch64.tar.gz && cd -
/
--> 19830fe514e
STEP 3: RUN mkdir /usr/share/kibana
--> 0a09e9dffcc
STEP 4: WORKDIR /usr/share/kibana
--> 4ef0fa15c55
STEP 5: RUN tar --strip-components=1 -zxf /opt/kibana-7.10.1-linux-aarch64.tar.gz
--> c25c4684458
STEP 6: RUN chmod -R g=u /usr/share/kibana
--> 1dd443d53d0
STEP 7: RUN find /usr/share/kibana -type d -exec chmod g+s {} \;
--> 3ff7718b298
STEP 8: FROM centos:8
STEP 9: EXPOSE 5601
--> 14b28faf60f
STEP 10: RUN for iter in {1..10}; do yum update --setopt=tsflags=nodocs -y && yum install --setopt=tsflags=nodocs -y fontconfig freetype shadow-utils nss && yum clean all && exit_code=0 && break || exit_code=$? && echo "yum error: retry $iter in 10s" && sleep 10; done; (exit $exit_code)
CentOS Linux 8 - AppStream 4.7 MB/s | 5.3 MB 00:01
CentOS Linux 8 - BaseOS 2.2 MB/s | 1.9 MB 00:00
CentOS Linux 8 - Extras 3.3 kB/s | 8.6 kB 00:02
Last metadata expiration check: 0:00:01 ago on Tue Jan 5 01:43:32 2021.
Dependencies resolved.
Nothing to do.
Complete!
Last metadata expiration check: 0:00:03 ago on Tue Jan 5 01:43:32 2021.
Package shadow-utils-2:4.6-11.el8.aarch64 is already installed.
Dependencies resolved.
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
fontconfig aarch64 2.13.1-3.el8 baseos 273 k
freetype aarch64 2.9.1-4.el8_3.1 baseos 370 k
nss aarch64 3.53.1-11.el8_2 appstream 682 k
Installing dependencies:
crypto-policies-scripts noarch 20200713-1.git51d1222.el8 baseos 67 k
dejavu-fonts-common noarch 2.35-6.el8 baseos 74 k
dejavu-sans-fonts noarch 2.35-6.el8 baseos 1.5 M
file aarch64 5.33-16.el8 baseos 77 k
fontpackages-filesystem noarch 1.44-22.el8 baseos 16 k
gettext aarch64 0.19.8.1-17.el8 baseos 1.1 M
gettext-libs aarch64 0.19.8.1-17.el8 baseos 296 k
grub2-common noarch 1:2.02-90.el8 baseos 884 k
grub2-tools aarch64 1:2.02-90.el8 baseos 1.8 M
grub2-tools-minimal aarch64 1:2.02-90.el8 baseos 194 k
libcroco aarch64 0.6.12-4.el8_2.1 baseos 108 k
libgomp aarch64 8.3.1-5.1.el8 baseos 196 k
libpng aarch64 2:1.6.34-5.el8 baseos 119 k
nspr aarch64 4.25.0-2.el8_2 appstream 135 k
nss-softokn aarch64 3.53.1-11.el8_2 appstream 466 k
nss-softokn-freebl aarch64 3.53.1-11.el8_2 appstream 263 k
nss-sysinit aarch64 3.53.1-11.el8_2 appstream 71 k
nss-util aarch64 3.53.1-11.el8_2 appstream 131 k
os-prober aarch64 1.74-6.el8 baseos 55 k
which aarch64 2.21-12.el8 baseos 48 k
Installing weak dependencies:
grubby aarch64 8.40-41.el8 baseos 49 k
Transaction Summary
================================================================================
Install 24 Packages
Total download size: 8.8 M
Installed size: 36 M
Downloading Packages:
(1/24): nspr-4.25.0-2.el8_2.aarch64.rpm 1.4 MB/s | 135 kB 00:00
(2/24): nss-softokn-freebl-3.53.1-11.el8_2.aarc 3.6 MB/s | 263 kB 00:00
(3/24): nss-3.53.1-11.el8_2.aarch64.rpm 3.5 MB/s | 682 kB 00:00
(4/24): nss-sysinit-3.53.1-11.el8_2.aarch64.rpm 2.7 MB/s | 71 kB 00:00
(5/24): nss-util-3.53.1-11.el8_2.aarch64.rpm 4.9 MB/s | 131 kB 00:00
(6/24): nss-softokn-3.53.1-11.el8_2.aarch64.rpm 2.0 MB/s | 466 kB 00:00
(7/24): crypto-policies-scripts-20200713-1.git5 1.2 MB/s | 67 kB 00:00
(8/24): dejavu-fonts-common-2.35-6.el8.noarch.r 1.5 MB/s | 74 kB 00:00
(9/24): file-5.33-16.el8.aarch64.rpm 2.2 MB/s | 77 kB 00:00
(10/24): fontpackages-filesystem-1.44-22.el8.no 939 kB/s | 16 kB 00:00
(11/24): fontconfig-2.13.1-3.el8.aarch64.rpm 2.9 MB/s | 273 kB 00:00
(12/24): freetype-2.9.1-4.el8_3.1.aarch64.rpm 3.0 MB/s | 370 kB 00:00
(13/24): gettext-libs-0.19.8.1-17.el8.aarch64.r 2.8 MB/s | 296 kB 00:00
(14/24): dejavu-sans-fonts-2.35-6.el8.noarch.rp 4.4 MB/s | 1.5 MB 00:00
(15/24): gettext-0.19.8.1-17.el8.aarch64.rpm 3.7 MB/s | 1.1 MB 00:00
(16/24): grub2-tools-minimal-2.02-90.el8.aarch6 2.3 MB/s | 194 kB 00:00
(17/24): grub2-common-2.02-90.el8.noarch.rpm 4.2 MB/s | 884 kB 00:00
(18/24): grubby-8.40-41.el8.aarch64.rpm 1.1 MB/s | 49 kB 00:00
(19/24): libcroco-0.6.12-4.el8_2.1.aarch64.rpm 2.0 MB/s | 108 kB 00:00
(20/24): libpng-1.6.34-5.el8.aarch64.rpm 2.4 MB/s | 119 kB 00:00
(21/24): libgomp-8.3.1-5.1.el8.aarch64.rpm 2.5 MB/s | 196 kB 00:00
(22/24): os-prober-1.74-6.el8.aarch64.rpm 1.9 MB/s | 55 kB 00:00
(23/24): which-2.21-12.el8.aarch64.rpm 1.3 MB/s | 48 kB 00:00
(24/24): grub2-tools-2.02-90.el8.aarch64.rpm 5.2 MB/s | 1.8 MB 00:00
--------------------------------------------------------------------------------
Total 4.1 MB/s | 8.8 MB 00:02
warning: /var/cache/dnf/appstream-37e43cd1a3e4f490/packages/nspr-4.25.0-2.el8_2.aarch64.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY
CentOS Linux 8 - AppStream 1.2 MB/s | 1.6 kB 00:00
Importing GPG key 0x8483C65D:
Userid : "CentOS (CentOS Official Signing Key) <[email protected]>"
Fingerprint: 99DB 70FA E1D7 CE22 7FB6 4882 05B5 55B3 8483 C65D
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : nspr-4.25.0-2.el8_2.aarch64 1/24
Running scriptlet: nspr-4.25.0-2.el8_2.aarch64 1/24
Installing : nss-util-3.53.1-11.el8_2.aarch64 2/24
Installing : libgomp-8.3.1-5.1.el8.aarch64 3/24
Running scriptlet: libgomp-8.3.1-5.1.el8.aarch64 3/24
Installing : libcroco-0.6.12-4.el8_2.1.aarch64 4/24
Running scriptlet: libcroco-0.6.12-4.el8_2.1.aarch64 4/24
Installing : grub2-common-1:2.02-90.el8.noarch 5/24
Installing : fontpackages-filesystem-1.44-22.el8.noarch 6/24
Installing : dejavu-fonts-common-2.35-6.el8.noarch 7/24
Installing : dejavu-sans-fonts-2.35-6.el8.noarch 8/24
Installing : gettext-libs-0.19.8.1-17.el8.aarch64 9/24
Installing : gettext-0.19.8.1-17.el8.aarch64 10/24
Running scriptlet: gettext-0.19.8.1-17.el8.aarch64 10/24
install-info: No such file or directory for /usr/share/info/gettext.info.gz
Installing : grub2-tools-minimal-1:2.02-90.el8.aarch64 11/24
Installing : nss-softokn-freebl-3.53.1-11.el8_2.aarch64 12/24
Installing : nss-softokn-3.53.1-11.el8_2.aarch64 13/24
Installing : which-2.21-12.el8.aarch64 14/24
Installing : os-prober-1.74-6.el8.aarch64 15/24
Installing : libpng-2:1.6.34-5.el8.aarch64 16/24
Installing : freetype-2.9.1-4.el8_3.1.aarch64 17/24
Installing : file-5.33-16.el8.aarch64 18/24
Running scriptlet: grub2-tools-1:2.02-90.el8.aarch64 19/24
Installing : grub2-tools-1:2.02-90.el8.aarch64 19/24
Running scriptlet: grub2-tools-1:2.02-90.el8.aarch64 19/24
install-info: No such file or directory for /usr/share/info/grub2.info.gz
install-info: No such file or directory for /usr/share/info/grub2-dev.info.gz
Installing : grubby-8.40-41.el8.aarch64 20/24
Installing : crypto-policies-scripts-20200713-1.git51d1222.el8. 21/24
Installing : nss-3.53.1-11.el8_2.aarch64 22/24
Installing : nss-sysinit-3.53.1-11.el8_2.aarch64 23/24
Installing : fontconfig-2.13.1-3.el8.aarch64 24/24
Running scriptlet: fontconfig-2.13.1-3.el8.aarch64 24/24
Running scriptlet: crypto-policies-scripts-20200713-1.git51d1222.el8. 24/24
Running scriptlet: nss-3.53.1-11.el8_2.aarch64 24/24
Running scriptlet: fontconfig-2.13.1-3.el8.aarch64 24/24
Verifying : nspr-4.25.0-2.el8_2.aarch64 1/24
Verifying : nss-3.53.1-11.el8_2.aarch64 2/24
Verifying : nss-softokn-3.53.1-11.el8_2.aarch64 3/24
Verifying : nss-softokn-freebl-3.53.1-11.el8_2.aarch64 4/24
Verifying : nss-sysinit-3.53.1-11.el8_2.aarch64 5/24
Verifying : nss-util-3.53.1-11.el8_2.aarch64 6/24
Verifying : crypto-policies-scripts-20200713-1.git51d1222.el8. 7/24
Verifying : dejavu-fonts-common-2.35-6.el8.noarch 8/24
Verifying : dejavu-sans-fonts-2.35-6.el8.noarch 9/24
Verifying : file-5.33-16.el8.aarch64 10/24
Verifying : fontconfig-2.13.1-3.el8.aarch64 11/24
Verifying : fontpackages-filesystem-1.44-22.el8.noarch 12/24
Verifying : freetype-2.9.1-4.el8_3.1.aarch64 13/24
Verifying : gettext-0.19.8.1-17.el8.aarch64 14/24
Verifying : gettext-libs-0.19.8.1-17.el8.aarch64 15/24
Verifying : grub2-common-1:2.02-90.el8.noarch 16/24
Verifying : grub2-tools-1:2.02-90.el8.aarch64 17/24
Verifying : grub2-tools-minimal-1:2.02-90.el8.aarch64 18/24
Verifying : grubby-8.40-41.el8.aarch64 19/24
Verifying : libcroco-0.6.12-4.el8_2.1.aarch64 20/24
Verifying : libgomp-8.3.1-5.1.el8.aarch64 21/24
Verifying : libpng-2:1.6.34-5.el8.aarch64 22/24
Verifying : os-prober-1.74-6.el8.aarch64 23/24
Verifying : which-2.21-12.el8.aarch64 24/24
Installed:
crypto-policies-scripts-20200713-1.git51d1222.el8.noarch
dejavu-fonts-common-2.35-6.el8.noarch
dejavu-sans-fonts-2.35-6.el8.noarch
file-5.33-16.el8.aarch64
fontconfig-2.13.1-3.el8.aarch64
fontpackages-filesystem-1.44-22.el8.noarch
freetype-2.9.1-4.el8_3.1.aarch64
gettext-0.19.8.1-17.el8.aarch64
gettext-libs-0.19.8.1-17.el8.aarch64
grub2-common-1:2.02-90.el8.noarch
grub2-tools-1:2.02-90.el8.aarch64
grub2-tools-minimal-1:2.02-90.el8.aarch64
grubby-8.40-41.el8.aarch64
libcroco-0.6.12-4.el8_2.1.aarch64
libgomp-8.3.1-5.1.el8.aarch64
libpng-2:1.6.34-5.el8.aarch64
nspr-4.25.0-2.el8_2.aarch64
nss-3.53.1-11.el8_2.aarch64
nss-softokn-3.53.1-11.el8_2.aarch64
nss-softokn-freebl-3.53.1-11.el8_2.aarch64
nss-sysinit-3.53.1-11.el8_2.aarch64
nss-util-3.53.1-11.el8_2.aarch64
os-prober-1.74-6.el8.aarch64
which-2.21-12.el8.aarch64
Complete!
21 files removed
--> f21d1615b18
STEP 11: 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_aarch64
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 647 100 647 0 0 1937 0 --:--:-- --:--:-- --:--:-- 1937
100 71256 100 71256 0 0 48838 0 0:00:01 0:00:01 --:--:-- 95645
--> 723e82b056a
STEP 12: RUN echo "45b1bbf56cc03edda81e4220535a025bfe3ed6e93562222b9be4471005b3eeb3 /usr/local/bin/dumb-init" | sha256sum -c -
/usr/local/bin/dumb-init: OK
--> 3febee5eb18
STEP 13: RUN chmod +x /usr/local/bin/dumb-init
--> bc0487b93b5
STEP 14: RUN mkdir /usr/share/fonts/local
--> 4ec111a772d
STEP 15: RUN curl -L -o /usr/share/fonts/local/NotoSansCJK-Regular.ttc https://github.com/googlefonts/noto-cjk/raw/NotoSansV2.001/NotoSansCJK-Regular.ttc
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 159 100 159 0 0 460 0 --:--:-- --:--:-- --:--:-- 459
100 19.3M 100 19.3M 0 0 5909k 0 0:00:03 0:00:03 --:--:-- 10.8M
--> a4ef4dfcb8a
STEP 16: RUN echo "5dcd1c336cc9344cb77c03a0cd8982ca8a7dc97d620fd6c9c434e02dcb1ceeb3 /usr/share/fonts/local/NotoSansCJK-Regular.ttc" | sha256sum -c -
/usr/share/fonts/local/NotoSansCJK-Regular.ttc: OK
--> 4b91efb6b5d
STEP 17: RUN fc-cache -v
/usr/share/fonts: skipping, existing cache is valid: 0 fonts, 2 dirs
/usr/share/fonts/dejavu: skipping, existing cache is valid: 9 fonts, 0 dirs
/usr/share/fonts/local: skipping, existing cache is valid: 10 fonts, 0 dirs
/usr/share/X11/fonts/Type1: skipping, no such directory
/usr/share/X11/fonts/TTF: skipping, no such directory
/usr/local/share/fonts: skipping, no such directory
/root/.local/share/fonts: skipping, no such directory
/root/.fonts: skipping, no such directory
/usr/share/fonts/dejavu: skipping, looped directory detected
/usr/share/fonts/local: skipping, looped directory detected
/usr/lib/fontconfig/cache: cleaning cache directory
/root/.cache/fontconfig: not cleaning non-existent cache directory
/root/.fontconfig: not cleaning non-existent cache directory
/usr/bin/fc-cache-64: succeeded
--> e799200b93c
STEP 18: COPY --from=builder --chown=1000:0 /usr/share/kibana /usr/share/kibana
--> 95d34b78229
STEP 19: WORKDIR /usr/share/kibana
--> af91a2e64e0
STEP 20: RUN ln -s /usr/share/kibana /opt/kibana
--> ff975005e0f
STEP 21: ENV ELASTIC_CONTAINER true
--> 913ef578b8c
STEP 22: ENV PATH=/usr/share/kibana/bin:$PATH
--> 10f708b5548
STEP 23: COPY --chown=1000:0 config/kibana.yml /usr/share/kibana/config/kibana.yml
--> 3f9ddd395b3
STEP 24: COPY --chown=1000:0 bin/kibana-docker /usr/local/bin/
--> d9a73a2b085
STEP 25: RUN chmod g+ws /usr/share/kibana && find /usr/share/kibana -gid 0 -and -not -perm /g+w -exec chmod g+w {} \;
--> d31ea9b1844
STEP 26: RUN find / -xdev -perm -4000 -exec chmod u-s {} +
--> a8808cae581
STEP 27: RUN groupadd --gid 1000 kibana && useradd --uid 1000 --gid 1000 --home-dir /usr/share/kibana --no-create-home kibana
--> f2bc3dd0ed3
STEP 28: LABEL org.label-schema.build-date="2020-12-05T02:04:38.350Z" org.label-schema.license="Elastic License" org.label-schema.name="Kibana" org.label-schema.schema-version="1.0" org.label-schema.url="https://www.elastic.co/products/kibana" org.label-schema.usage="https://www.elastic.co/guide/en/kibana/reference/index.html" org.label-schema.vcs-ref="608c5e5dd32659e8afadd520d0cdc58766ba505b" org.label-schema.vcs-url="https://github.com/elastic/kibana" org.label-schema.vendor="Elastic" org.label-schema.version="7.10.1" org.opencontainers.image.created="2020-12-05T02:04:38.350Z" org.opencontainers.image.documentation="https://www.elastic.co/guide/en/kibana/reference/index.html" org.opencontainers.image.licenses="Elastic License" org.opencontainers.image.revision="608c5e5dd32659e8afadd520d0cdc58766ba505b" org.opencontainers.image.source="https://github.com/elastic/kibana" org.opencontainers.image.title="Kibana" org.opencontainers.image.url="https://www.elastic.co/products/kibana" org.opencontainers.image.vendor="Elastic" org.opencontainers.image.version="7.10.1"
--> 1ce105128f5
STEP 29: USER kibana
--> c59ed1347f4
STEP 30: ENTRYPOINT ["/usr/local/bin/dumb-init", "--"]
--> 954ff1f374b
STEP 31: CMD ["/usr/local/bin/kibana-docker"]
STEP 32: COMMIT kibana:7.10.1
--> 434eac9bb86
434eac9bb866c223f31e7ba8e0ac715249ac18746a09cc6be727381ed04806fe
It's done.
python
~/dockerfiles/kibana# podman images
REPOSITORY TAG IMAGE ID CREATED SIZE
localhost/kibana 7.10.1 434eac9bb866 9 minutes ago 1.12 GB
We have confirmed that it can be built with the same Dockerfile on a Mac with M1. It takes more than 30 minutes, probably because it is the Preview version. (Double the Raspberry Pi ...)
Please refer to the official manual. https://www.elastic.co/guide/en/kibana/current/docker.html
I think you can set most of them with environment variables. For the environment variable name, change the variable name (variable name defined in the kibana configuration file) written in "kibana_vars" in bin/kibana-docker to all capital and change "." To "_". It seems that.
python
~/dockerfiles/kibana# cat bin/kibana-docker
:
kibana_vars=(
console.enabled
console.proxyConfig
console.proxyFilter
ops.cGroupOverrides.cpuPath
ops.cGroupOverrides.cpuAcctPath
cpu.cgroup.path.override
cpuacct.cgroup.path.override
csp.rules
csp.strict
csp.warnLegacyBrowsers
elasticsearch.customHeaders
elasticsearch.hosts
elasticsearch.logQueries
elasticsearch.password
elasticsearch.pingTimeout
elasticsearch.requestHeadersWhitelist
elasticsearch.requestTimeout
:
As an example of my environment, kubernetes deploys with yaml like below. For the time being, "NODE_OPTIONS" is also set.
python
# cat kibana.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: kibana
namespace: elastic
labels:
app: kibana
spec:
replicas: 1
selector:
matchLabels:
app: kibana
template:
metadata:
labels:
app: kibana
spec:
containers:
- name: kibana
image: localhost/kibana:7.10.1
resources:
requests:
cpu: 1
memory: 1Gi
limits:
cpu: 1
memory: 1.5Gi
env:
- name: SERVER_HOST
value: "0.0.0.0"
- name: I18N_LOCALE
value: "ja-JP"
- name: ELASTICSEARCH_URL
value: "http://elasticsearch:9200"
- name: ELASTICSEARCH_USERNAME
value: "kibana"
- name: ELASTICSEARCH_PASSWORD
value: "password"
- name: NODE_OPTIONS
value: "--max-old-space-size=1024"
ports:
- name: kibana
containerPort: 5601
I think that the free memory of the OS is the value of "limits.memory", the "Heap size Limit" of the "Memory Size (GB)" graph is also "1.0GB", and "NODE_OPTIONS" is effective.
It can be run on M1 Mac without any problems in combination with ARM64 version of elasticsearch.
I hope there will be more ARM64 container images.
Recommended Posts