我试图找到使用示例" internal"在docker-compose.yml v2中使用网络声明的属性。
换句话说,我搜索如何做到这一点:
docker network create someName --internal
但在docker-compose.yml。
尝试使用此变体时出错:
version: '2'
services:
# services definition
networks:
someName:
internal: true
错误讯息:
The Compose file '.\docker-compose.yml' is invalid because:
networks.someName value Additional properties are not allowed ('internal' was unexpected)
答案 0 :(得分:3)
升级到docker-compose 1.9或更高版本,内部网络是docker-compose.yml的新功能。