mac.rst 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. :title: Installing Docker on a Mac
  2. :description: Installing Docker on a Mac
  3. :keywords: Docker, Docker documentation, virtualbox, git, ssh
  4. .. _install_using_vagrant:
  5. Installing Docker on a Mac
  6. ==========================
  7. This guide explains how to install a full Docker setup on your Mac,
  8. using Virtualbox and Vagrant.
  9. Install Vagrant and Virtualbox
  10. ------------------------------
  11. .. include:: install_header.inc
  12. .. include:: install_unofficial.inc
  13. #. Install virtualbox from https://www.virtualbox.org/ (or use your
  14. package manager)
  15. #. Install vagrant from http://www.vagrantup.com/ (or use your package
  16. manager)
  17. #. Install git if you had not installed it before, check if it is
  18. installed by running ``git`` in a terminal window
  19. Spin it up
  20. ----------
  21. 1. Fetch the docker sources (this includes the ``Vagrantfile`` for
  22. machine setup).
  23. .. code-block:: bash
  24. git clone https://github.com/dotcloud/docker.git
  25. 2. Change directory to docker
  26. .. code-block:: bash
  27. cd docker
  28. 3. Run vagrant from the sources directory
  29. .. code-block:: bash
  30. vagrant up
  31. Vagrant will:
  32. * Download the 'official' Precise64 base ubuntu virtual machine image from vagrantup.com
  33. * Boot this image in virtualbox
  34. * Follow official :ref:`ubuntu_linux` installation path
  35. You now have a Ubuntu Virtual Machine running with docker pre-installed.
  36. Connect
  37. -------
  38. To access the VM and use Docker, Run ``vagrant ssh`` from the same directory as where you ran
  39. ``vagrant up``. Vagrant will connect you to the correct VM.
  40. .. code-block:: bash
  41. vagrant ssh
  42. Upgrades
  43. --------
  44. Since your local VM is based on Ubuntu, you can upgrade docker by logging in to the
  45. VM and calling ``apt-get``:
  46. .. code-block:: bash
  47. # Log into the VM
  48. vagrant ssh
  49. # update your sources list
  50. sudo apt-get update
  51. # install the latest
  52. sudo apt-get install lxc-docker
  53. Run
  54. ---
  55. Now you are in the VM, run docker
  56. .. code-block:: bash
  57. sudo docker
  58. Continue with the :ref:`hello_world` example.