Testproject agent and browserstack local in docker

I’ve been looking at setting up a test agent and browserstack local in docker. My issue is that the two can’t seem to find each other even if I’ve made sure they’re on the same docker network, I can’t find any documentation on how the agent finds browserstack either so I’m not sure if this is even the right approach. If it’s the case that they need to “be on the same machine”, would it be possible to get an image containing both an agent and browserstack local bundeled?