vagrant.rst 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. :title: Using Vagrant (Mac, Linux)
  2. :description: This guide will setup a new virtualbox virtual machine with docker installed on your computer.
  3. :keywords: Docker, Docker documentation, virtualbox, vagrant, git, ssh, putty, cygwin
  4. **Vagrant installation is temporarily out of date, it will be updated for 0.6 soon.**
  5. .. _install_using_vagrant:
  6. Using Vagrant (Mac, Linux)
  7. ==========================
  8. This guide will setup a new virtualbox virtual machine with docker installed on your computer. This works on most operating
  9. systems, including MacOX, Windows, Linux, FreeBSD and others. If you can install these and have at least 400Mb RAM
  10. to spare you should be good.
  11. Install Vagrant and Virtualbox
  12. ------------------------------
  13. 1. Install virtualbox from https://www.virtualbox.org/ (or use your package manager)
  14. 2. Install vagrant from http://www.vagrantup.com/ (or use your package manager)
  15. 3. Install git if you had not installed it before, check if it is installed by running
  16. ``git`` in a terminal window
  17. Spin it up
  18. ----------
  19. 1. Fetch the docker sources (this includes the Vagrantfile for machine setup).
  20. .. code-block:: bash
  21. git clone https://github.com/dotcloud/docker.git
  22. 2. Run vagrant from the sources directory
  23. .. code-block:: bash
  24. vagrant up
  25. Vagrant will:
  26. * Download the 'official' Precise64 base ubuntu virtual machine image from vagrantup.com
  27. * Boot this image in virtualbox
  28. * Add the `Docker PPA sources <https://launchpad.net/~dotcloud/+archive/lxc-docker>`_ to /etc/apt/sources.lst
  29. * Update your sources
  30. * Install lxc-docker
  31. You now have a Ubuntu Virtual Machine running with docker pre-installed.
  32. Connect
  33. -------
  34. To access the VM and use Docker, Run ``vagrant ssh`` from the same directory as where you ran
  35. ``vagrant up``. Vagrant will connect you to the correct VM.
  36. .. code-block:: bash
  37. vagrant ssh
  38. Run
  39. -----
  40. Now you are in the VM, run docker
  41. .. code-block:: bash
  42. sudo docker
  43. Continue with the :ref:`hello_world` example.