Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(macOS): Support host DNS aliases for macos #1085

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

Kern--
Copy link
Contributor

@Kern-- Kern-- commented Sep 4, 2024

Issue #, if available:
macOS portion of #1079

Description of changes:
This change adds:

  1. host.finch.internal
  2. host.docker.internal

as DNS names that are aliased to the host's loopback address. This allows service and containers inside the VM to connect to services bound to the host's loopback device.

Testing done:
main.go

package main

import "net/http"

func main() {
        http.HandleFunc("/hello", func(w http.ResponseWriter, r *http.Request) {
                w.Write([]byte(`{"response": "ok"}`))
        })
        http.ListenAndServe(":8080", nil)
}
$ go run main.go

in another shell

$ limactl shell finch
$ curl host.finch.internal:8080/hello
{"response": "ok"}
$ curl host.docker.internal:8080/hello
{"response": "ok"}

  • I've reviewed the guidance in CONTRIBUTING.md

License Acceptance

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

pendo324
pendo324 previously approved these changes Sep 9, 2024
chews93319
chews93319 previously approved these changes Sep 9, 2024
Copy link
Member

@austinvazquez austinvazquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can a e2e test be added to run a container and ping the DNS aliases here?

@Kern-- Kern-- dismissed stale reviews from chews93319 and pendo324 via 7200108 September 30, 2024 17:29
@Kern-- Kern-- force-pushed the macos-host-services branch 4 times, most recently from d79d5dd to 3eecd69 Compare September 30, 2024 19:06
This change adds:
1) `host.finch.internal`
2) `host.docker.internal`

as DNS names that are aliased to the host's loopback address. This allows
service and containers inside the VM to connect to services bound to the host's
loopback device.

Signed-off-by: Kern Walster <walster@amazon.com>
@pendo324 pendo324 merged commit 6b7f053 into runfinch:main Oct 1, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants