Dub Nazar
Dub Nazar

Reputation: 532

Docker compose with networks and "internal" property example

I tried to find example of usage "internal" property with a network declaration in docker-compose.yml v2.

Other words I search how to do this:

docker network create someName --internal

but in docker-compose.yml.

I get error when try to use this variant:

version: '2'

services:
# services definition

networks:
  someName:
    internal: true

Error message:

The Compose file '.\docker-compose.yml' is invalid because:
networks.someName value Additional properties are not allowed ('internal' was unexpected)

Upvotes: 3

Views: 6368

Answers (1)

BMitch
BMitch

Reputation: 264986

Upgrade to docker-compose 1.9 or later, internal networks are a new feature of the docker-compose.yml.

Instructions to upgrade are on the compose releases page.

Upvotes: 4

Related Questions