[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 ...
随机推荐
- securecrt中文乱码以及ubuntu设置locale
参考文献 http://wiki.ubuntu.org.cn/%E4%BF%AE%E6%94%B9locale http://www.bootf.com/547.html 强烈建议 ubuntu下面不 ...
- 北大 ACM 分类 汇总
1.搜索 //回溯 2.DP(动态规划) 3.贪心 北大ACM题分类2009-01-27 1 4.图论 //Dijkstra.最小生成树.网络流 5.数论 //解模线性方程 6.计算几何 //凸壳.同 ...
- TFS分布式文件系统
简介 TFS(Taobao !FileSystem)是一个高可扩展.高可用.高性能.面向互联网服务的分布式文件系统,主要针对海量的非结构化数据,它构筑在普通的Linux机器集群上,可为外部提供高可靠和 ...
- AIX 与Linux 中crontab 介绍
AIX 与Linux 中crontab 用法相似,先介绍Linux 中的Crontab 用法,再后介绍AIX 与Linux 的不同之处. 一.Crontab 介绍 crontab命令的功能是在一定 ...
- linux 学习之路(学linux必看)
很多同学接触Linux不多,对Linux平台的开发更是一无所知. 而现在的趋势越来越表明,作为一个优秀的软件开发人员,或计算机IT行业从业人员, 掌握Linux是一种很重要的谋生资源与手段. 下来我将 ...
- iOS用全局宏的概念理解xcode中的设置 preprocessor macros
ios有没有全局宏,或者在工程属性里设置宏? 比如我设置了一个宏叫IOS, 在所有/整个工程的代码里这个宏都是有效的. ------解决方案-------------------- 在工程的设置属性里 ...
- 解决ADB server didn't ACK问题
ADB server didn't ACK | 浏览:7400 | 更新:2013-08-11 21:19 1 2 3 4 5 6 7 分步阅读 当我们通过eclipse开发Android应用时,会连 ...
- Android手机提示“未安装应用程序”
用eclipse调试应用时,遇到了这个问题,网上给出的解决方案倒是挺多,但似乎一个都没奏效,而且我手机也重启了,还是有问题,郁闷ing- 然后看到一篇文章指出,可能不是签名和SD的卡问题,而是我们 ...
- ExtJS 4.2 教程-05:客户端代理(proxy)
转载自起飞网,原文地址:http://www.qeefee.com/extjs-course-5-client-proxy ExtJS 4.2 教程-01:Hello ExtJS ExtJS 4.2 ...
- ntp测试
cmd下 w32tm /stripchart /computer:time1.aliyun.com linux ntpdate ntp1.aliyun.com