As stated in the install instructions here: https://www.home-assistant.io/docs/installation/docker/ and discussed in this forum (Avoid network_mode: host for Docker), net=host is needed in the docker-compose (or whatever you use) to have autodiscovery working.
Curious why it works on your end