Bootstrap Nodes in Docker-compose network

I use a bootstrap list to connect my nodes. I tested it locally and worked fine. Multiaddr looks like this /ip4/127.0.0.1/tcp/6001/p2p/QmQ1rBEjFckGvbLHFqNBcNt4xbbXjp62bCfo7D3hif3qTU

Now I want to run multiple instances of the services in docker-compose, each is named service-a, service-b, etc.
The multiaddr is now /ip4/service-a/tcp/6001/p2p/QmQ1rBEjFckGvbLHFqNBcNt4xbbXjp62bCfo7D3hif3qTU as docker-compose networking resolves the IPs. However this isn’t working for me. Activating debug for bootstrap gives me:
“libp2p:bootstrap:error Invalid multiaddr”

How do I use the multiaddr correctly in a docker-compose network?

/ip4/service-a/tcp/6001/p2p/QmQ1rBEjFckGvbLHFqNBcNt4xbbXjp62bCfo7D3hif3qTU is invalid because it’s expecting an IP address and not the DNS name.

You should be able to switch ip4 over to dns4 in the bootstrap list, /dns4/service-a/tcp/6001/p2p/QmQ1rBEjFckGvbLHFqNBcNt4xbbXjp62bCfo7D3hif3qTU.

It works now. Thanks for the fast support!