Skip to content

[BUG] host-gateway keyword stopped working #13172

@kale1d0code

Description

@kale1d0code

Description

I have a dev container project which used the host-gateway keyword to populate the name host.docker.internal with the host ip address of the docker engine.

This allowed me to connect services I develop to other services running in their own containers after vscode forwards their ports to the host.

this behaviour no longer works as I am now getting the following from the service I am developing
cause: Error: getaddrinfo ENOTFOUND docker.host.internal
at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:122:26) {
errno: -3008,
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'docker.host.internal'
}
}

I am not sure when this regressed however I have not touched this project for nearly a year

Steps To Reproduce

add the following to your workspace container

    extra_hosts:
    - "host.docker.internal:host-gateway"

and attempt to ping host.docker.internal

No response

Compose Version

v2.39.1

Docker Environment

Client:
 Version:           28.3.3-1
 API version:       1.51
 Go version:        go1.23.11
 Git commit:        980b85681696fbd95927fd8ded8f6d91bdca95b0
 Built:             Wed Jul 16 10:32:48 UTC 2025
 OS/Arch:           linux/amd64
 Context:           default

Server:
 Engine:
  Version:          28.3.3-1
  API version:      1.51 (minimum version 1.24)
  Go version:       go1.23.11
  Git commit:       bea959c7b793b32a893820b97c4eadc7c87fabb0
  Built:            Fri Jul 25 08:13:16 2025
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.28-1
  GitCommit:        b98a3aace656320842a23f4a392a33f46af97866
 runc:
  Version:          1.1.15-1
  GitCommit:        bc20cb4497af9af01bea4a8044f1678ffca2745c
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Anything else?

No response

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