

Remember that IP address we set earlier? Now we can alias it in our hosts file so that it’s easier to remember. Now we can start running docker images! sudo docker run -d -p 80:80 nginx Once the Vagrant box is ready, ssh to it: vagrant ssh Modify it so that Vagrant assigns the IP address “192.168.10.101” and installs Docker for us: # using a specific IP.Ĭonfig.vm.network “private_network”, ip: “192.168.10.101”Ĭonfig.vm.provision “shell”, inline: <<-SHELLĪfter the edits, the file should look like so: # -*- mode: ruby -*-Ĭonfig.vm.network "private_network", ip: "192.168.10.101"Ĭonfig.vm.provision "shell", inline: <<-SHELLīack in the Babun shell window, we can bring the virtual machine online by running: vagrant up # config.vm.provision “shell”, inline: <<-SHELL Open the Vagrantfile with your text editor of choice and find the following sections: # using a specific IP. The Vagrantfile contains instructions for how Vagrant should build your virtual machine.

Open a new Babun shell window and create a directory for our vagrant box:Ĭd ~ & mkdir -p vagrant/trusty64 & cd vagrant/trusty64ĭownload the Vagrantfile for ubuntu (trusty 64-bit) vagrant init ubuntu/trusty64.
DOCKER VAGRANT INSTALL
DOCKER VAGRANT WINDOWS
Run vagrant provision or vagrant up and observe this output: => default: Running provisioner: docker.Today, we’ll provision a Docker host together using Vagrant and Virtualbox on Windows and add a local DNS entry. # vagrant plugin install vagrant-docker-compose the steps below were tested using 2.2.6), then you can install Docker with a very simple one or two one-liners, without the d.run or similar hacks: nfigure(2) do |config|

If you are using fairly recent Vagrant with Docker provisioner support (e.g. Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 4.15.0-88-generic docker -vĭocker version 19.03.8, build docker-compose -vĭocker-compose version 1.24.1, build 4667896b => default: Running provisioner: docker_compose.ĭefault: Checking for Docker Compose installation.ĭefault: Getting machine and kernel name from guest machine.ĭefault: Downloading Docker Compose 1.24.1 for Linux x86_64ĭefault: Downloaded Docker Compose 1.24.1 has SHA256 signature cfb3.ĭefault: Uploading Docker Compose 1.24.1 to guest machine.ĭefault: Installing Docker Compose 1.24.1 in guest machine.ĭefault: Symlinking Docker Compose 1.24.1 in guest machine. => default: Running provisioner: docker.ĭefault: Installing Docker onto machine. => default: Importing base box 'ubuntu/bionic64'. Please run the requested command again.īringing machine 'default' up with 'virtualbox' provider. Vagrant has completed installing local plugins for the current Vagrant Installed the plugin 'vagrant-docker-compose (1.5.1)'! This can take a few minutes.įetching: vagrant-docker-compose-1.5.1.gem (100%) Installing the 'vagrant-docker-compose' plugin. Vagrant has detected project local plugins configured for this Vb.customize Īs described here you can require plugin installation from within Vagrantfile Here is somewhat more user-friendly Vagrantfile (tested on Vagrant 2.2.7) nfigure("2") do |config|Ĭ = "vagrant-docker-compose"
