提交学习笔记专用
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.

36 lines
547 B

  1. # is-inside-container
  2. > Check if the process is running inside a container
  3. ## Install
  4. ```sh
  5. npm install is-inside-container
  6. ```
  7. ## Usage
  8. ```js
  9. import isInsideContainer from 'is-inside-container';
  10. if (isInsideContainer()) {
  11. console.log('Running inside a container');
  12. }
  13. ```
  14. ## CLI
  15. ```sh
  16. is-inside-container
  17. ```
  18. Exits with code 0 if inside a container and 2 if not.
  19. ## Supported containers
  20. - Docker
  21. - Podman
  22. ## Related
  23. - [is-docker](https://github.com/sindresorhus/is-docker) - Check if the process is running inside a Docker container