[优化]etcd、node-exporter、prometheus的dockerfile部署优化

This commit is contained in:
2024-09-14 14:08:33 +08:00
committed by Coding
parent 9243c4a797
commit 67d027f49f
4 changed files with 68 additions and 25 deletions

View File

@@ -1,13 +1,28 @@
FROM openeuler/openeuler:24.03
# 根据平台执行不同的安装步骤
RUN architecture=$(uname -m); \
if [ "$architecture" = "aarch64" ]; then \
echo "install ARM64 ETCD"; \
elif [ "$architecture" = "x86_64" ]; then \
echo "install x86_64 ETCD"; \
else \
echo "platform [$architecture] not support"; \
exit 1; \
fi
# 安装和清理
RUN dnf update -y \
&& dnf install etcd -y \
&& dnf clean all \
&& rm -rf /var/cache/dnf/*
# 设置环境变量
ENV ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379" \
ETCD_ADVERTISE_CLIENT_URLS="http://127.0.0.1:2379"
ETCD_ADVERTISE_CLIENT_URLS="http://127.0.0.1:2379"
# 暴露端口
EXPOSE 2379 2380
CMD ["etcd"]
# 运行 etcd
CMD ["etcd"]