我试图在 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)