27 lines
1.2 KiB
Docker
27 lines
1.2 KiB
Docker
FROM openeuler/openeuler:24.03
|
|
|
|
RUN dnf update -y && \
|
|
dnf clean all && \
|
|
rm -rf /var/cache/dnf/*
|
|
# 根据平台执行不同的安装步骤
|
|
RUN architecture=$(uname -m); \
|
|
if [ "$architecture" = "aarch64" ]; then \
|
|
echo "install ARM64 node_exporter"; \
|
|
curl -fsSL https://github.com/prometheus/node_exporter/releases/download/v1.8.2/node_exporter-1.8.2.linux-arm64.tar.gz | tar -xz -C /usr/local/bin && \
|
|
mv /usr/local/bin/node_exporter-*/node_exporter /usr/local/bin/node_exporter && \
|
|
rm /usr/local/bin/node_exporter-* -rf && \
|
|
chmod +x /usr/local/bin/node_exporter; \
|
|
elif [ "$architecture" = "x86_64" ]; then \
|
|
echo "install x86_64 node_exporter"; \
|
|
curl -fsSL https://github.com/prometheus/node_exporter/releases/download/v1.8.2/node_exporter-1.8.2.linux-amd64.tar.gz | tar -xz -C /usr/local/bin && \
|
|
mv /usr/local/bin/node_exporter-*/node_exporter /usr/local/bin/node_exporter && \
|
|
rm /usr/local/bin/node_exporter-* -rf && \
|
|
chmod +x /usr/local/bin/node_exporter; \
|
|
else \
|
|
echo "Platform [$architecture] not supported"; \
|
|
exit 1; \
|
|
fi
|
|
|
|
RUN mkdir /host
|
|
|
|
CMD ["node_exporter","--path.rootfs=/host","--web.listen-address=0.0.0.0:9100"] |