Mosquitto and home-assistant in docker on same server

I know, not exactly a home-assistant problem, but as many here might use a similiar configuration, I would like to ask here.

Setup: mosquitto and home-assistant are running in two different docker container on a host machine with ubuntu.

In home-assistant, I have to use the IP of the mosquitto container in internal docker network. That seems to change when the mosquitto container is updated, so the connection is lost.

Thats really awful.

$ docker inspect mosquitto | grep IPAddress
            "SecondaryIPAddresses": null,
            "IPAddress": "",
                    "IPAddress": "172.18.0.9",

I would like to use the IP of the server, like I am using mqtt explorer on my notebook. I remember it used to work like this, also with openhab.

I tried to run both container in different networks, but that does not seem to help.
Right no, i both start them with the ENV --network=mynetwork

Does anyone know a solution to this?