Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

is-inside-container

sindresorhus21.7mMIT1.0.0TypeScript support: included

Check if the process is running inside a container (Docker/Podman)

detect, inside, container, docker, dockerized, podman, is, env, environment, process

readme

is-inside-container

Check if the process is running inside a container

Install

npm install is-inside-container

Usage

import isInsideContainer from 'is-inside-container';

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

CLI

is-inside-container

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

Supported containers

  • Docker
  • Podman
  • is-docker - Check if the process is running inside a Docker container