title: Docker dotnet watch run error: Unable to bind to https://localhost:5000 on the IPv6 loopback interface
body: <p>As the title indicates, i have a container that is unable to bind from host port to container port. I tried searching for similar issues, but have not found any related to using dotnet watch in a docker container since Microsoft introduced the <code>microsoft/dotnet</code> docker repo with dotnet watch built into the sdk image. </p>
  
  <p>Any suggestions as to what i am doing wrong are much appreciated.</p>
  
  <p><strong>Dockerfile</strong></p>
  
  <pre><code>FROM microsoft/dotnet:2.1.301-sdk as build
  ENV DOTNET_USE_POLLING_FILE_WATCHER 1
  WORKDIR /app
  COPY . .
  RUN dotnet restore
  EXPOSE 5000-5001
  ENTRYPOINT [ "dotnet", "watch", "run", "--no-restore"]
  </code></pre>
  
  <p><strong>docker-compose.yml</strong></p>
  
  <pre><code>version: "3"
  
  services:
  
    esportapp:
      container_name: esportapp
      image: esportapp:dev
      build:
        context: .
        dockerfile: Docker/dev.Dockerfile
      volumes:
        - esportapp.volume:/app
      ports:
        - "5000:5000"
        - "5001:5001"
  
  volumes:
    esportapp.volume:
  </code></pre>
  
  <p><strong>Complete error:</strong></p>
  
  <pre><code>esportapp    | Hosting environment: Development
  esportapp    | Content root path: /app
  esportapp    | Now listening on: https://localhost:5001
  esportapp    | Now listening on: http://localhost:5000
  esportapp    | Application started. Press Ctrl+C to shut down.
  esportapp    | warn: Microsoft.AspNetCore.Server.Kestrel[0]
  esportapp    |       Unable to bind to https://localhost:5001 on the IPv6 loopback interface: 'Cannot assign requested address'.
  esportapp    | warn: Microsoft.AspNetCore.Server.Kestrel[0]
  esportapp    |       Unable to bind to http://localhost:5000 on the IPv6 loopback interface: 'Cannot assign requested address'.
  </code></pre>