We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b8ff44f commit 7051ed4Copy full SHA for 7051ed4
1 file changed
base/cvd/cuttlefish/common/libs/utils/container.cpp
@@ -22,15 +22,16 @@
22
#include "cuttlefish/common/libs/utils/files.h"
23
24
namespace cuttlefish {
25
+namespace {
26
-static bool IsRunningInDocker() {
27
+bool IsRunningInDocker() {
28
// if /.dockerenv exists, it's inside a docker container
- static std::string docker_env_path("/.dockerenv");
29
- static bool ret =
30
- FileExists(docker_env_path) || DirectoryExists(docker_env_path);
31
- return ret;
+ std::string docker_env_path("/.dockerenv");
+ return FileExists(docker_env_path) || DirectoryExists(docker_env_path);
32
}
33
+} // namespace
34
+
35
bool IsRunningInContainer() {
36
// TODO: add more if we support other containers than docker
37
return IsRunningInDocker();
0 commit comments