Docker有以下4种网络模式:
· host模式,使用--net=host指定。
· container模式,使用--net=container:NAME_or_ID指定。
· none模式,使用--net=none指定。
· bridge模式,使用--net=bridge指定,默认设置。
host模式,例子:
#避免images中服务的端口与宿主服务器端口重叠。
#-p参数无效
docker run -itd --net=host centos6-ssh-mysql
Docker有以下4种网络模式:
· host模式,使用--net=host指定。
· container模式,使用--net=container:NAME_or_ID指定。
· none模式,使用--net=none指定。
· bridge模式,使用--net=bridge指定,默认设置。
host模式,例子:
#避免images中服务的端口与宿主服务器端口重叠。
#-p参数无效
docker run -itd --net=host centos6-ssh-mysql
转载于:https://my.oschina.net/colin86/blog/2933846