Compose: Unsupported config option: depends_on

Created on 16 Feb 2016  路  7Comments  路  Source: docker/compose

Even though the latest release mentions depends_on (documented here):

There's a new depends_on option for specifying dependencies between services.

I can't get it to work:

$ docker-compose --version
docker-compose version 1.6.0, build d99cad6
$ docker-compose up
ERROR: Validation failed in file './docker-compose.yml', reason(s):
Unsupported config option for web: 'depends_on'

Here's the relevant section of my docker-compose.yml:

web:
  build: .
  ports:
    - "8010:5000"
  links:
    - db
  depends_on:
    - db-ready

Most helpful comment

You must specify version: '2' on top of the compose file :)

Besides ur compose is not in the newer format, there's an excellent upgrade guide under the release thread.

All 7 comments

You must specify version: '2' on top of the compose file :)

Besides ur compose is not in the newer format, there's an excellent upgrade guide under the release thread.

Ah thanks @Mirabis. I found the upgrade guide. I'm testing that out now. I'll close this once I've confirmed everything works as expected.

@Mirabis @nottrobin I faced the same error while building an image using ansible-container. Here's my container.yml file.

version: "2"
services:
  redis:
    image: redis:3.2
  local_api:
    image: python:2.7
    ports:
      - "9000:9000"
      - "8001:8001"
    links:
      - redis
    depends_on:
      - redis
    command: []
    dev_overrides:
      environment:
        - "DEBUG=1"

registries:
  local:
    url: https://docker-hub.local.io
    namespace: local

I am using it version 2, Could it be something else which I am missing?

@manjitkumar I am facing the same issue, found any solution for this yet?

From the docs: "Links also express dependency between services in the same way as depends_on, so they determine the order of service startup." I would suggest dropping the depends_on entries.

@raj040492 My issue was because of ansible-container as version 0.2 didn't support this param, This works well with ansible-container 0.3.

I had the same problem, adjusted the indentation and it worked...just like that, with version 3.

Was this page helpful?
0 / 5 - 0 ratings