docker-compose报错,/usr/local/bin/docker-compose: line 1: $‘\r‘: command not found ,重新安装docker即可

[root@centos7 compose]# docker-compose --version
/usr/local/bin/docker-compose: line 1: $'\r': command not found
/usr/local/bin/docker-compose: line 2: html: No such file or directory
/usr/local/bin/docker-compose: line 3: head: No such file or directory
/usr/local/bin/docker-compose: line 4: meta: No such file or directory
/usr/local/bin/docker-compose: line 5: title: No such file or directory
/usr/local/bin/docker-compose: line 5: middot: command not found
/usr/local/bin/docker-compose: line 5: /title: No such file or directory
/usr/local/bin/docker-compose: line 6: meta: No such file or directory
/usr/local/bin/docker-compose: line 7: style: No such file or directory
/usr/local/bin/docker-compose: line 8: body: command not found
/usr/local/bin/docker-compose: line 9: background-color:: command not found
/usr/local/bin/docker-compose: line 10: syntax error near unexpected token `('
'usr/local/bin/docker-compose: line 10: `        color: rgba(0, 0, 0, 0.5);

下载最新版的docker-compose文件

sudo curl -L https://github.com/docker/compose/releases/download/1.16.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose

添加可执行权限

sudo chmod +x /usr/local/bin/docker-compose

查看版本

docker-compose --version

docker-compose version 1.16.1, build 1719ceb

你可能感兴趣的:(报错解决,docker,容器,运维)