Communication between containers running on different hosts

We are trying to do something a little strange,
I would like to know if there are any recommended settings or configurations.

What we are trying to do is first start up a RockyLinux container on each of the different host operating systems.
I am going to install pacemaker in those containers and create a cluster between the containers.

To do this, I want to put Docker in swarm mode and use multi-host networking.
I need to do networking with overlay networking so that the containers can communicate with each other.
I don’t think I will use docker service create in this case.

Sorry, but I want to configure a pacemaker cluster between containers on different host operating systems,
I would like to know if there are any other recommended configurations or settings.

What do you want to achieve? What is pacemaker?

Usually you use docker stack deploy to run a docker-compose.yml file on Docker Swarm, with the additional deploy: section.

Communication can happen over a Docker overlay network, all attached services/containers can connect to each other via service name, load balanced via internal Docker DNS.

Thank you for your answer!

What I want to accomplish is as the title says, with communication between containers running on different hosts,
The reason was to run pacemaker clustering software in a container environment.

Thanks for the information on docker stack deploy.
It was helpful as it was what I expected in terms of using an overlay network.

If you run Docker Swarm, you can create an overlay network which spans across nodes, and you can even attach regular Docker services and containers to it, so they can communicate across nodes as on the same LAN. Docker provides internal DNS to connect via service or container name.

Thanks for the information!
I will continue to try things out.