Skip to content

Vagrant definition for a virtual machine suitable for Docker development

License

Notifications You must be signed in to change notification settings

Daemonite/vagrant-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vagrant machine for Docker

vagrant-docker is a Vagrant definition for a virtual machine suitable for Docker development.

Main features

  • Supports the Virtualbox and VMWare VM providers.
  • Operating system optimised for running Docker server and based on Ubuntu so developers can install any of their favourite Linux tools easily.
  • Includes the most recent stable releases of Docker and Docker Compose.
  • Default port mappings and shares for easy development and testing of Docker containers.
  • Includes the insecure SSH key for phusion's docker-baseimage so you can SSH into containers based on that image.

This machine uses Docker-friendly base boxes built by Phusion. See their base box git repo for details of the features of the base box.

Configurable settings

The Vagrant machine has a small number of settings that can be configured by environment variables. Set these in your host user environment prior to running vagrant commands.

DOCKERHOST_MEMSIZE

The amount of memory in MB to allocate to the VM. Default is 1024.

DOCKERHOST_IPADDR

The IP address to assign to the VM on the virtual network that connects it to the host. By default Vagrant selects an unused IP address in a private network range.

DOCKER_FWDPORT_MIN, DOCKER_FWDPORT_MAX

The Vagrant definition maps a range of high ports from the VM to the host. Docker containers that publish ports in this range will have those ports accessible from the VM host. By default this range is 48000-48199, but this can be changed with the DOCKER_FWDPORT_MIN and DOCKER_FWDPORT_MAX variables.

Build folder

This VM enables the default share which maps the folder containing the Vagrantfile to the /vagrant folder in the guest VM.

If you create a folder named build under the project its contents will be ignored by Git. This makes it a suitable place to put your Docker Compose projects, Dockerfiles, and git repositories.

Shell shortcuts

The vagrant login in the VM is configured to contain a few shortcuts to assist Docker development:

  • d is an alias for "docker"
  • dc is an alias for "docker-compose"
  • dclean is an alias to delete all untagged Docker images (usually left over from old builds)
  • dsh is a Bash function that takes the name of a running container as an argument and opens an interactive Bash shell inside it via "docker exec"

Getting Docker and Compose updates

If a newer stable release of Docker is released, you should be able to upgrade your VM with docker provision.

If a newer version of Docker Compose is released, you will need to update the DOCKER_COMPOSE_VERSION variable in the Vagrantfile and then create the VM with vagrant destroy and vagrant up. Alternately, you can upgrade by following the Compose install instructions.

Possible future enhancements

It may be useful to include a Consul server in standalone mode to support clustering via Docker Swarm and service discovery through tools such as registrator and consul-template.

License

This project is provided compliments of Daemon and made available under the MIT license.

The insecure SSH key is copyrighted by Phusion and made available under the MIT license.

About

Vagrant definition for a virtual machine suitable for Docker development

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages