安装一个应用,文件包中有docker-compose.yml,在使用docker-compose bulid制作镜像时,报错:
ERROR: Version in "./docker-compose.yml
" is unsupported
原因:
docker-compose的版本和 ./docker-compose.yml 要求的版本对应不上查看docker-compose版本
[root@node02 glpi-docker-cn-master]# docker-compose --version
docker-compose version 1.18.0, build 8dd22a9
[root@node02 glpi-docker-cn-master]#
解决:
升级docker-compose
[root@node02 ~]# mv /usr/bin/docker-compose /tmp/
[root@node02 ~]# curl -L https://get.daocloud.io/docker/compose/releases/download/v2.3.4/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 423 100 423 0 0 232 0 0:00:01 0:00:01 --:--:-- 232
100 25.2M 100 25.2M 0 0 5183k 0 0:00:04 0:00:04 --:--:-- 10.0M
[root@node02 ~]# chmod +x /usr/local/bin/docker-compose
[root@node02 ~]# docker-compose version
Docker Compose version v2.3.4
[root@node02 ~]#