mirror of
https://github.com/fankes/komari-agent.git
synced 2025-10-18 02:29:22 +08:00
feat: 增强容器检测
This commit is contained in:
@@ -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.
|
||||
|
@@ -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 ""
|
||||
}
|
||||
|
Reference in New Issue
Block a user