Skip to content

A vagrant project to create a docker host environment in CentOS / Ubuntu VM

Notifications You must be signed in to change notification settings

windperson/vagrant_docker_env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This vagrant project creates a CentOS 7 / Ubuntu 14.04 LTS / Ubuntu 15.10 VM and installed with:

  • docker v1.12.1
  • docker-compose v1.8.0
  • docker-machine v0.8.1

The default vagrant user can use docker command without sudo, VM stores its docker installation folder /var/lib/docker in separated disk file disk_data/docker_data.vdi (which is configurable via Vagrantfile in root directory), so you can backup & restore current docker image, containers and volume data even if VM is broken or upgraded.

It is a truly workable Docker environment so you can do your important project on it without fearing lost data when VM broken or recreated. :)

To start this vagrant project, you need to install

and 4 require vagrant plugins:

CentOS 7

It use official CentOS 7 vagrant box (When specified vagrant box is centos/7)to "power on", which is made from those script, and host mapping inside VM of this Vagrant project folder is /vagrant, the same as default vagrant configuration.

Ubuntu 14.04 LTS & Ubuntu 15.10

It use official Ubuntu Server 14.04 LTS (Trusty Tahr) vagrant box (When specified vagrant box is ubuntu/trusty64) or official Ubuntu Server 15.10 Wily Werewolf (development) builds (When specified vagrant box is ubuntu/wily64) to "power on", and host mapping inside VM of this Vagrant project folder is /vagrant, the same as default vagrant configuration.

Note: You may need to modify booted setting then reboot the VM for doing heavy loading affairs, since the vagrant chef solo provisioner incapable to do VM restart, so it must be done manually, then use "vagrant reload" command on host to reboot the VM, see official docker installation document to know how to do it: https://docs.docker.com/engine/installation/linux/ubuntulinux/#adjust-memory-and-swap-accounting

You can tweak:

  • The separated docker data disk file size, use LVM to mount data disk or not, VM CPU core(s), RAM size in Vagrantfile line 11~16.
  • VM name appear in VirtualBox GUI manager and vagrant up process in Vagrantfile line 17.
  • VM hostname that will show in bash prompt and recorded in /etc/hostname inside VM in Vagrantfile line 18.
  • Vagrant box that will be used to create VM in Vagrantfile line 19.
  • VM private IP address in Vagrantfile line 20. (Default I left it as "dhcp" for better various environment compatibility, you can use vagrant-address plugin to find started VM private network IP address.)
  • Docker Engine startup parameter in Vagrantfile line 21 for enable insecure registry or private repos as mentioned in offical document.

About

A vagrant project to create a docker host environment in CentOS / Ubuntu VM

Resources

Stars

Watchers

Forks

Packages

No packages published