Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sindresorhus/is-docker

Check if the process is running inside a Docker container
https://github.com/sindresorhus/is-docker

Last synced: about 2 months ago
JSON representation

Check if the process is running inside a Docker container

Awesome Lists containing this project

README

        

# is-docker

> Check if the process is running inside a Docker container

## Install

```sh
npm install is-docker
```

## Usage

```js
import isDocker from 'is-docker';

if (isDocker()) {
console.log('Running inside a Docker container');
}
```

## CLI

```sh
is-docker
```

Exits with code 0 if inside a Docker container and 2 if not.

## Related

- [is-inside-container](https://github.com/sindresorhus/is-inside-container) - Check if the process is running inside a container