Skip to content

Commit cdad810

Browse files
committed
init commit
0 parents  commit cdad810

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM docker.io/bitnami/minideb:bullseye
2+
ENV HOME="/" \
3+
OS_ARCH="amd64" \
4+
OS_FLAVOUR="debian-11" \
5+
OS_NAME="linux"
6+
7+
COPY entrypoint.sh /entrypoint.sh
8+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
9+
# Install required system packages and dependencies
10+
RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list && install_packages ca-certificates curl wget
11+
RUN wget "https://rig-1258344699.cos.ap-guangzhou.myqcloud.com/prometheus-agent/prometheus-agent" -O /usr/bin/prometheus && \
12+
chmod +x /usr/bin/prometheus && \
13+
mkdir /etc/prometheus && chown -R 1001:1001 /etc/prometheus && \
14+
mkdir -p /var/queue && chown -R 1001:1001 /var/queue
15+
16+
EXPOSE 9090
17+
18+
WORKDIR /etc/prometheus
19+
USER 1001
20+
ENTRYPOINT [ "/bin/bash", "-c" ]
21+
CMD ["/entrypoint.sh"]

entrypoint.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[ -z "$instanceID" ] && echo "instanceID is empty" && exit 1
2+
[ -z "$agentID" ] && echo "agentID is empty" && exit 1
3+
[ -z "$region" ] && echo "region is empty" && exit 1
4+
[ -z "$secretID" ] && echo "secretID is empty" && exit 1
5+
[ -z "$secretKey" ] && echo "secretKey is empty" && exit 1
6+
7+
export TENCENTCLOUD_SECRET_ID=$secretID
8+
export TENCENTCLOUD_SECRET_KEY=$secretKey
9+
10+
/usr/bin/prometheus --agent.enable-sidecar --tencent.agent-id=${agentID} --tencent.instance-id=${instanceID} --tencent.endpoint=monitor.tencentcloudapi.com --tencent.region=${region} --config.file=/etc/prometheus/prometheus.yml

0 commit comments

Comments
 (0)