Modify container port mapping has been created.
By editor hostconfig.json
to modify the file Docker container port mapping
The file address:/var/lib/docker/containers/[hash_of_the_container]/hostconfig.json
Which hash_of_the_container
is the hash value of the corresponding container you need a complete hash value
View the complete hash value:docker inspect -f {{.ID}} containers_name
Then find the following modifications nodes:
"PortBindings":{}
// 格式如下
"PortBindings":{"8888/tcp":[{"HostIp":"","HostPort":"8888"}]}
Reference article: https://stackoverflow.com/questions/19335444/how-do-i-assign-a-port-mapping-to-an-existing-docker-container