{"_id":"is-docker","_rev":"4298134","name":"is-docker","description":"Check if the process is running inside a Docker container","dist-tags":{"latest":"4.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2026-04-07T21:03:42.000Z","created":"2015-04-08T07:09:24.685Z","4.0.0":"2025-09-15T21:04:08.390Z","3.0.0":"2021-08-31T23:02:35.148Z","2.2.1":"2021-04-09T08:59:11.367Z","2.2.0":"2021-04-05T13:09:34.342Z","2.1.1":"2020-08-04T16:42:07.327Z","2.1.0":"2020-08-02T22:23:05.278Z","2.0.0":"2019-04-19T13:09:47.492Z","1.1.0":"2016-10-27T08:35:14.265Z","1.0.1":"2016-05-18T07:14:39.690Z","1.0.0":"2015-04-08T07:09:24.685Z"},"users":{"rocket0191":true},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-docker.git"},"versions":{"4.0.0":{"name":"is-docker","version":"4.0.0","description":"Check if the process is running inside a Docker container","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-docker.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","bin":{"is-docker":"cli.js"},"exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=20"},"scripts":{"test":"xo && node --test"},"keywords":["detect","docker","dockerized","container","inside","is","env","environment","process"],"devDependencies":{"esmock":"^2.7.3","xo":"^1.2.2"},"_id":"is-docker@4.0.0","gitHead":"59379f14b6dda26a0167fce55d80bf546857f92d","types":"./index.d.ts","bugs":{"url":"https://github.com/sindresorhus/is-docker/issues"},"homepage":"https://github.com/sindresorhus/is-docker#readme","_nodeVersion":"20.19.1","_npmVersion":"10.9.2","dist":{"shasum":"6aab87c77a30ddff39c460af372ee1795aee7848","size":1779,"noattachment":false,"key":"/is-docker/-/is-docker-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-docker/download/is-docker-4.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/is-docker_4.0.0_1757970248187_0.42945898660424886"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-09-15T21:04:08.390Z","publish_time":1757970248390,"_source_registry_name":"default","_cnpm_publish_time":1757970248390},"3.0.0":{"name":"is-docker","version":"3.0.0","description":"Check if the process is running inside a Docker container","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-docker.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","bin":{"is-docker":"cli.js"},"engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["detect","docker","dockerized","container","inside","is","env","environment","process"],"devDependencies":{"ava":"^3.15.0","sinon":"^11.1.2","tsd":"^0.17.0","xo":"^0.44.0"},"gitHead":"8686c66ce485dfe45593dd77c5e9aadbc1491d38","bugs":{"url":"https://github.com/sindresorhus/is-docker/issues"},"homepage":"https://github.com/sindresorhus/is-docker#readme","_id":"is-docker@3.0.0","_nodeVersion":"14.17.5","_npmVersion":"7.20.3","dist":{"shasum":"90093aa3106277d8a77a5910dbae71747e15a200","size":1721,"noattachment":false,"key":"/is-docker/-/is-docker-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-docker/download/is-docker-3.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-docker_3.0.0_1630450954935_0.5441646887681955"},"_hasShrinkwrap":false,"publish_time":1630450955148,"_cnpm_publish_time":1630450955148},"2.2.1":{"name":"is-docker","version":"2.2.1","description":"Check if the process is running inside a Docker container","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-docker.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"bin":{"is-docker":"cli.js"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["detect","docker","dockerized","container","inside","is","env","environment","process"],"devDependencies":{"ava":"^1.4.1","sinon":"^7.3.2","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"43b4ec12e5b4337901782a7b0335f43f93669443","bugs":{"url":"https://github.com/sindresorhus/is-docker/issues"},"homepage":"https://github.com/sindresorhus/is-docker#readme","_id":"is-docker@2.2.1","_nodeVersion":"15.12.0","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"33eeabe23cfe86f14bde4408a02c0cfb853acdaa","size":1689,"noattachment":false,"key":"/is-docker/-/is-docker-2.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-docker/download/is-docker-2.2.1.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-docker_2.2.1_1617958751231_0.5669495693109765"},"_hasShrinkwrap":false,"publish_time":1617958751367,"_cnpm_publish_time":1617958751367},"2.2.0":{"name":"is-docker","version":"2.2.0","description":"Check if the process is running inside a Docker container","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-docker.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"bin":{"is-docker":"cli.js"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["detect","docker","dockerized","container","inside","is","env","environment","process"],"devDependencies":{"ava":"^1.4.1","sinon":"^7.3.2","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"96002f95a403482e87f616de400667ef259ae872","bugs":{"url":"https://github.com/sindresorhus/is-docker/issues"},"homepage":"https://github.com/sindresorhus/is-docker#readme","_id":"is-docker@2.2.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"b037c8815281edaad6c2562648a5f5f18839d5f7","size":1761,"noattachment":false,"key":"/is-docker/-/is-docker-2.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-docker/download/is-docker-2.2.0.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-docker_2.2.0_1617628174162_0.8823876396595611"},"_hasShrinkwrap":false,"publish_time":1617628174342,"_cnpm_publish_time":1617628174342},"2.1.1":{"name":"is-docker","version":"2.1.1","description":"Check if the process is running inside a Docker container","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-docker.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"bin":{"is-docker":"cli.js"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["detect","docker","dockerized","container","inside","is","env","environment","process"],"devDependencies":{"ava":"^1.4.1","sinon":"^7.3.2","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"e9df7a56a07125061981b7a5ca1c9d8c4fc8765e","bugs":{"url":"https://github.com/sindresorhus/is-docker/issues"},"homepage":"https://github.com/sindresorhus/is-docker#readme","_id":"is-docker@2.1.1","_nodeVersion":"14.5.0","_npmVersion":"6.14.5","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"4125a88e44e450d384e09047ede71adc2d144156","size":1742,"noattachment":false,"key":"/is-docker/-/is-docker-2.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-docker/download/is-docker-2.1.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-docker_2.1.1_1596559327162_0.06418938597862911"},"_hasShrinkwrap":false,"publish_time":1596559327327,"_cnpm_publish_time":1596559327327},"2.1.0":{"name":"is-docker","version":"2.1.0","description":"Check if the process is running inside a Docker container","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-docker.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"bin":{"is-docker":"cli.js"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["detect","docker","dockerized","container","inside","is","env","environment","process"],"devDependencies":{"ava":"^1.4.1","sinon":"^7.3.2","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"39a955b483b7f3483037b11bbd0c7e04a6fe511a","bugs":{"url":"https://github.com/sindresorhus/is-docker/issues"},"homepage":"https://github.com/sindresorhus/is-docker#readme","_id":"is-docker@2.1.0","_nodeVersion":"14.5.0","_npmVersion":"6.14.5","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"25dc043e4fdc3cf969d622735e05a86ba9952e2b","size":1738,"noattachment":false,"key":"/is-docker/-/is-docker-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-docker/download/is-docker-2.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-docker_2.1.0_1596406985176_0.986967546057193"},"_hasShrinkwrap":false,"publish_time":1596406985278,"_cnpm_publish_time":1596406985278},"2.0.0":{"name":"is-docker","version":"2.0.0","description":"Check if the process is running inside a Docker container","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-docker.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["detect","docker","dockerized","container","inside","is","env","environment","process"],"devDependencies":{"ava":"^1.4.1","sinon":"^7.3.2","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"7461d85a54fe45f3688a3938c640d461019e3536","bugs":{"url":"https://github.com/sindresorhus/is-docker/issues"},"homepage":"https://github.com/sindresorhus/is-docker#readme","_id":"is-docker@2.0.0","_nodeVersion":"8.16.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"2cb0df0e75e2d064fe1864c37cdeacb7b2dcf25b","size":1605,"noattachment":false,"key":"/is-docker/-/is-docker-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-docker/download/is-docker-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-docker_2.0.0_1555679387350_0.8466747373366723"},"_hasShrinkwrap":false,"publish_time":1555679387492,"_cnpm_publish_time":1555679387492},"1.1.0":{"name":"is-docker","version":"1.1.0","description":"Check if the process is running inside a Docker container","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-docker.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["detect","docker","dockerized","container","inside","is","env","environment","process"],"devDependencies":{"ava":"*","sinon":"^1.14.1","xo":"^0.16.0"},"gitHead":"018db88bebd72308336fc90979550a3842b23176","bugs":{"url":"https://github.com/sindresorhus/is-docker/issues"},"homepage":"https://github.com/sindresorhus/is-docker#readme","_id":"is-docker@1.1.0","_shasum":"f04374d4eee5310e9a8e113bf1495411e46176a1","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"f04374d4eee5310e9a8e113bf1495411e46176a1","size":1570,"noattachment":false,"key":"/is-docker/-/is-docker-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-docker/download/is-docker-1.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/is-docker-1.1.0.tgz_1477557310875_0.7883002860471606"},"directories":{},"publish_time":1477557314265,"_cnpm_publish_time":1477557314265,"_hasShrinkwrap":false},"1.0.1":{"name":"is-docker","version":"1.0.1","description":"Check if the process is running inside a Docker container","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-docker.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["detect","docker","dockerized","container","inside","is","env","environment","process"],"devDependencies":{"ava":"*","sinon":"^1.14.1","xo":"*"},"gitHead":"1ebfeb09bccdb93996164b47415d6aad16ac7f66","bugs":{"url":"https://github.com/sindresorhus/is-docker/issues"},"homepage":"https://github.com/sindresorhus/is-docker#readme","_id":"is-docker@1.0.1","_shasum":"c02e215fc3d1d2ffe35a3b70d19f9d984693a4d8","_from":".","_npmVersion":"2.15.0","_nodeVersion":"4.4.2","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"c02e215fc3d1d2ffe35a3b70d19f9d984693a4d8","size":1497,"noattachment":false,"key":"/is-docker/-/is-docker-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-docker/download/is-docker-1.0.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/is-docker-1.0.1.tgz_1463555679110_0.1724248994141817"},"directories":{},"publish_time":1463555679690,"_cnpm_publish_time":1463555679690,"_hasShrinkwrap":false},"1.0.0":{"name":"is-docker","version":"1.0.0","description":"Check if the process is running inside a Docker container","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/is-docker"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"node test.js"},"files":["index.js"],"keywords":["docker","dockerized","container","inside","is","detect","env","environment","process"],"devDependencies":{"ava":"0.0.4","sinon":"^1.14.1"},"gitHead":"43550f2cb491fc42a273f13065cfad81be0569d3","bugs":{"url":"https://github.com/sindresorhus/is-docker/issues"},"homepage":"https://github.com/sindresorhus/is-docker","_id":"is-docker@1.0.0","_shasum":"31cbc0ae28b187c012986203254deb09f0ceb867","_from":".","_npmVersion":"2.7.4","_nodeVersion":"0.10.36","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"31cbc0ae28b187c012986203254deb09f0ceb867","size":1491,"noattachment":false,"key":"/is-docker/-/is-docker-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-docker/download/is-docker-1.0.0.tgz"},"directories":{},"publish_time":1428476964685,"_cnpm_publish_time":1428476964685,"_hasShrinkwrap":false}},"readme":"# is-docker\n\n> Check if the process is running inside a Docker container\n\n## Install\n\n```sh\nnpm install is-docker\n```\n\n## Usage\n\n```js\nimport isDocker from 'is-docker';\n\nif (isDocker()) {\n\tconsole.log('Running inside a Docker container');\n}\n```\n\n## CLI\n\n```sh\n$ is-docker\n```\n\nExits with code 0 if inside a Docker container and 2 if not.\n\n```sh\n$ is-docker && echo \"Running in Docker\" || echo \"Not running in Docker\"\n```\n\n## Related\n\n- [is-inside-container](https://github.com/sindresorhus/is-inside-container) - Check if the process is running inside a container\n","_attachments":{},"homepage":"https://github.com/sindresorhus/is-docker#readme","bugs":{"url":"https://github.com/sindresorhus/is-docker/issues"},"license":"MIT"}