Controlling startup order of services -- docker compose parsing error


Hi, I am trying to introduce starting conditions for containers, so that they wait for each other before starting. I am currently doing this with healthchecks.

Here is how my docker-compose.yml looks like:

version: ‘2.1’

build: ./init
test: ./
interval: 20s
timeout: 10s
retries: 10

build: ./network
condition: service_healthy

When pushing this to resin remote, I get

[Error] Could not parse compose file
[Error] Service dependencies must be an array
[Error] Not deploying release.

I tried adding “-” in front of the depending service, but this lead to another parsing error.

I tried this docker compose syntax for a docker container outside resin and it worked. Any idea how to fix this in resin?


Hi @ionita ,

This does look like a syntax error, but I cannot tell with much confidence with the existing formatting.

Could you please upload the docker-compose.yml instead? That way the indentation will be kept and it’ll be easier for us to spot any errors there.



Hi @lekkas,

thanks for the reply! Here is the file (renamed from yml to log, as it was otherwise not possible to upload it):

docker-compose.log (387 Bytes)


I think that behaviour is not yet supported by us. Looking at the cocker compose file reference:

depends_on was added in version 2 of docker compose, that we support, and the condition added in 2.1.

As our docs mention, only the version 2’s array format is supported, and that is without the condition, just as

    build: ./network
      - init

We’ll open an internal issue for this. In the meantime, the Docker documentation has some hints how to use a bit of extra tooling to replicate that behaviour, if I read it well.

Let us know if you tried it out, and whether it works…


Hi @imrehg, thanks for you answer! I did indeed used some wrapper scripts to delay the start of containers, after the example of wait-for-*

command: start-container2

With the healthcheck option I would still have a script executing, maybe it is also a bit more transparent. So looking forward to seeing it supported in the future.


Does the command put in the compose file replace the command in the dockerfile.template?
Or are the separate?

  • "If dockercompose.container1.command then
    • start container1
      • container1.cmd


Also, got this error:

[Error]    Could not parse compose file
[Error]      data/services/camera should NOT have additional properties
[Error]    Not deploying release.

With this compose fragment:

    build: ./Camera
      test: ["CMD", "curl", "-f", "http://barnserv:80"]
      interval: 30s
      timeout: 10s
      retries: 5


The following docker-compose.yml is accepted fine for me:

version: '2.1'
    build: ./Camera
      test: ["CMD", "curl", "-f", "http://barnserv:80"]
      interval: 30s
      timeout: 10s
      retries: 5

Are you sure you specify version: '2.1'?


No, I had version 2.
Is there any reason to specify version 2 vs version 2.1 other than the healthcheck field?

Version 2 examples:



That’s correct, if you do want the healthchecks you will have to specify 2.1 instead of 2.0.

Best regards, Heds