is-docker 0.2.0

Checks if the process is running inside a Docker container.
Documentation
  • Coverage
  • 0%
    0 out of 3 items documented0 out of 1 items with examples
  • Size
  • Source code size: 4.19 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.04 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 14s Average build duration of successful builds.
  • all releases: 14s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • TheLarkInn/is-docker
    8 4 2
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • TheLarkInn

is-docker

Checks if the process is running inside a Docker container. Rust implementation of sindresorhus/is-docker

Usage

$> cargo add is-docker

main.rs


use is_docker::is_docker

fn main() {
    if is_docker() {
        // Do some docker related stuff 🎇
    } else {
        // Do some different things! <3
    }
}