Can't Connect to Local UDP Publishing Application

Hello everyone!

I have a weird issue. I have a binary that polishes UDP packets on a specific port and a python script that reads these udp packets. I’d like to run them both inside of a balena container.

This works fine if I SSH in and manually start the binary. However, if I start the binary from a start.bash script run by the docker file, I’m not able to bind to the port.

Any ideas why this might be?

What error/message do you get when binding from the script?

start.bash script run by the docker file,

Oh wait – RUN commands run during build time, on the builder (or your computer if using the CLI) so that obviously won’t work. Change RUN to CMD or ENTRYPOINT and it should work.

The start script uses the CMD entry point and I’ve verified the server binary is indeed running on the deployed balena host.

I don’t receive any error from the Python exception handler, I just never receive any data. However, when I use the same script and start the server binary manually from within the container, everything works fine.

Do I need to deal with any firewall rules or anything that would prevent localhost traffic?

Hey Keenan, if your application is working when you SSH into the container and execute the script then there’s not further configuring of the network required. To me it sounds like the script that emits packets isn’t starting. Is this running in 1 container or 2 ? Can you share your dockerfile that starts the script ? Feel free to remove or rename anything. I’ll just like to see the commands.