【问题标题】:Vagrant with Docker Provider requires RSync Password带有 Docker Provider 的 Vagrant 需要 RSync 密码
【发布时间】:2015-07-24 14:44:33
【问题描述】:

使用 docker 提供程序启动 vagrant (up) 会产生 rsync 问题,因为 rsync 尝试与 docker 用户同步并询问我的密码,我当然没有。如果我用 vm.box 交换 docker 提供程序,一切都很好。 我收到的消息是:

WDFM32388067A:vagranttest d022051$ vagrant up
Bringing machine 'default' up with 'docker' provider...
==> default: Docker host is required. One will be created if necessary...
    default: Docker host VM is already ready.
==> default: Syncing folders to the host VM...
    default: The machine you're rsyncing folders to is configured to use
    default: password-based authentication. Vagrant can't script rsync to automatically
    default: enter this password, so you'll likely be prompted for a password
    default: shortly.
    default: 
    default: If you don't want to have to do this, please enable automatic
    default: key insertion using `config.ssh.insert_key`.
    default: Rsyncing folder: /Users/d022051/tmp/vagranttest/ => /var/lib/docker/docker_1437748320_29948
docker@127.0.0.1's password: 
There was an error when attempting to rsync a synced folder.
Please inspect the error message below for more info.

Host path: /Users/d022051/tmp/vagranttest/
Guest path: /var/lib/docker/docker_1437748320_29948
Command: rsync --verbose --archive --delete -z --copy-links --no-owner --no-group --rsync-path sudo rsync -e ssh -p 2222 -o StrictHostKeyChecking=no -o IdentitiesOnly=true -o UserKnownHostsFile=/dev/null --exclude .vagrant/ /Users/d022051/tmp/vagranttest/ docker@127.0.0.1:/var/lib/docker/docker_1437748320_29948
Error: Warning: Permanently added '[127.0.0.1]:2222' (RSA) to the list of known hosts.
Connection closed by 127.0.0.1
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(226) [sender=3.1.1]

这是 Vagrant 配置中的相关部分:

  config.vm.provider "docker" do |d|
    d.image = "bowline/orientdb:dev"
  end

  config.vm.synced_folder ".", "/vagrant", type: "rsync"

docker 用户有默认密码吗?我必须在我的 docker 映像中创建 docker 用户吗?

更新: 重新启动我的 Mac 后,问题得到了转变。现在的问题是 vagrant 尝试在 VM 上安装 rsync 并失败。因此,请考虑关闭此问题,因为我目前无法重现原始问题。

【问题讨论】:

  • 密码对任何感兴趣的人来说都是“tcuser”

标签: docker vagrant rsync


【解决方案1】:

使用 Vagrant 1.7。 tcuser 与用户名 docker 一起使用

正在使用的盒子hashicorp/boot2docker 是使用此密码构建和配置的

https://github.com/mitchellh/boot2docker-vagrant-box/blob/master/template.json#L18

【讨论】:

猜你喜欢
  • 2015-10-20
  • 1970-01-01
  • 2016-10-16
  • 1970-01-01
  • 1970-01-01
  • 2014-12-01
  • 1970-01-01
  • 2016-08-24
  • 1970-01-01
相关资源
最近更新 更多