vuejs / vue-cli

🛠️ webpack-based tooling for Vue.js Development
https://cli.vuejs.org/
MIT License
29.75k stars 6.33k forks source link

Docker container detection not working for some linux kernels #6726

Open guillaumedsde opened 2 years ago

guillaumedsde commented 2 years ago

Version

4.5.0

Environment info

  System:
    OS: Linux 5.14 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
    CPU: (8) x64 Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz
  Binaries:
    Node: 14.18.0 - /usr/local/bin/node
    Yarn: 1.22.5 - /usr/local/bin/yarn
    npm: 6.14.15 - /usr/local/bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: Not Found
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.2.1 
    @vue/babel-helper-vue-transform-on:  1.0.2 
    @vue/babel-plugin-jsx:  1.0.7 
    @vue/babel-plugin-transform-vue-jsx:  1.2.1 
    @vue/babel-preset-app:  4.5.13 
    @vue/babel-preset-jsx:  1.2.4 
    @vue/babel-sugar-composition-api-inject-h:  1.2.1 
    @vue/babel-sugar-composition-api-render-instance:  1.2.4 
    @vue/babel-sugar-functional-vue:  1.2.2 
    @vue/babel-sugar-inject-h:  1.2.2 
    @vue/babel-sugar-v-model:  1.2.3 
    @vue/babel-sugar-v-on:  1.2.3 
    @vue/cli: ^4.5.0 => 4.5.0 
    @vue/cli-overlay:  4.5.13 
    @vue/cli-plugin-babel: ~4.5.0 => 4.5.13 
    @vue/cli-plugin-eslint: ~4.5.0 => 4.5.13 
    @vue/cli-plugin-router: ~4.5.0 => 4.5.13 
    @vue/cli-plugin-unit-jest: ~4.5.0 => 4.5.13 
    @vue/cli-plugin-vuex: ~4.5.0 => 4.5.13 
    @vue/cli-service: ~4.5.0 => 4.5.13 
    @vue/cli-shared-utils:  4.5.13 
    @vue/cli-ui:  4.5.13 
    @vue/cli-ui-addon-webpack:  4.5.13 
    @vue/cli-ui-addon-widgets:  4.5.13 
    @vue/compiler-core:  3.2.19 
    @vue/compiler-dom:  3.2.19 
    @vue/compiler-sfc:  3.2.19 
    @vue/compiler-ssr:  3.2.19 
    @vue/component-compiler-utils:  3.2.2 
    @vue/eslint-config-airbnb: ^5.0.2 => 5.3.0 
    @vue/preload-webpack-plugin:  1.1.2 
    @vue/reactivity:  3.2.19 
    @vue/ref-transform:  3.2.19 
    @vue/runtime-core:  3.2.19 
    @vue/runtime-dom:  3.2.19 
    @vue/server-renderer:  3.2.19 
    @vue/shared:  3.2.19 
    @vue/test-utils: ^1.0.3 => 1.2.2 
    @vue/web-component-wrapper:  1.3.0 
    eslint-plugin-vue: ^6.2.2 => 6.2.2 
    jest-serializer-vue:  2.0.2 
    typescript:  4.1.6 
    vue: ^2.6.11 => 2.6.14 (3.2.19)
    vue-cli-plugin-vuetify: ~2.4.2 => 2.4.2 
    vue-codemod:  0.0.4 
    vue-eslint-parser:  7.11.0 
    vue-hot-reload-api:  2.3.4 
    vue-jest:  3.0.7 
    vue-loader:  15.9.8 (16.5.0)
    vue-router: ^3.2.0 => 3.5.2 
    vue-style-loader:  4.1.3 
    vue-template-compiler: ^2.6.11 => 2.6.14 
    vue-template-es2015-compiler:  1.9.1 
    vuetify: ^2.4.0 => 2.5.8 
    vuetify-loader: ^1.7.0 => 1.7.3 
    vuex: ^3.4.0 => 3.6.2 
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

Using this kernel on arch linux:

Linux REDACTED 5.14.9-zen2-1-zen #1 ZEN SMP PREEMPT Fri, 01 Oct 2021 19:03:23 +0000 x86_64 GNU/Linux

Vue CLI container detection does not seem to work

What is expected?

The logs should contain the container detection log entry:

It seems you are running Vue CLI inside a container.
Access the dev server via http://localhost:<your container's external mapped port>/

What is actually happening?

The logs don't indicate vue-cli detected it is running in a container so the dev server's live reload functionality is not working due to the websocket URL not being built correctly


Running the stock ubuntu kernel, container detection works fine:

Linux REDACTED 5.4.0-86-generic #97~18.04.1-Ubuntu SMP Sat Sep 18 03:11:22 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

note: the vue info command output is from inside the docker container

guillaumedsde commented 2 years ago

Another note: a workaround for this problem is to set the CODESANDBOX_SSE environment variable on the container to any value