[Docker] Driver Bridge network for linking containers
In previous postwe have seen how to link two container together by using `--link`:
# docker run -d --name my-mongodb mongo
# docker run -d -p : --link my-mongodb:mongodb --name nodeapp danwahlin/node
In this poist, we are going to see how to create brige network, and link contianer inside network.
First, we can create a network:
docker network create --driver bridge isolated_network
We can inspect our network:
docker network inspect isolated_network
Once we add container into network, this command is helpful.
Run the MongoDB container and link it into network, also give it a name 'mongodb'
docker run -d --net=isolated_network --name mongodb mongo
Run the nodejs container and link it to network, also give it a name 'nodeapp':
docker run -d -p : --net=isolated_network --name nodeapp danwalin/node
Linking container into network is useful for tow or three containers, but once we have more containers, it is not convenient to write so many command lines to get job done. Instead we can use Docker Compose for this task.
[Docker] Driver Bridge network for linking containers的更多相关文章
- Linking Containers Together
Linking Containers Together In the Using Docker section we touched on connecting to a service runnin ...
- Docker Libnetwork Bridge插件实现代码分析----创建网络部分
// drivers/bridge/bridge.go // Create a new network using bridge plugin 1.func (d *driver) CreateNet ...
- Docker Libnetwork Bridge插件实现代码分析----初始化部分
Bridge driver数据结构如下所示: type driver struct { config *configuration network *bridgeNetwork natChain *i ...
- 记一次 Docker swarm - overlay network access error
背景 之前使用Docker swam 在不同的服务器 (docker host) 上面创建了service,他们之间的container通过overlay的网络通信. 昨天由于公司网络维护,其中一台服 ...
- Docker的bridge和macvlan两种网络模式
项目上部署的Docker集群创建的容器网络遇到问题,借机会学习了一下docker的网络模式,其他类型我们用的不多,这里只列举我们常用的bridge和macvlan两种,下面的描述和截图有一些是直接从网 ...
- docker学习之network:初识网络配置
起因 我的开发环境需要一个python代码运行环境.reids服务和mysql服务. 由于以前,我的开发环境是mac,而CI和线上运行环境是centos,偶尔会出项本地单元测试跑不过,而CI可以过.这 ...
- Docker实践(4)—network namespace与veth pair
network namespace 创建network namespace # ip netns add blue # ip netns list blue 添加网口到namespace 先创建v ...
- docker stack删除network失败
现象描述 删除stack的时候没太多提示,但再启动相同的stack会报错,提示网络创建失败:随后使用network ls命令可以看到之前的network还在: 使用docker network rm还 ...
- Docker 错误:network xxx id xxxx has active endpoints
问题描述:Docker Compose 部署的项目,使用docker-compose down 命令关闭时,提示错误: Removing network xxxl_default ERROR: net ...
随机推荐
- SGU 275. To xor or not to xor (高斯消元法)
题目链接:http://acm.sgu.ru/problem.php?contest=0&problem=275 题意:给你n个数,可以选择任意个数异或,但是要使得最后的异或值最大. 我们把每 ...
- swddude -- A SWD programmer for ARM Cortex microcontrollers.
Introducing swddude I love the ARM Cortex-M series of microcontrollers. The sheer computational po ...
- perl解析xml-XML::Simple/XMLin
转自: http://blog.charlee.li/perl-xml-simple/ [Perl]用XML::Simple解析XML文件 在Perl中解析XML的方法最常见的就是使用 XML::DO ...
- DTrace memory leak 内存泄露
http://blog.sina.com.cn/s/blog_538040b70100eecn.html 如下程序用于跟踪,在分配和回收都会触发探针 #!/usr/sbin/dtrace -s p ...
- [Node.js]操作mysql
摘要 上篇文章介绍了node.js操作redis的简单实例,这里介绍如何操作mysql. 安装 安装mysql模块 cnpm install mysql 一个例子 新建一个mysql.js的文件,代码 ...
- 无法打开物理文件 XXX.mdf",操作系统错误 5:"5(拒绝访问。)"的解决办法
http://blog.csdn.net/blackfield/article/details/6550499 用T-SQL命令附加数据库时,出现如下异常信息: 无法打开物理文件 XXX.mdf&qu ...
- AutoMapper在MVC中的运用02-Decimal转String、集合、子父类映射
本篇AutoMapper使用场景: ※ Decimal转换成String类型 ※ 源数组转换成目标数组 ※ 源中的集合(数组)属性转换成目标中的集合(数组)属性 ※ 子类父类间的映射 Decimal转 ...
- A股和B股票的区别?
一.A股和B股的区别——概念不同 (一).A股的概念A股是由中国境内的公司发行,正式名称是人民币普通股票,供境内机构.组织或个人(从4月1日起,境内港.澳.台居民可开立A股账户)以人民币认购和交易的普 ...
- firedac调用ORACLE的存储过程
firedac调用ORACLE的存储过程 EMB官方原文地址:http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Using_Oracle_with_F ...
- 移动web前端小结
原文地址:http://blog.csdn.net/small_rice_/article/details/22690535 在智能手机横行的时代,作为一个web前端,不会编写移动web界面,的确是件 ...