🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

is-docker

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
i

is-docker

Check if the process is running inside a Docker container

3.0.0
latest
100

Supply Chain Security

100

Vulnerability

69

Quality

76

Maintenance

100

License

Version published
Weekly downloads
34M
-19.47%
Maintainers
1
Weekly downloads
 
Created
Issues
2

What is is-docker?

The is-docker npm package is a simple utility that allows you to check if your code is running inside a Docker container. This can be particularly useful for altering behavior, debugging, or applying configurations specific to Docker environments.

What are is-docker's main functionalities?

Check if running in Docker

This feature allows you to determine if your application is running inside a Docker container. The `isDocker()` function returns a boolean value: `true` if the environment is detected as a Docker container, and `false` otherwise. This can be useful for adjusting configurations or behavior when running in Docker.

const isDocker = require('is-docker');

if (isDocker()) {
  console.log('Running inside a Docker container!');
} else {
  console.log('Running outside of Docker.');
}

Other packages similar to is-docker

FAQs

Package last updated on 31 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts