问题
执行docker-compose --version查看版本是报错如下
/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);
解决方法
1:卸载docker-compose
sudo rm /usr/local/bin/docker-compose
2:安装命令
sudo curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
3:修改权限
sudo chmod +x /usr/local/bin/docker-compose
4:查看版本
docker-compose --version