title: react native docker container using vs code to publish to android emulator on host OS
body: <p>I am trying to run a react native docker container on vs code. I am able to run my code. However, the container is not able to detect the android emulator running on my host machine.</p>
  <p><code>I followed along in this tutorial course:</code></p>
  <p><a href="https://code.visualstudio.com/docs/remote/containers" rel="noreferrer">https://code.visualstudio.com/docs/remote/containers</a>
  &amp;
  <a href="https://github.com/microsoft/vscode-react-native" rel="noreferrer">https://github.com/microsoft/vscode-react-native</a></p>
  <p>On running</p>
  <blockquote>
  <p>npx react-native run-android
  however, I get an error message that my emulator is not running. error
  Failed to install the app. Make sure you have an Android emulator
  running or a device connected. Run CLI with --verbose flag for more
  details. Error: Command failed: ./gradlew app:installDebug
  -PreactNativeDevServerPort=8081</p>
  </blockquote>
  <p>My devcontainer.json:-</p>
  <pre><code>{
      &quot;name&quot;: &quot;React Native Android Container&quot;,
    
      // Sets the run context to one level up instead of the .devcontainer folder.
      &quot;context&quot;: &quot;..&quot;,
    
      // Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
      &quot;dockerFile&quot;: &quot;Dockerfile&quot;,
    
      &quot;runArgs&quot;: [
          &quot;--privileged&quot;, // give all capabilities to a container, in other words, the container can then do almost everything that the host can do
          &quot;--net&quot;,
          &quot;host&quot;, // forwarding all host machine ports
          &quot;-v&quot;,
          &quot;/dev/bus/usb:/dev/bus/usb&quot; // mount connected USB devices to a container
        ],
      
    
      &quot;settings&quot;: {
        // This will ignore your local shell user setting for Linux since shells like zsh are typically
        // not in base container images. You can also update this to an specific shell to ensure VS Code
        // uses the right one for terminals and tasks. For example, /bin/bash (or /bin/ash for Alpine).
        &quot;terminal.integrated.shell.linux&quot;: null
      },
    
      // Add the IDs of extensions you want to be installed when the container is created in the array below.
      &quot;extensions&quot;: [&quot;msjsdiag.vscode-react-native&quot;]
    }
  </code></pre>
  <p>the runArgs &quot;host&quot; is supposed to forward all ports. I think I need a similar argument in the reverse direction?</p>