Skip to content

Commit 9426ceb

Browse files
committed
Detect podman container environment.
Bug: b/523379344
1 parent 7051ed4 commit 9426ceb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

base/cvd/cuttlefish/common/libs/utils/container.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@ bool IsRunningInDocker() {
3030
return FileExists(docker_env_path) || DirectoryExists(docker_env_path);
3131
}
3232

33+
bool IsRunningInPodman() { return FileExists("/run/.containerenv"); }
34+
3335
} // namespace
3436

3537
bool IsRunningInContainer() {
3638
// TODO: add more if we support other containers than docker
37-
return IsRunningInDocker();
39+
return IsRunningInDocker() || IsRunningInPodman();
3840
}
3941

4042
} // namespace cuttlefish

0 commit comments

Comments
 (0)