[优化]etcd、node-exporter、prometheus的dockerfile部署优化
This commit is contained in:
@@ -1,24 +1,46 @@
|
||||
FROM openeuler/openeuler:24.03
|
||||
|
||||
RUN dnf update -y && \
|
||||
dnf install -y supervisor && \
|
||||
dnf clean all && \
|
||||
dnf install -y supervisor &&\
|
||||
rm -rf /var/cache/dnf/*
|
||||
|
||||
RUN curl -fsSL https://github.com/prometheus/prometheus/releases/download/v2.54.0/prometheus-2.54.0.linux-amd64.tar.gz | tar -xz -C /usr/local/bin && \
|
||||
mv /usr/local/bin/prometheus-*/prometheus /usr/local/bin/prometheus && \
|
||||
rm /usr/local/bin/prometheus-* -rf && \
|
||||
chmod +x /usr/local/bin/prometheus
|
||||
RUN architecture=$(uname -m); \
|
||||
if [ "$architecture" = "aarch64" ]; then \
|
||||
echo "install ARM64 prometheus"; \
|
||||
curl -fsSL --retry 3 https://github.com/prometheus/prometheus/releases/download/v2.54.0/prometheus-2.54.0.linux-arm64.tar.gz | tar -xz -C /usr/local/bin && \
|
||||
mv /usr/local/bin/prometheus-*/prometheus /usr/local/bin/prometheus && \
|
||||
rm /usr/local/bin/prometheus-* -rf && \
|
||||
chmod +x /usr/local/bin/prometheus; \
|
||||
elif [ "$architecture" = "x86_64" ]; then \
|
||||
echo "install x86_64 prometheus"; \
|
||||
curl -fsSL --retry 3 https://github.com/prometheus/prometheus/releases/download/v2.54.0/prometheus-2.54.0.linux-amd64.tar.gz | tar -xz -C /usr/local/bin && \
|
||||
mv /usr/local/bin/prometheus-*/prometheus /usr/local/bin/prometheus && \
|
||||
rm /usr/local/bin/prometheus-* -rf && \
|
||||
chmod +x /usr/local/bin/prometheus; \
|
||||
else \
|
||||
echo "platform [$architecture] not supported"; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
RUN curl -fsSL https://github.com/abtreece/confd/releases/download/v0.20.0/confd-v0.20.0-linux-amd64.tar.gz | tar -xz -C /usr/local/bin && \
|
||||
chmod +x /usr/local/bin/confd
|
||||
RUN architecture=$(uname -m); \
|
||||
if [ "$architecture" = "aarch64" ]; then \
|
||||
echo "install ARM64 confd"; \
|
||||
curl -fsSL --retry 3 https://github.com/abtreece/confd/releases/download/v0.20.0/confd-v0.20.0-linux-arm64.tar.gz | tar -xz -C /usr/local/bin && \
|
||||
chmod +x /usr/local/bin/confd; \
|
||||
elif [ "$architecture" = "x86_64" ]; then \
|
||||
echo "install x86_64 confd"; \
|
||||
curl -fsSL --retry 3 https://github.com/abtreece/confd/releases/download/v0.20.0/confd-v0.20.0-linux-amd64.tar.gz | tar -xz -C /usr/local/bin && \
|
||||
chmod +x /usr/local/bin/confd; \
|
||||
else \
|
||||
echo "platform [$architecture] not supported"; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
RUN mkdir /etc/prometheus/
|
||||
|
||||
COPY ./confd/ /etc/confd/
|
||||
|
||||
COPY prometheus.yml /etc/prometheus/prometheus.yml
|
||||
|
||||
COPY ./supervisord/ /etc/supervisord/
|
||||
|
||||
CMD [ "supervisord", "-c", "/etc/supervisord/supervisord.conf" ]
|
||||
|
||||
Reference in New Issue
Block a user