vagrant.rst 1.7 KB

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