我已经在Windows计算机上成功安装了docker-machine,并且能够在Windows框中使用Docker CLI在boot2docker VM上运行docker命令.
我有docker-machine版本0.2.0和docker 1.6.2,当我在其上运行“ uname -r”时,VM产生“ 4.0.3-boot2docker”.
现在,我想安装docker-compose来管理该boot2docker VM. docker-compose是否像docker一样在Windows机器上运行并“远程”管理VM,还是必须将其安装在VM本身上?
在相关说明中,我尝试通过执行以下操作在虚拟机上安装docker-compose:
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
很好,但是当我尝试运行docker-compose时,它不起作用.
$docker-compose up
-sh: docker-compose: not found
该文件位于/usr/local/bin中,并且具有与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$
有什么我想念的吗?
最佳答案
看看卷曲输出.似乎下载网址不再有效.我找到
curl -L https://github.com/docker/compose/releases/download/1.2.0/docker-compose-Linux-x86_x64
给了
{"error":"Not Found"}
对我来说,当前的release 1.3.2效果很好,即:
curl -L https://github.com/docker/compose/releases/download/1.3.2/docker-compose-Linux-x86_x64
注意:在当前CoreOS上使用时,请勿尝试按照/提示here在/usr/local/bin / docker-compose中输出.而应使用/ opt / bin / docker-compose(可能需要先创建目录).
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