ERROR: Version in "./docker-compose.yml" is invalid. Either specify a version of "2" (or "2.0") and place your service definitions under the services key, or omit the version key and place your service definitions at the root of the file to use version 1.
[root@localhost course2]# docker-compose -v
docker-compose version 1.7.0, build 0d7bf73
[root@localhost course2]# docker-compose down && docker-compose up -d
ERROR: Version in "./docker-compose.yml" is invalid. Either specify a version of "2" (or "2.0") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/
[root@localhost course2]# curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 638 100 638 0 0 400 0 0:00:01 0:00:01 --:--:-- 400
34 11.2M 34 3943k 0 0 5294 0 0:36:59 0:12:42 0:24:17 0
curl: (56) OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 104
[root@localhost course2]# docker-compose down && docker-compose up -d --build 2.0
[30751] Cannot open self /usr/local/bin/docker-compose or archive /usr/local/bin/docker-compose.pkg
[root@localhost course2]# curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 638 100 638 0 0 425 0 0:00:01 0:00:01 --:--:-- 425
100 11.2M 100 11.2M 0 0 15073 0 0:12:59 0:12:59 --:--:-- 17374
[root@localhost course2]# docker-compose -v
docker-compose version 1.23.2, build 1110ad01
阿里云的LINUX中安装办法
[root@xgblog ~]# yum install docker-compose -y
. . .
Complete!
[root@xgblog ~]# docker-compose -v
bash: /usr/local/bin/docker-compose: Permission denied
[root@xgblog ~]# chmod +x /usr/local/bin/docker-compose
[root@xgblog ~]# docker-compose -v
docker-compose version 1.23.2, build 1110ad01
不行的话再加软链
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose