@cryptotaxi247 / netdata-1 / commits / fc7f7be30

Improve container detection logic for edit-config. (#16825)

Austin S. Hemmelgarn committed Jan 22, 2024 at 10:32 UTC fc7f7be30248093275e06b76d5f55ad0a8fcad5c
1 file changed +3 -1
system/edit-config
+3 -1
@@ -112,8 +112,10 @@ check_editor() {
112 running_in_container() {
113 [ -e /.dockerenv ] && return 0
114 [ -e /.dockerinit ] && return 0
115 - [ -r /proc/1/environ ] && tr '\000' '\n' </proc/1/environ | grep -Eiq '^container=podman' && return 0
115 + [ -e /run/.containerenv ] && return 0
116 + [ -r /proc/1/environ ] && tr '\000' '\n' </proc/1/environ | grep -Eiq 'container=' && return 0
117 grep -qF -e /docker/ -e /libpod- /proc/self/cgroup 2>/dev/null && return 0
118 + return 1
119 }
120
121 get_docker_command() {