uxc: add JSON output option for 'list' command
[project/procd.git] / container.h
index d33fa3266dc09e627ace4f8397796ad018d853b2..dede69632dfc7435d0c6430059499e01db3e96f4 100644 (file)
 
 #include <stdlib.h>
 #include <stdbool.h>
+#include <sys/stat.h>
 
 static inline bool is_container() {
-       return !!getenv("container");
+       struct stat s;
+       int r = stat("/.dockerenv", &s);
+       int pv_r = stat("/pantavisor", &s);
+       return !!getenv("container") || r == 0 || pv_r == 0;
 }
 
 #endif