Vagrant – Windows上的Docker提供程序 – Rsync失败

我正在尝试使用Vagrant + Docker (作为一个provdier)为我们的下一个项目设置一个Dev环境。 我正在使用cygwin (使用ssh和rsync软件包)在Windows 8.1操作系统上工作。


Vagrant.configure("2") do |config| config.vm.provider "docker" do |d| d.build_dir = "." end end 


 FROM ubuntu RUN apt-get install -y software-properties-common python RUN add-apt-repository ppa:chris-lea/node.js RUN echo "deb precise universe" >> /etc/apt/sources.list RUN apt-get update RUN apt-get install -y nodejs #RUN apt-get install -y nodejs=0.6.12~dfsg1-1ubuntu1 RUN mkdir /var/www ADD app.js /var/www/app.js CMD ["/usr/bin/node", "/var/www/app.js"] 

stream浪–provider = docker

 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_1461921660147_65487 default: Clearing any previously set network interfaces... default: Preparing network interfaces based on configuration... default: Adapter 1: nat default: Forwarding ports... default: 2375 (guest) => 2375 (host) (adapter 1) default: 22 (guest) => 2222 (host) (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: default: SSH username: docker default: SSH auth method: password default: Machine booted and ready! GuestAdditions versions on your host (5.0.16) and guest (4.3.28 r100309) do not match. The guest's platform ("tinycore") is currently not supported, will try generic Linux method... Copy iso file C:\Program Files/Oracle/VirtualBox/VBoxGuestAdditions.iso into the box /tmp/VBoxGuestAdditions.iso Installing Virtualbox Guest Additions 5.0.16 - guest version is 4.3.28 r100309 mkdir: can't create directory '/tmp/selfgz98727713': No such file or directory Cannot create target directory /tmp/selfgz98727713 You should try option --target OtherDirectory An error occurred during installation of VirtualBox Guest Additions 5.0.16. Some functionality may not work as intended. In most cases it is OK that the "Window System drivers" installation failed. ==> default: Syncing folders to the host VM... default: Installing rsync to the 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: /home/Carles/Environment/ => /var/lib/docker/docker_1461921688_64359 There was an error when attempting to rsync a synced folder. Please inspect the error message below for more info. Host path: /home/Carles/Environment/ Guest path: /var/lib/docker/docker_1461921688_64359 Command: rsync --verbose --archive --delete -z --copy-links --chmod=ugo=rwX --no-perms --no-owner --no-group --rsync-path sudo rsync -e ssh -p 2222 -o StrictHostKeyChecking=no -o IdentitiesOnly=true -o UserKnownHostsFile=/dev/null --exclude .vagrant/ /home/Carles/Environment/ docker@ Error: Warning: Permanently added '[]:2222' (ECDSA) to the list of known hosts. Permission denied, please try again. Permission denied, please try again. Permission denied (publickey,password,keyboard-interactive). rsync: connection unexpectedly closed (0 bytes received so far) [sender] rsync error: error in rsync protocol data stream (code 12) at io.c(226) [sender=3.1.2] 

rsync –version

 rsync version 3.1.2 protocol version 31 Copyright (C) 1996-2015 by Andrew Tridgell, Wayne Davison, and others. Web site: Capabilities: 64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints, socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace, append, ACLs, no xattrs, iconv, symtimes, prealloc rsync comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. See the GNU General Public Licence for details. 

stream浪汉 – 翻版

 Vagrant 1.8.1 


 Versión 5.0.16 r105871 



整个周五我都对这个问题大吵大闹,然后今天发现了一个“Docker Toolbox”( ),让所有的痛苦消失。 它甚至会安装一个轻量级的MSYS Git(为了得到一个bash shell)以及VirtualBox,如果还没有安装的话。

请注意,Docker自己的网页在某种程度上混合了语言。 “Docker Toolbox”将在Windows 7及更高版本上安装。 有一个更新的“Docker for Windows”( ),它是Windows 10 Pro或更好的,并且会阻止你运行任何VirtualBox机器,因为它使用Hyper-V 。

不幸的是,“旧”“docker工具箱”曾经被称为“Docker for Windows”(至less在地方),所以很容易混合消息。 只要注意两种不同的解决scheme(Win 10 Pro +和Hyper-V VirtualBox以及> = Win 7),你很快就会知道任何一个特定的网页实际上正在谈论哪一个。

是的,这是一个在Windows上运行Docker的策略。 我最终放弃了stream浪者。