1 Star 0 Fork 1

AliyunContainerService / node_exporter

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
test_image.sh 606 Bytes
一键复制 编辑 原始数据 按行查看 历史
#!/bin/bash
set -exo pipefail
docker_image=$1
port=$2
container_id=''
wait_start() {
for in in {1..10}; do
if /usr/bin/curl -s -m 5 -f "http://localhost:${port}/metrics" > /dev/null; then
docker_cleanup
exit 0
else
sleep 1
fi
done
exit 1
}
docker_start() {
container_id=$(docker run -d -p "${port}":"${port}" "${docker_image}")
}
docker_cleanup() {
docker kill "${container_id}"
}
if [[ "$#" -ne 2 ]] ; then
echo "Usage: $0 quay.io/prometheus/node-exporter:v0.13.0 9100" >&2
exit 1
fi
docker_start
wait_start
Go
1
https://gitee.com/AliyunContainerService/node_exporter.git
git@gitee.com:AliyunContainerService/node_exporter.git
AliyunContainerService
node_exporter
node_exporter
master

搜索帮助