Browsing this Thread:   1 Anonymous Users






ubuntu docker IP修改 端口映射修改
#1
Just can't stay away
Just can't stay away


See User information
docker ip 修改
docker 端口映射修改
方法一 重建容器
docker stop test01
docker commit test01 test02
docker run -p 8080:8080 -td test02
docker rm test01


方法二 修改容器配置文件,重启docker服务

docker inspect <container_name>
docker stop <container_name>
snap stop docker
vim 
/var/snap/docker/common/var-lib-docker/containers/<hash_id>/hostconfig.json  //  "PortBindings":{"8090/tcp":[{"HostIp":"127.0.0.1","HostPort":"8090"}]}

snap start docker
docker start 
<container_name>

Posted on: 2021/11/5 11:23
Top








friend links
Themes

(2 themes)
Login
Username:

Password:


Lost Password?
Register now!
Categories
Xoops (11)
--Modules (2)
--Themes (0)
Article (8)