Skip to content

Commit

Permalink
gvproxy: add docker.internal dns entries
Browse files Browse the repository at this point in the history
Some tools hard code the `host.docker.internal` dns name so it is not
possible to run them with podman right now. Adding the entry is simple
so we should support it for better compatibility.

Also remove the comment that podman depends on crc.testing, it does not
for a long time now. But because I do not know if crc needs it I left it
in there.

see containers/podman#19361

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
  • Loading branch information
Luap99 committed Aug 1, 2023
1 parent db60882 commit 28daf7b
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions cmd/gvproxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ var (
const (
gatewayIP = "192.168.127.1"
sshHostPort = "192.168.127.2:22"
hostIP = "192.168.127.254"
host = "host"
gateway = "gateway"
)

func main() {
Expand Down Expand Up @@ -187,25 +190,38 @@ func main() {
Name: "containers.internal.",
Records: []types.Record{
{
Name: "gateway",
Name: gateway,
IP: net.ParseIP(gatewayIP),
},
{
Name: "host",
IP: net.ParseIP("192.168.127.254"),
Name: host,
IP: net.ParseIP(hostIP),
},
},
},
{
Name: "crc.testing.", // still used by current version of podman machine CNI
Name: "docker.internal.",
Records: []types.Record{
{
Name: "gateway",
Name: gateway,
IP: net.ParseIP(gatewayIP),
},
{
Name: "host",
IP: net.ParseIP("192.168.127.254"),
Name: host,
IP: net.ParseIP(hostIP),
},
},
},
{
Name: "crc.testing.",
Records: []types.Record{
{
Name: gateway,
IP: net.ParseIP(gatewayIP),
},
{
Name: host,
IP: net.ParseIP(hostIP),
},
},
},
Expand All @@ -215,9 +231,9 @@ func main() {
fmt.Sprintf("127.0.0.1:%d", sshPort): sshHostPort,
},
NAT: map[string]string{
"192.168.127.254": "127.0.0.1",
hostIP: "127.0.0.1",
},
GatewayVirtualIPs: []string{"192.168.127.254"},
GatewayVirtualIPs: []string{hostIP},
VpnKitUUIDMacAddresses: map[string]string{
"c3d68012-0208-11ea-9fd7-f2189899ab08": "5a:94:ef:e4:0c:ee",
},
Expand Down

0 comments on commit 28daf7b

Please sign in to comment.