[#14] build 构建融合metric镜像,移除测试节点镜像,直接使用基础镜像
This commit is contained in:
@@ -2,6 +2,18 @@ FROM grafana/grafana:11.1.0
|
||||
|
||||
USER root
|
||||
|
||||
# 构建参数:是否使用内网镜像
|
||||
ARG USE_INTRANET=false
|
||||
|
||||
# 根据是否为内网构建切换 apk 源
|
||||
RUN if [ "$USE_INTRANET" = "true" ]; then \
|
||||
echo "Configuring intranet apk repositories..." && \
|
||||
sed -i 's#https\?://[^/]\+#http://10.68.64.1#g' /etc/apk/repositories; \
|
||||
else \
|
||||
echo "Configuring public apk repositories..." && \
|
||||
sed -i 's#https\?://[^/]\+#https://mirrors.aliyun.com#g' /etc/apk/repositories; \
|
||||
fi
|
||||
|
||||
# 安装必要的工具
|
||||
RUN apk add --no-cache \
|
||||
supervisor \
|
||||
@@ -10,6 +22,11 @@ RUN apk add --no-cache \
|
||||
vim \
|
||||
bash
|
||||
|
||||
# 部署镜像时恢复到部署侧使用的内网镜像源
|
||||
RUN if [ "$USE_INTRANET" = "true" ]; then \
|
||||
sed -i 's#https\?://[^/]\+#https://10.92.132.52/mirrors#g' /etc/apk/repositories; \
|
||||
fi
|
||||
|
||||
# supervisor 日志目录
|
||||
RUN mkdir -p /var/log/supervisor
|
||||
|
||||
|
||||
Reference in New Issue
Block a user