Socket
Socket
Sign inDemoInstall

is-docker

Package Overview
Dependencies
0
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-docker

Check if the process is running inside a Docker container


Version published
Maintainers
1
Weekly downloads
24,953,855
decreased by-16.71%
Install size
4.13 kB

Weekly downloads

Package description

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

Readme

Source

is-docker

Check if the process is running inside a Docker container

Install

$ npm install is-docker

Usage

import isDocker from 'is-docker';

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

CLI

$ is-docker

Exits with code 0 if inside a Docker container and 2 if not.

Keywords

FAQs

Last updated on 31 Aug 2021

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc