docker – 启动具有多个网络接口的容器

栏目: 编程工具 · 发布时间: 7年前

内容简介:容器启动后,您可以使用“docker network connect”进行操作,但这意味着该进程已经在运行,可能会错过新的.代码日志版权声明:翻译自:http://stackoverflow.com/questions/34110416/start-container-with-multiple-network-interfaces

容器启动后,您可以使用“docker network connect”进行操作,但这意味着该进程已经在运行,可能会错过新的.

这个问题是关于码头和多个网络接口的搜索.虽然不是所需的版本在我离开这里的一些信息:

使用 Docker 1.12,可以向docker容器添加多个网络接口,但首先需要创建容器,然后在启动容器之前附加第二个(和后续的)网络NIC:

$docker create --network=network1 --name container_name containerimage:latest
$docker network connect network2 container_name
$docker start container_name

需要先创建网络:

$docker network create --driver=bridge network1 --subnet=172.19.0.0/24
$docker network create --driver=bridge network2 --subnet=172.19.1.0/24

此外,您可以使用docker运行中的–network = host参数启动Dockerhost网络接口的容器:

$docker run --net=host containerimage:latest

代码日志版权声明:

翻译自:http://stackoverflow.com/questions/34110416/start-container-with-multiple-network-interfaces


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Design and Analysis of Distributed Algorithms (Wiley Series on P

Design and Analysis of Distributed Algorithms (Wiley Series on P

Nicola Santoro / Wiley-Interscience / 2006-10-27 / USD 140.95

This text is based on a simple and fully reactive computational model that allows for intuitive comprehension and logical designs. The principles and techniques presented can be applied to any distrib......一起来看看 《Design and Analysis of Distributed Algorithms (Wiley Series on P》 这本书的介绍吧!

SHA 加密
SHA 加密

SHA 加密工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具