How to use docker to make a mirror image of port forwarding?

  docker, question

For example, I want to forward the local 8080 port to the local 9090 port. How is this encapsulated? Ports are all forwarded between host computers and do not need to be forwarded to the container. A common scenario is to forward the database port of the intranet to the public network.

Your description is really a bit confusing. The local port is forwarded to the local port. What is this “local” designation, container or host?

For container port mapping to sink host, can’t the -p parameter be easily implemented?
docker run … -p 13306:3306 mysql
This maps the 3306 port of the container MySQL service to the 13306 port of the host. External access port 13306 can connect to the database.