This commit is contained in:
12600k-rog-d4
2026-08-24 00:35:30 +08:00
parent 32b308bc08
commit b673ed62f9
24 changed files with 483 additions and 393 deletions

View File

@@ -0,0 +1,45 @@
# 压力测试工具镜像
#
# 用途:为 auto-check 提供预装压测工具的容器环境
# 优势:工具预装在镜像中,无需在线安装,环境一致性好,适合国内网络环境
#
# 工作流程:
# 1. auto-check 检测目标机器的 Docker 可用性
# 2. 从 Registry 拉取镜像(或本地已存在则跳过)
# 3. 启动容器执行测试(脚本已打包在镜像中)
# 4. 收集测试结果并解析
#
# 构建命令:
# cd docker/stress-test
# docker build -t your-registry/stress-test:latest .
# docker push your-registry/stress-test:latest
#
# 使用方式(在 auto-check.yaml 中配置):
# stress:
# use_docker: true
# docker_image: "your-registry/stress-test:latest"
FROM debian:12-slim
# 清理缓存,减少镜像体积
RUN apt-get update && apt-get install -y --no-install-recommends \
stress-ng \
fio \
lm-sensors \
sysstat \
procps \
&& rm -rf /var/lib/apt/lists/*
# 验证工具安装
RUN stress-ng --version && fio --version && sensors --version
# 复制测试脚本到镜像中
COPY scripts/ /scripts/
# 设置脚本执行权限
RUN chmod +x /scripts/*.sh
WORKDIR /tmp
# 默认执行入口(由 auto-check 传入脚本参数)
ENTRYPOINT ["/bin/bash", "/scripts/run.sh"]