Skip to content

using wrong port in WSL #168

@johrstrom

Description

@johrstrom

I have a project using a configuration below to use port 2222 instead of port 22. I currently use WSL to do local development (it works on through the github CI).

Currently when I run this on WSL, it tries to use port 22 instead of port 2222.

    docker_port_bindings:
      22/tcp:
        - HostPort: '2222'
          HostIp: '127.0.0.1'

If I comment out the || ENV.fetch('WSLENV', nil) statement below it works fine.

def nested_docker?
ENV['DOCKER_IN_DOCKER'] || ENV.fetch('WSLENV', nil)
end

I'm not 100% sure why WSL is being treated as the same as nested docker, but I don't think it should be. Seems to me that you should have a wsl? check for IP issues specifically.

Happy to try to supply a patch, but I'm not clear on what #56 solved.

Expected behavior
When specifying HostPort 2222, it should use port 2222.

Actual behavior
It continues to use port 22 instead of 2222.

Versions tested
2.6.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions