Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sindresorhus/is-docker
Check if the process is running inside a Docker container
https://github.com/sindresorhus/is-docker
Last synced: 6 days ago
JSON representation
Check if the process is running inside a Docker container
- Host: GitHub
- URL: https://github.com/sindresorhus/is-docker
- Owner: sindresorhus
- License: mit
- Created: 2015-04-08T07:05:01.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2023-09-24T09:56:55.000Z (about 1 year ago)
- Last Synced: 2024-11-29T19:07:49.709Z (13 days ago)
- Language: JavaScript
- Size: 21.5 KB
- Stars: 220
- Watchers: 7
- Forks: 13
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
- Funding: .github/funding.yml
- License: license
- Security: .github/security.md
Awesome Lists containing this project
- awesome - sindresorhus/is-docker - Check if the process is running inside a Docker container (others)
- awesome-docker - is-docker - Check if the process is running inside a Docker container by [@sindresorhus][sindresorhus] (Docker Images / Base Tools)
- awesome-docker - is-docker - Check if the process is running inside a Docker container by [@sindresorhus][sindresorhus] (Docker Images / Base Tools)
- awesome-starred - sindresorhus/is-docker - Check if the process is running inside a Docker container (others)
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