1、systemctl stop docker
2、find / -name hostconfig.json
3、cd *
4、vim hostconfig.json
5、找到“PortBindings”字段,如下所示:
"PortBindings":{
"80/tcp": [{ //容器内端口
"HostIp": "",
"HostPort": "82" //宿主机端口
}]
}
6、修改对应端口号
7、systemctl daemon-reload
8、systemctl start docker