#Is 0.0.0.0 required for dagger networking?

1 messages · Page 1 of 1 (latest)

brisk cobalt
#

I'm trying to avoid the pop-up on macOS for networking due to 0.0.0.0 and just server on localhost:8000. However, WithExposedPort only takes an int, so I can't provide back 127.0.0.1 as the mapping.

Is it automatically serving based on any internal commands I'm providing? I run mkdocs --dev-address 0.0.0.0:8000 but on my host I don't need that, just localhost/127.0.01. I want to avoid 0.0.0.0 if I can.

Sorry if I'm conflating things, but help me out here as the docs/q&a don't explain if this is a hard requirement for dagger to serve up ports.

cinder nymph
#

yeah when running in the container you need to listen on 0.0.0.0. It's not worth the effort and dark magic to make 127.0.0.1 work. It's a pretty well documented best practice for running services in containers, so I feel the user experience works out

brisk cobalt
#

So that makes sense in the container... but that doesn't answer if on my host macOS I need 0.0.0.0. I know localhost works.

https://www.sheldonhull.com/notes/development/go/http/#anonymous-server

I ran into this with go tests that if don't map the local server to run as 127.0.0.1 then i get this blocking network popup.
I'm confused on the host side why it wouldn't serve from localhost/127.0.0.1, even though inside the container it needs the docker gateway at 0.0.0.0

Anonymous ServerMacOS will throw firewall alerts to allow connectivity every time a binary is run that doesn’t provide the server address.
❌ What throws the error: http.ListenAndServe(":"+port, nil) ✔️ What doesn’t throw an error: http.ListenAndServe("127.0.0.1:"+port, nil) While this might be problematic to iron out as a variable if running ins...