
7

docker-compose修改网络映射信息
source link: https://www.wencst.com/archives/767
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

docker-compose修改网络映射信息
depends_on
用于指定服务依赖,一般是mysql、redis等。
指定了依赖,将会优先于服务创建并启动依赖。
links
也可以指定依赖。
external_links
链接搭配docker-compose.yml
文件或者Compose
之外定义的服务,通常是提供共享或公共服务。格式与links
相似:
external_links:
- redis_1
- project_db_1:mysql
- project_db_1:postgresql
注意,
external_links
链接的服务与当前服务必须是同一个网络环境。
extra_hosts
添加主机名映射。
extra_hosts:
- "somehost:162.242.195.82"
- "otherhost:50.31.209.229"
将会在/etc/hosts
创建记录:
162.242.195.82 somehost
50.31.209.229 otherhost
如果文章对您有用,扫一下支付宝的红包,不胜感激!
欢迎加入QQ群进行技术交流:656897351(各种技术、招聘、兼职、培训欢迎加入)
Leave a Reply Cancel reply
You must be logged in to post a comment.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK