#Base Docker Development VM
Provisions an Ubuntu server with Docker Compose.
- Creates an Ubuntu VM running Docker
- Allows for configuration using a docker-compose.yml file
##How do i use it?
Step 1. Install vagrant
If using a mac homebrew casks is probably the easiest way:
$> brew doctor && brew update
$> brew cask install vagrant
If you are using windows:
... just use the website- https://www.vagrantup.com
Step 2. Install the docker-compose plugin:
vagrant plugin install vagrant-docker-compose
Step 3. Go to the directory where the Vagrant file is.
vagrant up
Congrats, you now have a working dev environment you can play with.
If you want to destroy the vm (delete):
vagrant destroy
If you want to pause the vm:
vagrant halt
vagrant ssh
will take you into the machine where you can work with docker once inside:
docker ps
docker exec -it <containerid> bash
##Creating a Docker compose file
Step 1. Create a docker-compose.yml
file defining your containers in the same directory as your Vagrantfile
.
A good example is found here.
Step 2. Reference the docker-compose
file in the Vagrantfile
.
config.vm.provision :docker_compose, yml: "/vagrant/docker-compose.yml", run:"always"
Step 3. Whenever you change the file, you need to run: vagrant reload
to redefine the box.