# 1、 停止docker服务
systemctl stop 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 
             
           
           
                        
评论区