docker - 如何在 docker compose 中禁用外部网络调用?
问题描述
我正在针对(目前)通过 Internet 对其他服务进行外部网络调用的大型遗留服务运行一组测试。
该项目的目标是将这些外部服务模拟为同一docker-compose
网络中的其他 docker 容器。其中一些服务是我们组织运行的微服务,其他服务是第三方供应商。
我们正在记录外部调用以识别该服务正在调用哪些外部端点,并相应地模拟这些调用。但是因为我将把它放在 CI 中,并且这个服务在一个大型组织中有很多贡献者,我想通过将整个docker-compose
网络与互联网隔离来强制不调用任何外部服务。
Short of turning off my wifi, How can I disable external calls from these services, while still allowing services in the same docker network to communicate with each other?
The options given here: https://docs.docker.com/network/#network-drivers do not seem to be what I want.
We use CircleCI, so if there is a solution within that configuration thats fine. I just haven't found anything related to that in those docs either, and would prefer a docker-compose
solution so I can test it locally.
解决方案
推荐阅读
- python - 使用 boto3 在 python 中的单独行中打印每条输出记录
- c# - 错误:50 - 发生本地数据库运行时错误。指定的 LocalDB 实例名称在 JETBRAIN RIDER 上无效
- python - 如何将响应大小应用于 Django imagekit 中的图像
- openshift - openshift online pro 的部署历史很短
- image-processing - 如何用网格分割图像并保留透明度边界框
- asp.net-mvc - ADFS 3.0 依赖方令牌签名证书
- javascript - 查找数组的子对象
- maven - Maven:如何从命令行将 artifactItems 配置传递给依赖副本插件?
- objective-c - Layer-Backed NSControl 仍然调用 NSCell 绘图例程
- c - 无锁栈实现思路——目前已失效