By following the examples in the documentation page, I have the following block in my docker-compose.yml
file:
networks:
default:
driver: overlay
But when I try to do docker-compose build
, I got this error:
Unsupported config option for services.networks: 'default'
What does this mean? the version of my docker-compose is 1.8.1 by the way. Thanks
I had the same error, using docker-compose 1.8.1. The problem was that I had not used a version 2 compose file. (Networking is unsupported in v1)
You may find this link helpful. https://docs.docker.com/compose/compose-file/#upgrading
I've had the same issue and I'm using a version 2.1 compose file with docker-compose version 1.9.0, build 2585387
Fixed for me by following the installation instructions at Release 1.9.0 using what the docs there refer to as "the usual commands to install or upgrade Compose."
@charneykaye By direct method I presume you mean compiling from source?
I got the same issue. I'm using docker compose 1.9.0 build 2585387 originally installed with Docker Toolbox (in Windows). I tried to pip uninstall then pip install again but it didn't work out.
Just figured it out for my case now: the top level 'networks' tag must be at the same level as 'services' which means no indentation.
@kabudu I'm referring to the 3rd paragraph of the docs here for Release 1.9.0, which includes an example of using "the usual commands to install or upgrade Compose."
The correct way to use this configuration is like that:
version: '2'
networks:
default:
external:
name: bridge
services:
The networks option need to be at the same level as services is.
Most helpful comment
Just figured it out for my case now: the top level 'networks' tag must be at the same level as 'services' which means no indentation.