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

#1639 in Command line utilities

Download history 38265/week @ 2024-06-19 38816/week @ 2024-06-26 36118/week @ 2024-07-03 37721/week @ 2024-07-10 36466/week @ 2024-07-17 41996/week @ 2024-07-24 37979/week @ 2024-07-31 43722/week @ 2024-08-07 43518/week @ 2024-08-14 42786/week @ 2024-08-21 42678/week @ 2024-08-28 47723/week @ 2024-09-04 45411/week @ 2024-09-11 44153/week @ 2024-09-18 49152/week @ 2024-09-25 46467/week @ 2024-10-02

193,105 downloads per month
Used in 288 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

~47KB