sindresorhus

is-docker

Check if the process is running inside a Docker container

by sindresorhus

JavaScript

JavaScript100%

Commit activity

Last 12 weeks · 1 commit

Full graph →

Community health

4 of 6 standards met

Community profile →
85
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template
jneisener

I'm on macOS and have installed docker through Docker Desktop . Here is a simple demo of not recognizing docker during the build process: As we can see is not present, but is. Seems to me - at least at surface level - unlikely to pass outside of docker but to better detect the build process, at least on my platform

jneisener · 10mo ago
GCastilho

It appears that detection fails on the latest docker version (27.3.1) of the host is Linux Upon investigation it seems that is now empty and the check for "docker" fails !image This is the ouput on docker v27.3.1 on a Windows host !image

GCastilho · 1y ago
Ge11ert

This package returns true when I try to run in in my own system (not in docker). I use Ubuntu 18.04 and the package version is 2.2.0. I suppose, positive match comes from the check Output of /proc/self/cgroup from the native system terminal: If I check it inside a docker container, the ouput of file is the next: I don't know from where the part comes from, so I can't say how it should be modified to run correctly. But now I had to go on previous version (where only "docker" in cgroups is being detected)

Ge11ert · 1y ago
Structured data for AI agents

Repository: sindresorhus/is-docker. Description: Check if the process is running inside a Docker container Stars: 234, Forks: 15. Primary language: JavaScript. Languages: JavaScript (100%). License: MIT. Latest release: v4.0.0 (1y ago). Open PRs: 0, open issues: 0. Last activity: 1mo ago. Community health: 85%. Top contributors: sindresorhus, ds82, BendingBender, HonkingGoose, markacola, dword-design.