Hi there, I watched the video https://www.youtube.com/watch?v=v7wGMP7XLJo&t=7s and I have a, potentially, silly question:
Is it possible to have a Service defined inside a function that also binds ports to the host?
I tried using the .Up() method (Go SDK) and I see from the logs that the ports should be bound but they are not accessible from the host and the container that uses it with WithServiceBinding, also the call to Up is blocking (not sure if it's my fault) so I also tried to use a goroutine to make it async but without success.
The only thing that I believe might work is to refactor the service definition into a standalone function and chain a dagger call spinup-service up && dagger call do-something-with-service --svc=tcp://....
Am I missing something?
In the video Host-container networking is mentioned so I guess the feature exists but I am doing something wrong ๐
Thanks in advance for your help!
In this demo, Alex will show you how to use service containers in Dagger. He will start with basic services concepts and then show a demo of how to use them.
Want to ask Alex a question about this demo? Join us on Discord Demo Forum: https://discord.com/channels/707636530424053791/1084672593329668187
Resources:
https://docs.dagger.io/757394/...