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