Files
qiming/qiming-rcoder/docker/rcoder-agent-runner/Dockerfile.test-full
2026-06-01 13:54:52 +08:00

56 lines
2.5 KiB
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ============================================================================
# 完整测试 Dockerfile - 验证 Pyroscope + Off-CPU 工具安装
# ============================================================================
FROM debian:12
WORKDIR /test
# ============================================================================
# 测试参数传递
# ============================================================================
ARG INSTALL_EBPF_TOOLS=true
ARG INSTALL_PYROSCOPE=true
RUN echo "🔍 INSTALL_EBPF_TOOLS = [$INSTALL_EBPF_TOOLS]"
RUN echo "🔍 INSTALL_PYROSCOPE = [$INSTALL_PYROSCOPE]"
# ============================================================================
# 测试 Pyroscope Agent 安装
# ============================================================================
RUN if [ "$INSTALL_PYROSCOPE" = "true" ]; then \
echo "📦 安装 Pyroscope Agent..."; \
apt-get update && \
apt-get install -y curl ca-certificates && \
echo "下载 Pyroscope Agent (v1.17.0)..." && \
curl -fsSL "https://github.com/grafana/pyroscope/releases/download/v1.17.0/pyroscope_1.17.0_linux_arm64.tar.gz" \
-o /tmp/pyroscope.tar.gz && \
echo "解压 Pyroscope Agent..." && \
tar -xzf /tmp/pyroscope.tar.gz -C /usr/local/bin/ && \
rm /tmp/pyroscope.tar.gz && \
chmod +x /usr/local/bin/pyroscope && \
echo "验证 Pyroscope Agent..." && \
pyroscope --version || echo "⚠️ Pyroscope 安装失败"; \
else \
echo "⚠️ Pyroscope 未安装"; \
fi
# ============================================================================
# 测试 bpfcc-tools 安装(包含 offcputime
# ============================================================================
RUN if [ "$INSTALL_EBPF_TOOLS" = "true" ]; then \
echo "📦 安装 bpfcc-tools (包含 offcputime)..."; \
apt-get update && \
apt-get install -y bpfcc-tools && \
rm -rf /var/lib/apt/lists/* && \
which offcputime-bpfcc && offcputime-bpfcc --help | head -3 || echo "⚠️ offcputime-bpfcc 安装失败"; \
fi
# ============================================================================
# 最终验证
# ============================================================================
RUN echo "=== 最终验证 ===" && \
which pyroscope && echo "✅ pyroscope 已安装" || echo "❌ pyroscope 未安装" && \
which offcputime-bpfcc && echo "✅ offcputime-bpfcc 已安装" || echo "❌ offcputime-bpfcc 未安装"
CMD ["/bin/bash"]