feat: 增强容器检测

This commit is contained in:
Akizon77
2025-08-28 12:45:27 +08:00
parent d1735e3481
commit 54c41c1cd4
2 changed files with 5 additions and 1 deletions

View File

@@ -10,6 +10,8 @@ COPY komari-agent-${TARGETOS}-${TARGETARCH} /app/komari-agent
RUN chmod +x /app/komari-agent
RUN touch /.komari-agent-container
ENTRYPOINT ["/app/komari-agent"]
# 运行时请指定参数
# Please specify parameters at runtime.

View File

@@ -84,7 +84,9 @@ func detectContainer() string {
if s := parseCgroupForContainer(); s != "" {
return s
}
if fileExists("/.komari-agent-container") {
return "container"
}
// (Removed mountinfo heuristics which caused host false positives when Docker/Kube tools are installed.)
return ""
}