Thanks to visit codestin.com
Credit goes to GitHub.com

Skip to content

devcontainers: host.docker.internal is not properly detected (on Windows) (new configuration required) #8018

@rfay

Description

@rfay

Expected Behavior

devcontainers should work with xdebug

Actual Behavior

At least on Windows with VS Code + devcontainers, ddev does the wrong detection and gets the wrong host.docker.internal, so xdebug doesn't work:

host.docker.internal='172.17.0.1' because IsWSL2 and !IsDockerDesktop; received from 'ip -4 route show default'

As a result, we also see DDEV trying to use wslinfo, which can't work.

This works fine on Codespaces (also devcontainers) because we have a special case for it:

host.docker.internal='172.17.0.1' because IsCodespaces uses 'host-gateway' in extra_hosts

Probably what we need is a more general IsDevcontainers() and codespaces does a superset of that.

Interestingly enough, xdebug works fine in VS Code on macOS:

host.docker.internal='172.17.0.1' because IsLinux uses 'host-gateway' in extra_hosts

Steps To Reproduce

No response

Anything else?

No response

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