is-container

Crates.iois-container
lib.rsis-container
version0.1.2
sourcesrc
created_at2023-03-14 13:12:05.854721
updated_at2023-03-18 10:02:42.182496
descriptionCheck if the process is running inside a container.
homepage
repositoryhttps://github.com/maolonglong/is-container
max_upload_size
id809849
size5,129
Shaolong Chen (maolonglong)

documentation

README

is-container

Check if the process is running inside a container.

Lib

$ cargo add is-container
use is_container::is_container;

if is_container() {
    println!("Running inside a container");
}

CLI

$ cargo install is-container
$ is-container

# Exits with code 0 if inside a container and 2 if not.
$ echo $?
2
Commit count: 7

cargo fmt