Your description is really hard to understand. The local port is forwarded to the local port. What is this "local" designation, the container or the host?
For mapping the container port to the host, can't the -p parameter be easily implemented? docker run ... -p 13306:3306 mysql Doesn’t this map the 3306 port of the container MySQL service to the 13306 port of the host? External access to port 13306 can connect to the database.
Your description is really hard to understand. The local port is forwarded to the local port. What is this "local" designation, the container or the host?
For mapping the container port to the host, can't the -p parameter be easily implemented?
docker run ... -p 13306:3306 mysql
Doesn’t this map the 3306 port of the container MySQL service to the 13306 port of the host? External access to port 13306 can connect to the database.
As mentioned above, docker supports port mapping from container to host, using the official
-p
或-P
parametersFor details, please refer to the official website instructions: https://docs.docker.com/engin...
As for the local-to-local port mapping you described, it should not be a function of Docker.