Skip to content

Container port binding working randomly #7196

Closed

Description

@hawm
  • I have tried with the latest version of my channel (Stable or Edge)
  • I have uploaded Diagnostics
  • Diagnostics ID: 20FB1524-C53D-4E05-8655-6ED43E68CFEC/20200611200628

Expected behavior

Container listen all my defined ports after start.

Actual behavior

Container ports are listening randomly, like below

  1. all listening
  2. part listening
  3. all not listening

Restart the container will randomly change to one of the states describe above.

Information

  • Windows Version: 10.0.19041 Build 19041
  • Docker Desktop Version: 2.3.1.0(45408)
  • Are you running inside a virtualized Windows e.g. on a cloud server or on a mac VM: Windows WSL 2 backend

Steps to reproduce the behavior

Dockerfile: https://github.com/discourse/discourse_docker/blob/master/image/discourse_dev/Dockerfile
How i boot container: https://github.com/discourse/discourse/blob/master/bin/docker/boot_dev

  1. git clone https://github.com/discourse/discourse.git
  2. run bin/boot_dev to boot container inside repo which be cloned above.
  3. run sudo netstat -tulpn | grep LISTEN or whatever command to check port using you want, you may see one of the states i describe at Actual behavior section above, some ports are not listening at sometime.
  4. restart the container
  5. repeat step 3 to 5

Activity

  1. onomatopellan commented on Jun 12, 2020

    @onomatopellan

    There is a known bug in WSL2 when coming from a shutdown state. Can you restart Windows and see if still happens?

  2. hawm commented on Jun 12, 2020

    @hawm
    Author

    There is a known bug in WSL2 when coming from a shutdown state. Can you restart Windows and see if still happens?

    It's keep happening whatever i restart the Windows or WSL many times. I possible see some similar issues about this but not sure , could you point me out where the known bugs related issue it is?

  3. onomatopellan commented on Jun 12, 2020

    @onomatopellan

    If a restart didn't fix it then is a different issue. Localhost port forwarding fails when Fast Startup is enabled microsoft/WSL#5298

  4. onomatopellan commented on Jun 12, 2020

    @onomatopellan

    If it helps, I can't reproduce the issue in latest insider build 19645. Restarted the container twice.

    Annotation 2020-06-12 135239

  5. hawm commented on Jun 13, 2020

    @hawm
    Author

    But i can reproduce it. And i had disable fast boot by follow microsoft/WSL#5298 (comment)
    image
    image
    image

    And i finally found that the higher ports (>10000) are working well??

  6. onomatopellan commented on Jun 13, 2020

    @onomatopellan

    Ah, that sounds like microsoft/WSL#5306
    What's the output of netsh int ipv4 show excludedportrange protocol=tcp ?

  7. hawm commented on Jun 13, 2020

    @hawm
    Author

    Ah, that sounds like microsoft/WSL#5306
    What's the output of netsh int ipv4 show excludedportrange protocol=tcp ?

    But the ports what i am using for container are not listing by the command output
    image

  8. onomatopellan commented on Jun 13, 2020

    @onomatopellan

    what's the output of netsh int ipv4 show dynamicport tcp ?

  9. hawm commented on Jun 13, 2020

    @hawm
    Author
    Protocol tcp Dynamic Port Range                                                                                        
     ---------------------------------                                                                                       
    Start Port      : 1024                                                                                                  
    Number of Ports : 13977    
    
  10. onomatopellan commented on Jun 13, 2020

    @onomatopellan

    See docker/desktop-feedback#783 (comment)

    Mine:

    Protocol tcp Dynamic Port Range                                                                                        
     ---------------------------------                                                                                       
    Start Port      : 49152                                                                                                  
    Number of Ports : 16384
    
  11. hawm commented on Jun 13, 2020

    @hawm
    Author

    Thanks a lot, it's working now.

  12. onomatopellan commented on Jun 13, 2020

    @onomatopellan

    You're welcome. Just out of curiosity, when was the last time you did a Windows clean install?

  13. hawm commented on Jun 13, 2020

    @hawm
    Author
  14. docker-robott commented on Jul 17, 2020

    @docker-robott
    Collaborator

    Closed issues are locked after 30 days of inactivity.
    This helps our team focus on active issues.

    If you have found a problem that seems similar to this, please open a new issue.

    Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
    /lifecycle locked

  15. locked and limited conversation to collaborators on Jul 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions