How to assign docker container's IP address as variable from connection request

Hi all,

My purpose is to build an internal network dynamically from the containers.
Specifically: I created an internal network and launched a container attached to that network and allowed users from outside the network to gain access to this container. Users from outside the local network access this container and continue to send requests to connect to another machine on the same local network. At that time, I created a program that automatically captures the connection request, retrieves the requested container address, and then creates the container assigned to this address.

What I want to ask here is whether there is a way to create a container with an IP address as a corresponding variable resulting from the IP address needed to access the connection request? I want to use the A statement to initialize the container with the variable address as a variable.

Thanks!