Vagrant c Docker внутри


$ cd ~
$ mkdir -p  vagrant-scripts
$ cd vagrant-scripts

$ vi Vagrantfile


# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/xenial64"
  config.vm.provision "docker"
end


$ vagrant box update
$ vagrant up
$ vagrant status


$ vagrant ssh default


$ docker -v
Docker version 18.04.0-ce, build 3d479c0


Сразу с имиджем

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/xenial64"
  config.vm.provision "docker" do |d|
   d.pull_images "node"
 end
end


$ vagrant ssh default


$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
node                latest              26cbfbc03e3f        2 days ago          675MB



C docker compose

$ vagrant plugin install vagrant-docker-compose


Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/xenial64"
  config.vm.hostname = 'vmsrv'
  config.vm.network "private_network", ip: "192.168.56.101"

 config.vm.provision "docker" do |d|
   d.pull_images "node"
 end
  config.vm.provision :docker_compose
end