【问题标题】:Vagrant with Docker Provider fails with rsync over ssh带有 Docker Provider 的 Vagrant 因 rsync over ssh 而失败
【发布时间】:2015-10-20 01:46:33
【问题描述】:

我在使用 Docker 运行 Vagrant 时遇到问题。问题是共享文件夹的 rsync。

WDFM32388067A:vagranttest d022051$ vagrant up
Bringing machine 'default' up with 'docker' provider...
==> default: Docker host is required. One will be created if necessary...
    default: Vagrant will now create or start a local VM to act as the Docker
    default: host. You'll see the output of the `vagrant up` for this VM below.
    default:  
    default: Importing base box 'hashicorp/boot2docker'...
    default: Matching MAC address for NAT networking...
    default: Checking if box 'hashicorp/boot2docker' is up to date...
    default: Setting the name of the VM: docker-host_default_1438155600426_39792
    default: Clearing any previously set network interfaces...
    default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Forwarding ports...
    default: 2375 => 2375 (adapter 1)
    default: 22 => 2222 (adapter 1)
    default: Running 'pre-boot' VM customizations...
    default: Booting VM...
    default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: docker
    default: SSH auth method: password
    default: Warning: Connection timeout. Retrying...
    default: Machine booted and ready!
==> default: Syncing folders to the host VM...
    default: Installing rsync to the VM...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

rsync --help

Stdout from the command:



Stderr from the command:

sh: rsync: not found

    default: The previous process exited with exit code 1.
    default: The previous process exited with exit code 1.

从错误消息中不清楚是 ssh 还是 rsync 是问题所在。可能是因为 ssh 超时了。我尝试了所有可能的 ssh 选项,但没有任何效果。例如,我设置了一个 config.ssh.private_key_path 但错误消息仍然完全相同。有没有人遇到过类似的问题?

【问题讨论】:

标签: ssh docker vagrant rsync boot2docker


【解决方案1】:

我也被 hashcorp/boot2docker 困住了。迁移到 mitchell/boot2docker 也无济于事,但我发现

https://vagrantcloud.com/dduportal/boxes/boot2docker

运行良好(并且更新)。

【讨论】:

  • 不,rsync 已安装。我在 MacOS 上。 rsync 在 /opt/local/bin 下并且在路径中。
  • 我还创建了一个指向 /bin 的符号链接。没有改变任何东西。
  • 啊,我的错,好像在客户机上找不到 rsync:default: Installing rsync to the VM... The following SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed!
  • 你是如何指定不同的 boot2docker 镜像的?我使用 docker 作为提供者。
  • Nvm,想通了,你需要一个额外的Vagrantfile,其中包含类似于:github.com/mitchellh/vagrant/blob/master/plugins/providers/… 的内容以及你喜欢的图像。最后,您只需要在您的主要Vagrantfile:d.vagrant_vagrantfile = "Vagrantfile-boot2docker" 中包含这一行
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-08-24
  • 2017-06-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-10-08
  • 1970-01-01
相关资源
最近更新 更多