#process-running #different #sindresorhus-is-docker

is-docker

Checks if the process is running inside a Docker container

2 unstable releases

Uses old Rust 2015

0.2.0 Jan 22, 2023
0.1.0 Jan 21, 2023

#1637 in Command line utilities

Download history 28803/week @ 2024-03-14 30027/week @ 2024-03-21 26833/week @ 2024-03-28 30264/week @ 2024-04-04 34905/week @ 2024-04-11 36026/week @ 2024-04-18 36289/week @ 2024-04-25 38951/week @ 2024-05-02 38993/week @ 2024-05-09 38872/week @ 2024-05-16 37571/week @ 2024-05-23 38167/week @ 2024-05-30 34480/week @ 2024-06-06 36796/week @ 2024-06-13 39293/week @ 2024-06-20 32261/week @ 2024-06-27

149,236 downloads per month
Used in 238 crates (2 directly)

MIT license

3KB

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
    }
}

Dependencies

~48KB