Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker-compose does not install or run properly on boot2docker

I have successfully installed docker-machine on my Windows computer, and I'm able to use the Docker CLI on my windows box to run docker commands on a boot2docker VM.

I have docker-machine version 0.2.0, and docker 1.6.2, and the VM yields "4.0.3-boot2docker" when I run "uname -r" on it.

Now I want to install docker-compose to manage that boot2docker VM. Does docker-compose run on my Windows machine and manage the VM "remotely", as docker does, or do I have to install it on the VM itself?

On a related note, I tried installing docker-compose on my VM by doing the following:

C:\ docker-machine ssh dev
$ whoami
docker
$ sudo -i
# curl -L https://github.com/docker/compose/releases/download/1.2.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
# chmod +x /usr/local/bin/docker-compose
# exit
$ which docker
/usr/local/bin/docker
$ which docker-compose
/usr/local/bin/docker-compose

This is fine, but when I try to run docker-compose it doesn't work.

$ docker-compose up
-sh: docker-compose: not found

The file is in /usr/local/bin, and it has exactly the same privileges as docker.

docker@dev:/usr/local/bin$ ls -al do*
-rwxr-xr-x    1 root     root      15443675 May 13 21:24 docker
-rwxr-xr-x    1 root     root       5263681 May 19 00:09 docker-compose
docker@dev:/usr/local/bin$

Is there something I'm missing?

like image 444
Jay Godse Avatar asked Dec 20 '25 14:12

Jay Godse


2 Answers

Have a good look at the curl output. It seems that the download url is not valid anymore. I found that

curl -L https://github.com/docker/compose/releases/download/1.2.0/docker-compose-Linux-x86_x64

gave

{"error":"Not Found"}

For me, the current release 1.3.2 worked well, i.e.:

curl -L https://github.com/docker/compose/releases/download/1.3.2/docker-compose-Linux-x86_x64

NOTE: When using on current CoreOS don't try to output in /usr/local/bin/docker-compose as noted here. Instead use /opt/bin/docker-compose (dir may need to be created first), i.e.

mkdir -p /opt/bin
curl -L https://github.com/docker/compose/releases/download/1.3.2/docker-compose-Linux-x86_x64 > /opt/bin/docker-compose
like image 94
mkoertgen Avatar answered Dec 22 '25 12:12

mkoertgen


I found that the download links don't work for older versions and the "install" fails silently resulting in the problem you describe. Have a look to find a download link to a current version here:

https://github.com/docker/compose/releases

Like mkoertgen said, you can always view the output from the curl command in the terminal to see that you don't get "not found" or something similar or run cat /usr/local/bin/docker-compose to verify that it's not a textfile containing "not found".

like image 45
Johan Avatar answered Dec 22 '25 14:12

Johan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!