Last change
on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
341 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | # is-docker
|
---|
| 2 |
|
---|
| 3 | > Check if the process is running inside a Docker container
|
---|
| 4 |
|
---|
| 5 | ## Install
|
---|
| 6 |
|
---|
| 7 | ```
|
---|
| 8 | $ npm install is-docker
|
---|
| 9 | ```
|
---|
| 10 |
|
---|
| 11 | ## Usage
|
---|
| 12 |
|
---|
| 13 | ```js
|
---|
| 14 | const isDocker = require('is-docker');
|
---|
| 15 |
|
---|
| 16 | if (isDocker()) {
|
---|
| 17 | console.log('Running inside a Docker container');
|
---|
| 18 | }
|
---|
| 19 | ```
|
---|
| 20 |
|
---|
| 21 | ## CLI
|
---|
| 22 |
|
---|
| 23 | ```
|
---|
| 24 | $ is-docker
|
---|
| 25 | ```
|
---|
| 26 |
|
---|
| 27 | Exits with code 0 if inside a Docker container and 2 if not.
|
---|
Note:
See
TracBrowser
for help on using the repository browser.