Here's my docker-compose.yml file:
version: '3.1' services: a: image: tutum/hello-world b: image: tutum/hello-world secrets: id: my_password
If I run $ docker-compose-up
I get this:
Version in "./docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version.
My docker-compose version:
$ docker-compose --version docker-compose version 1.11.0, build 6de1806
What's wrong here? Shouldn't my docker-compose version support v3.1 of the docker-compose.yml specification (according to the release notes, it does) ?
How to fix: Version in "./docker-compose. yml" is unsupported. You can fix this issue by upgrading docker-compose to the newest version (just download the new script from the install section). Make sure you uninstall the any previous apt package before coping the script via curl sudo apt remove docker-compose .
The Compose file is a YAML file defining services, networks, and volumes for a Docker application. The latest and recommended version of the Compose file format is defined by the Compose Specification. The Compose spec merges the legacy 2.
The latest Compose file format is defined by the Compose Specification and is implemented by Docker Compose 1.27. 0+. Looking for more detail on Docker and Compose compatibility?
You are doing everything right and it should work. But there was a bug in docker-compose 1.11.0 which not recognized file format 3.1 as valid. (3.0 works).
There is already a new release of docker-compose (1.11.1) which includes the bugfix:
Bugfixes
Fixed a bug where the 3.1 file format was not being recognized as valid by the Compose parser
So I would recommend to upgrade your docker-compose version if you want to use file format 3.1.
At the moment the safest way to upgrade docker-compose is by deleting it and reinstalling it.
rm /usr/local/bin/docker-compose
Reinstall:
curl -L https://github.com/docker/compose/releases/download/1.11.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose docker-compose --version docker-compose version 1.11.1, build 7c5d5e4
Now there isn't an error anymore on the file format. (I did not test with your .yml).
docker-compose up Starting compose_a_1 Starting compose_b_1
I have resolved the issue by upgrading docker-compose.
Follwed below steps to upgrade docker-compose in ubuntu16.04
step1:
$which docker-compose /usr/bin/docker-compose
step2:
$sudo rm /usr/bin/docker-compose
step3:
curl -L https://github.com/docker/compose/releases/download/1.20.0/docker-compose-`uname -s`-`uname -m` -o /usr/bin/docker-compose
step4:
chmod +x /usr/bin/docker-compose
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With