October 2018
Beginner
232 pages
7h 52m
English
As well as running and pulling down images, you can actually build an image before it is then used as part of provisioning and its process. The build is done on the Vagrant guest machine and must be available for Docker to access. It runs the docker build command, so all you have to do is pass in the location of the Dockerfile.
An example of using this in a Vagrantfile would be as follows:
Vagrant.configure("2") do |config| config.vm.provision "docker" do |dock| dock.build_image "/vagrant/provision" end end
Here, we are using the dock.build_image key inside the provision block to set the directory (where our Dockerfile is located).
Read now
Unlock full access