Repository: flutter
Issue: [web-server] Flutter Debug Extension not connecting to docker container
Labels: tool,a: debugging,platform-web,has reproducible steps,P3,found in release: 2.1,team-web,triaged-web

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill out the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

## Steps to Reproduce

<!-- You must include full steps to reproduce so that we can reproduce the problem. -->

1. Create a Dockerfile with Flutter installed
2. Run with exposed web port (8000 in my case): `docker run -v appcode:/app -p 8000:8000 my-flutter-container bash` 
3. Run flutter in the container: `flutter run -d web-server --web-port 8000 --web-hostname 0.0.0.0`
4. On client machine, navigate to http://localhost:8000

**Expected results:** <!-- what did you want to see? -->
The flutter app + debug extension to work.

**Actual results:** <!-- what did you see? -->
The flutter app loads, I see the app, but the extension won't connect.
![image](https://user-images.githubusercontent.com/33096067/112326490-91854700-8c82-11eb-987e-a385af4d567c.png)
![image](https://user-images.githubusercontent.com/33096067/112326578-a1049000-8c82-11eb-99ba-b9bd76370746.png)

<details>
  <summary>Logs</summary>

<!--
      Run your application with `flutter run --verbose` and attach all the
      log output below between the lines with the backticks. If there is an
      exception, please see if the error message includes enough information
      to explain how to solve the issue.
-->

```
dev@bf829b73d06b:/app$ flutter run -d web-server --web-port 8000 --web-hostname 0.0.0.0 --verbose
[  +67 ms] executing: uname -m
[  +29 ms] Exit code 0 from: uname -m
[        ] x86_64
[  +12 ms] executing: [/home/dev/.local/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[   +3 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[        ] 8264cb3e8a797eef39cbcd32bb56fd07790efb7f
[        ] executing: [/home/dev/.local/flutter/] git tag --points-at 8264cb3e8a797eef39cbcd32bb56fd07790efb7f
[   +2 ms] Exit code 0 from: git tag --points-at 8264cb3e8a797eef39cbcd32bb56fd07790efb7f
[        ] 2.1.0-12.1.pre
[  +41 ms] executing: [/home/dev/.local/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[   +2 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/dev
[        ] executing: [/home/dev/.local/flutter/] git ls-remote --get-url origin
[   +2 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[  +25 ms] Unable to locate an Android SDK.
[   +5 ms] executing: [/home/dev/.local/flutter/] git rev-parse --abbrev-ref HEAD
[   +2 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] dev
[  +63 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +2 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +65 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[   +2 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +71 ms] Skipping pub get: version match.
[ +120 ms] Generating /app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
[ +101 ms] Launching lib/main.dart on Web Server in debug mode...
[  +99 ms] Updating assets
[  +70 ms] Waiting for connection from debug service on Web Server...
[  +95 ms] <- reset
[   +6 ms] /home/dev/.local/flutter/bin/cache/dart-sdk/bin/dart --disable-dart-dev
/home/dev/.local/flutter/bin/cache/artifacts/engine/linux-x64/frontend_server.dart.snapshot --sdk-root
/home/dev/.local/flutter/bin/cache/flutter_web_sdk/ --incremental --target=dartdevc --debugger-module-names
--experimental-emit-debug-metadata -DFLUTTER_WEB_AUTO_DETECT=true --output-dill
/tmp/flutter_tools.VVBCXI/flutter_tool.DHQLAH/app.dill --libraries-spec
file:///home/dev/.local/flutter/bin/cache/flutter_web_sdk/libraries.json --packages /app/.dart_tool/package_config.json
-Ddart.vm.profile=false -Ddart.vm.product=false --enable-asserts --track-widget-creation --filesystem-root
/tmp/flutter_tools.VVBCXI/flutter_tools.QLUNHA --filesystem-scheme org-dartlang-app --initialize-from-dill
build/c7922d95bf4a2462b75c84a97c312edb.cache.dill.track.dill --platform
file:///home/dev/.local/flutter/bin/cache/flutter_web_sdk/kernel/flutter_ddc_sdk.dill --no-sound-null-safety
[  +17 ms] <- compile org-dartlang-app:/web_entrypoint.dart
[+16526 ms] Waiting for connection from debug service on Web Server... (completed in 16.6s)
[        ] Synced 29.2MB.
[        ] <- accept
[        ] Caching compiled dill
[  +25 ms] lib/main.dart is being served at http://0.0.0.0:8000
[        ] The web-server device requires the Dart Debug Chrome extension for debugging. Consider using the Chrome or
Edge devices
           for an improved development workflow.
[   +6 ms] 🔥  To hot restart changes while running, press "r" or "R".
[   +1 ms] For a more detailed help message, press "h". To quit, press "q".
```

<!--
     Run `flutter analyze` and attach any output of that command below.
     If there are any analysis errors, try resolving them before filing this issue.
-->

```
dev@bf829b73d06b:~$ flutter analyze
Analyzing dev...
No issues found! (ran in 0.6s)

```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
[✓] Flutter (Channel dev, 2.1.0-12.1.pre, on Linux, locale en_US)
    • Flutter version 2.1.0-12.1.pre at /home/dev/.local/flutter
    • Framework revision 8264cb3e8a (2 weeks ago), 2021-03-10 12:37:57 -0800
    • Engine revision 711ab3fda0
    • Dart version 2.13.0 (build 2.13.0-116.0.dev)

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.


[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).

[!] Connected device
    ! No devices available

! Doctor found issues in 4 categories.

```

</details>