You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
341 B

3 months ago
  1. # is-docker
  2. > Check if the process is running inside a Docker container
  3. ## Install
  4. ```
  5. $ npm install is-docker
  6. ```
  7. ## Usage
  8. ```js
  9. const isDocker = require('is-docker');
  10. if (isDocker()) {
  11. console.log('Running inside a Docker container');
  12. }
  13. ```
  14. ## CLI
  15. ```
  16. $ is-docker
  17. ```
  18. Exits with code 0 if inside a Docker container and 2 if not.