is-container 0.1.2

Check if the process is running inside a container.
Documentation
  • Coverage
  • 100%
    2 out of 2 items documented1 out of 2 items with examples
  • Size
  • Source code size: 4.59 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.02 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • maolonglong/is-container
    2 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • maolonglong

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