Crates.io | is-container |
lib.rs | is-container |
version | 0.1.2 |
source | src |
created_at | 2023-03-14 13:12:05.854721 |
updated_at | 2023-03-18 10:02:42.182496 |
description | Check if the process is running inside a container. |
homepage | |
repository | https://github.com/maolonglong/is-container |
max_upload_size | |
id | 809849 |
size | 5,129 |
Check if the process is running inside a container.
$ cargo add is-container
use is_container::is_container;
if is_container() {
println!("Running inside a container");
}
$ cargo install is-container
$ is-container
# Exits with code 0 if inside a container and 2 if not.
$ echo $?
2