Skip to content

Commit ddabb66

Browse files
authored
fix: fix kubernetes container detection (vuejs#5681)
1 parent c98f76a commit ddabb66

File tree

1 file changed

+4
-1
lines changed
  • packages/@vue/cli-service/lib/commands

1 file changed

+4
-1
lines changed

packages/@vue/cli-service/lib/commands/serve.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,13 @@ function addDevClientToEntry (config, devClient) {
345345

346346
// https://stackoverflow.com/a/20012536
347347
function checkInContainer () {
348+
if ('CODESANDBOX_SSE' in process.env) {
349+
return true
350+
}
348351
const fs = require('fs')
349352
if (fs.existsSync(`/proc/1/cgroup`)) {
350353
const content = fs.readFileSync(`/proc/1/cgroup`, 'utf-8')
351-
return /:\/(lxc|docker|kubepods)\//.test(content)
354+
return /:\/(lxc|docker|kubepods(\.slice)?)\//.test(content)
352355
}
353356
}
354357

0 commit comments

Comments
 (0)