#docker #docker-container #container #process #checks

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

#2021 in Command line utilities

Download history 76/week @ 2023-01-17 48/week @ 2023-01-24 25/week @ 2023-01-31 32/week @ 2023-02-07 25/week @ 2023-02-14 27/week @ 2023-02-21 17/week @ 2023-02-28 18/week @ 2023-03-07 21/week @ 2023-03-14 16/week @ 2023-03-21

74 downloads per month
Used in is-wsl

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

~49KB