Skip to content

Add host.docker.internal to ContainerMetadataFetcher list of approved hosts #2515

@benkehoe

Description

@benkehoe

ContainerMetadataFetcher currently allows three hosts for container metadata endpoints: 169.254.170.2, localhost, and 127.0.0.1. However, neither localhost or 127.0.0.1 represent the local docker host. Instead, the host's localhost is reachable as host.docker.internal (docs). On Linux, the workaround is to use --network host, but on Mac and Windows this doesn't work (the docker network is always isolated from the host).

host.docker.internal should be added to ContainerMetadataFetcher's list of approved hosts, so that a custom metadata endpoint for testing can be run on the host rather than needing to be run in another container.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cross-sdkfeature-requestThis issue requests a feature.p2This is a standard priority issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions