I am trying to use Vagrant with docker provider on windows machine. I have Vagrantfile like this:
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'docker'
Vagrant.require_version ">= 1.6.0"
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define "app" do |app|
app.vm.provider "docker" do |d|
d.name = "app"
d.build_dir = "."
d.vagrant_machine = "dockerhost"
d.vagrant_vagrantfile = "./DockerhostVagrantfile"
end
end
end
Docker host definition like this:
Vagrant.configure("2") do |config|
config.vm.synced_folder ".", "/vagrant", type: "smb"
config.vm.provision "docker"
config.vm.define "dockerhost"
config.vm.box = "ubuntu/trusty64"
config.vm.network "forwarded_port",
guest: 8080, host: 8080
config.vm.provider :virtualbox do |vb|
vb.name = "dockerhost"
end
end
And Docker container like this:
FROM ubuntu:14.04
WORKDIR /vagrant/application
# .... install stuff
EXPOSE 8080
CMD ["/bin/bash"]
The problem is whenever I do vagrant docker-run app -- bash
and dockerimage has to be rebuild the process takes soo long.
// ....
app: Sending build context to Docker daemon 180.5 MB
app: Sending build context to Docker daemon 181 MB
app: Sending build context to Docker daemon 181.6 MB
// ....
I think this is because folder inside dockerhost
is mount with vboxfs
(which I found terribly slow).
Is there any way I can enforce Vagrant to use smb
?
Is problem with performance caused by anything else?