修改docker映射端口的步骤
1.停止docker容器
docker stop wd1
2.停止docker服务
systemctl stop docker
3.修改端口(如果config.v2.json有端口也需要修改)
vi /var/lib/docker/containers/421e9867cabc9c0c5066871062170f365786efed42ec50f2fb79c5b32f4b5695/hostconfig.json
"PortBindings":{"443/tcp":[{"HostIp":"","HostPort":"4430"}]
443是docker容器的端口,后面4430是宿主机的端口.
直接更改后保存!
4.启动docker服务
systemctl start docker
5.启动容器
docker start wd1
搞定,成功!