Address binding on AWS fails

I create my host like so:

host, err := libp2p.New(ctx, libp2p.ListenAddrStrings(fmt.Sprintf("/ip4/%s/tcp/%d", ipStr, port)), 
if err != nil {
  logger.Log.Fatal("Could not create p2p host %s", err)

I used locally to create the host and it worked. When I try this on my EC2 machine inside a docker container libp2p binds to an IP address that I can’t find in my AWS console. It’s not the ec2 public nor the private IP and can’t be found in the network interfaces.

If I pass the public or private IP the creation fails with following error:

FATAL Could not create p2p host failed to listen on any addresses: [listen tcp4 bind: cannot assign requested address]

In my docker-compose file I configured the container port (5500) to be mapped to the host port (5500).

Any suggestion how to fix this?

Following the code from this issue:
The node now listens to[randomport], [ip address, that I don’t know]:[randomport] and the ip and port I supplied. Still other nodes can’t connect. I opened the port 5500 on AWS.