docker-compose compatibility (short syntax)

we have 3 services with own docker-compose files. Our deployment pipeline (azure devops) combines these 3 docker-compose files into 1 big file. The job uses the long syntax style - so the file looks like something like that:

version: "2.1"
     command: command
     image: image:tag
     - published: 8080
       target: 8080
       protocol: tcp
     command: command
     image: image:tag
     - published: 9090
       target: 9090
       protocol: tcp

the docker-compose file is valid, but I cannot push it with balena-cli - I get an error message - the validation is unhappy with the port settings, but it works, when I change the port configuration to the short syntax

balena push myApp --draft --debug
[debug] new argv=[/usr/local/bin/balena-cli-v12.47.0/balena,/snapshot/versioned-source/bin/balena,push,myApp ,--draft] length=5
[debug] Deprecation check: 0.99850 days since last npm registry query for next major version release date.
[debug] Will not query the registry again until at least 7 days have passed.
[Debug]   Using build source directory: .
[Debug]   Pushing to cloud for fleet: myApp 
/ Packaging the project source...[Debug]   docker-compose.yml file found at "/tmp/test"
- Uploading source package to balenaClouddata/services/app1/ports/0 should be string,number

ValidationError: data/services/app1/ports/0 should be string,number
    at Object.normalize (/snapshot/versioned-source/node_modules/resin-compose-parse/build/compose.js:77:19)
    at createProject (/snapshot/versioned-source/build/utils/compose.js:30:33)
    at getServiceDirsFromComposition (/snapshot/versioned-source/build/utils/compose_ts.js:339:27)

For further help or support, visit:

according to your documentation (docker-compose.yml fields - Balena Documentation), you should support long and short syntax - is that correct? if not, do you plan to support the long syntax? Otherwise, i need to find a way to change the syntax accordingly

used software:

  • docker-compose version 1.29.2
  • balena-cli 12.47.0


Hi there,

Balena currently supports a subset of docker compose V2.1 (You may read more in Multiple containers - Balena Documentation). Ports long syntax is docker-compose V3.2 feature.
I hope that helps!

ok, thx for the info