compose: Encountered Syntax Error while installing Docker-Compose through pip in Ubuntu 14.04 server
@ripcurl00d suggested me to post this here.
Environment Details:
VirtualBox Networking through NAT (adapter 1) and intnet (adapter 2)
Docker Version:
Client:
version: 1.10.2
Server:
version: 1.10.2
I followed the below installation procedure of docker-compose
sudo apt-get update
sudo apt-get install python-pip
pip install docker-compose
docker-compose version
I am facing the below mentioned error while trying to check the installation docker-compose
.
/usr/local/bin/docker-compose: line 1: syntax error near unexpected token 'newline'
/usr/local/bin/docker-compose: line: '<!DOCTYPE html>'
Has anyone encountered this error? How to resolve this?
_
PS: I also tried to install docker-compose
through curl
. Still faced the same error
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 15 (1 by maintainers)
I think I have discovered what causes this, in case anyone else runs into it like myself and those listed here. dnephin might be right as well. However, If you copy and post the command for curl from the site and run it you will download the html page not the executable you need.
Don’t run this: curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s
-
uname -m` -o /usr/local/bin/docker-composeYou need to replace ‘uname -s’ and ‘uname -m’. Those are supposed to pull info about your kernel. That didn’t work for me. So instead just put the file you need this:
curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-Linux-x86_64 -o /usr/local/bin/docker-compose
Then you will be good to go.
I think your downloads are going through a proxy that sent you html instead of the binary you wanted. Use a text editor to look at what’s in the file
/usr/local/bin/docker-compose
, and you’ll see that it’s not a binary.Try
sudo curl -L https://github.com/docker/compose/releases/download/1.19.0-rc2/docker-compose-Linux-x86_64 -o /usr/local/bin/docker-compose
sudo apt install docker-compose
or
sudo curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-Linux-x86_64 -o /usr/local/bin/docker-compose
worked for me
https://dl.bintray.com/docker-compose/master/ I solved it by downloading the file manually and pasting it in folder /usr/local/bin Note rename the file to docker-compose
install on ubuntu 14.04 and meet this problem, and i decide to download docker-compose file manually and move to /usr/local/bin/. and it’s work.