{"_attachments":{},"_id":"is-docker","_rev":"5628-61f1531db77ea98a74928246","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"description":"Check if the process is running inside a Docker container","dist-tags":{"latest":"4.0.0"},"license":"MIT","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"name":"is-docker","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","time":{"created":"2022-01-26T13:56:45.725Z","modified":"2025-09-15T21:04:23.719Z","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","4.0.0":"2025-09-15T21:04:08.390Z"},"versions":{"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,"tarball":"https://registry.npmmirror.com/is-docker/-/is-docker-3.0.0.tgz","integrity":"sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ=="},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_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,"_cnpmcore_publish_time":"2021-12-13T15:51:04.158Z"},"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,"tarball":"https://registry.npmmirror.com/is-docker/-/is-docker-2.2.1.tgz","integrity":"sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ=="},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_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,"_cnpmcore_publish_time":"2021-12-13T15:51:04.411Z"},"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,"tarball":"https://registry.npmmirror.com/is-docker/-/is-docker-2.2.0.tgz","integrity":"sha512-K4GwB4i/HzhAzwP/XSlspzRdFTI9N8OxJOyOU7Y5Rz+p+WBokXWVWblaJeBkggthmoSV0OoGTH5thJNvplpkvQ=="},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_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,"_cnpmcore_publish_time":"2021-12-13T15:51:04.764Z"},"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,"tarball":"https://registry.npmmirror.com/is-docker/-/is-docker-2.1.1.tgz","integrity":"sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw=="},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"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,"_cnpmcore_publish_time":"2021-12-13T15:51:05.114Z"},"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,"tarball":"https://registry.npmmirror.com/is-docker/-/is-docker-2.1.0.tgz","integrity":"sha512-mB2WygGsSeoXtLKpSYzP6sa0Z9DyU9ZyKlnvuZWxCociaI0qsF8u12sR72DFTX236g1u6oWSWYFuUk09nGQEjg=="},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"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,"_cnpmcore_publish_time":"2021-12-13T15:51:05.438Z"},"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,"tarball":"https://registry.npmmirror.com/is-docker/-/is-docker-2.0.0.tgz","integrity":"sha512-pJEdRugimx4fBMra5z2/5iRdZ63OhYV0vr0Dwm5+xtW4D1FvRkB8hamMIhnWfyJeDdyr/aa7BDyNbtG38VxgoQ=="},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"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,"_cnpmcore_publish_time":"2021-12-13T15:51:05.750Z"},"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,"tarball":"https://registry.npmmirror.com/is-docker/-/is-docker-1.1.0.tgz","integrity":"sha512-ZEpopPu+bLIb/x3IF9wXxRdAW74e/ity1XGRxpznAaABKhc8mmtRamRB2l71CSs1YMS8FQxDK/vPK10XlhzG2A=="},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/is-docker-1.1.0.tgz_1477557310875_0.7883002860471606"},"directories":{},"publish_time":1477557314265,"_hasShrinkwrap":false,"_cnpm_publish_time":1477557314265,"_cnpmcore_publish_time":"2021-12-13T15:51:06.069Z"},"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,"tarball":"https://registry.npmmirror.com/is-docker/-/is-docker-1.0.1.tgz","integrity":"sha512-O8kCt+CC/lXilFCCvgMdQeJkg4JTxaVm8O1eWz68Eozgn5FtzoMvf1RObdXtM726NR/q17ggF3G0wO+Zh9w+zw=="},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/is-docker-1.0.1.tgz_1463555679110_0.1724248994141817"},"directories":{},"publish_time":1463555679690,"_hasShrinkwrap":false,"_cnpm_publish_time":1463555679690,"_cnpmcore_publish_time":"2021-12-13T15:51:06.444Z"},"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":"sindresorhus@gmail.com"}],"dist":{"shasum":"31cbc0ae28b187c012986203254deb09f0ceb867","size":1491,"noattachment":false,"tarball":"https://registry.npmmirror.com/is-docker/-/is-docker-1.0.0.tgz","integrity":"sha512-jg/svotujBsC1pubyrIqtewPOURHcduBYtRTa2HAtMvFBT18/HKNejron43Z9BOaTYNM7F2+xVdryl04KFLowA=="},"directories":{},"publish_time":1428476964685,"_hasShrinkwrap":false,"_cnpm_publish_time":1428476964685,"_cnpmcore_publish_time":"2021-12-13T15:51:06.815Z"},"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":{"integrity":"sha512-LHE+wROyG/Y/0ZnbktRCoTix2c1RhgWaZraMZ8o1Q7zCh0VSrICJQO5oqIIISrcSBtrXv0o233w1IYwsWCjTzA==","shasum":"6aab87c77a30ddff39c460af372ee1795aee7848","tarball":"https://registry.npmmirror.com/is-docker/-/is-docker-4.0.0.tgz","fileCount":6,"unpackedSize":3481,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGhFg9+2S8fgJ1BKJ+SPPWTJE/ctOw2IS6FZ8D7eU4BBAiEA1GjnMKdoDiYNd+Zb3IMkqx6RVrWBBM7Qm4s6A6aCUyw="}],"size":1779},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_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"}},"bugs":{"url":"https://github.com/sindresorhus/is-docker/issues"},"homepage":"https://github.com/sindresorhus/is-docker#readme","keywords":["detect","docker","dockerized","container","inside","is","env","environment","process"],"repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-docker.git"},"_source_registry_name":"default"}