vagrant.rst 1.9 KB

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