Initial public release of Warp.
Repo-Sync-Origin: warpdotdev/warp-internal@12af1d983b
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
/// The Docker engine creates this file at the root of every container.
|
||||
const DOCKER_ENV_FILE: &str = "/.dockerenv";
|
||||
|
||||
/// Detect whether we are running inside a Docker container.
|
||||
///
|
||||
/// The Docker runtime places a `/.dockerenv` marker file in the root filesystem of
|
||||
/// every container it creates. This is the standard heuristic used to detect Docker.
|
||||
pub fn is_in_docker() -> bool {
|
||||
std::fs::exists(DOCKER_ENV_FILE).unwrap_or(false)
|
||||
}
|
||||
Reference in New Issue
Block a user