From: Paul Spooren Date: Mon, 27 May 2019 09:33:29 +0000 (+0200) Subject: procd: add docker support X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7f0f6b2a73f8;p=oweals%2Fprocd.git procd: add docker support detects if running in a docker container, which then requires special treatment of mounts. OpenWrt within Docker is useful for CI testing. Signed-off-by: Paul Spooren --- diff --git a/container.h b/container.h index d33fa32..dd2e432 100644 --- a/container.h +++ b/container.h @@ -16,9 +16,11 @@ #include #include +#include static inline bool is_container() { - return !!getenv("container"); + struct stat s; + return !!getenv("container") || !!stat("/.dockerenv", &s); } #endif