projects
/
oweals
/
procd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1361b97
)
procd: add docker support
author
Paul Spooren
<mail@aparcar.org>
Mon, 27 May 2019 09:33:29 +0000
(11:33 +0200)
committer
Daniel Golle
<daniel@makrotopia.org>
Wed, 29 May 2019 12:00:32 +0000
(14:00 +0200)
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>
container.h
patch
|
blob
|
history
diff --git
a/container.h
b/container.h
index d33fa3266dc09e627ace4f8397796ad018d853b2..dd2e432adbfc586fd824846d63485b42248fe8a9 100644
(file)
--- a/
container.h
+++ b/
container.h
@@
-16,9
+16,11
@@
#include <stdlib.h>
#include <stdbool.h>
+#include <sys/stat.h>
static inline bool is_container() {
- return !!getenv("container");
+ struct stat s;
+ return !!getenv("container") || !!stat("/.dockerenv", &s);
}
#endif