vagrant.rst 2.0 KB

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