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 <mail@aparcar.org>
#include <stdlib.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdbool.h>
static inline bool is_container() {
static inline bool is_container() {
- return !!getenv("container");
+ struct stat s;
+ return !!getenv("container") || !!stat("/.dockerenv", &s);