1、systemctl stop docker // 停止docker服务
2、find / -name hostconfig.json // 罗列出所有容器的配置文件
3、cd /docker/containers/hb3clkejfijfaofhdklfadjslj123123k43 // 进入指定容器的目录
4、vim hostconfig.json // 编辑容器的配置文件
5、找到“PortBindings”字段,如下所示:
"PortBindings":{
"80/tcp": [{ //容器内端口
"HostIp": "",
"HostPort": "82" //宿主机端口
}]
}
6、修改对应端口号
7、systemctl daemon-reload
8、systemctl start docker