now that some of my server applications are packed into Docker containers, I'm trying to deploy them on my production servers. My containers should be accessible by IPv4 and IPv6 at the same time. Usually that is no problem: If you map container ports to host ports e.g. via docker-compose, Docker will use available IPv6 and IPv4 addresses.
My problem is: There is not only one IPv4 and IPv6 address available on my server, but multiple. My application container should only use one specific IPv4 address and one specific IPv6 address of the host. You can bind a container port to a IPv4-address by using the following docker-compose syntax:
ports: - "127.0.0.1:8001:8001"
Unfortunately I couldn't find any information how to do that with IPv6 addresses. Is there any way I can bind a container port to a single, specific IPv6 address on my Docker host?