Docker Provisioner is Abnormally Slow?

116 views
Skip to first unread message

Joaquin Menchaca

unread,
Mar 18, 2016, 2:06:32 PM3/18/16
to Vagrant
I was wondering if this was a bug or if this is normal?

Right now, it's taking about 21 minutes to provision a small hello world docker image.  This is not including the 34 seconds it takes to bring up the initial system.  

The initial download takes most of the time, then afterwards, it works fairly quickly.   

Vagrant.configure(2) do |config|

  config.vm.box = "ubuntu/trusty64"

  config.vm.network "forwarded_port", guest: 8080, host: 8080


  config.vm.provision "docker" do |docker|

    docker.build_image "/vagrant", args: "-t web"

    docker.run "web" , args: "-p 8080:8080"

  end

end

Alvaro Miranda Aguilera

unread,
Mar 18, 2016, 5:05:18 PM3/18/16
to vagra...@googlegroups.com
Hello,

You actually measure each stage to find where the system goes slow, and one potential fix is create your own base box that include all the required bits.

mini:t2 kikitux$ time vagrant up --no-provision --provider virtualbox

Bringing machine 'default' up with 'virtualbox' provider...

==> default: Box 'ubuntu/trusty64' could not be found. Attempting to find and install... 

real 5m53.961s

6 minutes to download and create a VM, but no provisioning.


Then you can do  time vagrant reload --provision  to test how long it will take run the provision step


So most of the time is gone installing docker on the VM.


If you use a base box that includes docker, it will be faster.


Alvaro.



--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/c1b3f463-ab4c-4a4c-a033-8982f11d649c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Joaquin Menchaca

unread,
Mar 19, 2016, 4:00:23 PM3/19/16
to Vagrant
I did a time vagrant up --no-provision, and got 34 seconds.

Then when I do a time vagrant provision where Internet has about 50 gb/s down, it takes about 20 minutes each time.  I tried this from two different sides, where I have even faster Internet access, and it is taking an abnormally long time.

I would like to measure how long it takes to just install the docker component.  I think my server component does not take much time to build the docker and run it, as it is just a hello world express application.  

Alvaro Miranda Aguilera

unread,
Mar 20, 2016, 12:54:54 PM3/20/16
to vagra...@googlegroups.com
I will suggest you build your own base box that includes docker and any other package you require.

In that way will be faster.

Have you used packer?


Joaquin Menchaca

unread,
Mar 20, 2016, 5:14:28 PM3/20/16
to Vagrant
I could do that.  I was using the base box provided by Ubuntu.  I figured there's would be reasonable.  I could include Docker, but this won't fixed any bugs/issues with the Docker provisioner.  

Alvaro Miranda Aguilera

unread,
Mar 20, 2016, 9:30:49 PM3/20/16
to vagra...@googlegroups.com
what bugs?

I got the impression the only problem was speed.

Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages