github.com/feiyang21687/docker@v1.5.0/docs/sources/installation/mac.md (about)

     1  page_title: Installation on Mac OS X
     2  page_description: Instructions for installing Docker on OS X using boot2docker.
     3  page_keywords: Docker, Docker documentation, requirements, boot2docker, VirtualBox, SSH, Linux, OSX, OS X, Mac
     4  
     5  # Installing Docker on Mac OS X
     6  
     7  > **Note:**
     8  > Docker is supported on Mac OS X 10.6 "Snow Leopard" or newer.
     9  
    10  Because the Docker Engine uses Linux-specific kernel features, you'll need to use a
    11  lightweight virtual machine (VM) to run it on OS X. You use the OS X Docker client to
    12  control the virtualized Docker Engine to build, run, and manage Docker containers.
    13  
    14  To make this process easier, we've built a helper application called
    15  [Boot2Docker](https://github.com/boot2docker/boot2docker) that installs a
    16  virtual machine (using VirtualBox) that's all set up to run the Docker daemon.
    17  
    18  ## Demonstration
    19  
    20  <iframe width="640" height="360" src="//www.youtube.com/embed/wQsrKX4588U?rel=0" frameborder="0" allowfullscreen></iframe>
    21  
    22  ## Installation
    23  
    24  1. Download the latest release of the [Docker for OS X Installer](
    25     https://github.com/boot2docker/osx-installer/releases/latest) (Look for the
    26     green Boot2Docker-x.x.x.pkg button near the bottom of the page.)
    27  
    28  2. Run the installer by double-clicking the downloaded package, which will install a
    29  VirtualBox VM, Docker itself, and the Boot2Docker management tool.
    30     ![](/installation/images/osx-installer.png)
    31  
    32  3. Locate the `Boot2Docker` app in your `Applications` folder and run it.
    33     Or, you can initialize Boot2Docker from the command line by running:
    34  
    35  	     $ boot2docker init
    36  	     $ boot2docker start
    37  	     $ $(boot2docker shellinit)
    38  
    39  A terminal window will open and you'll see the virtual machine starting up. 
    40  Once you have an initialized virtual machine, you can control it with `boot2docker stop`
    41  and `boot2docker start`.
    42  
    43  > **Note:**
    44  > If you see a message in the terminal that looks something like this:
    45  >
    46  >    `To connect the Docker client to the Docker daemon, please set: export 
    47  DOCKER_HOST=tcp://192.168.59.103:2375`
    48  > 
    49  you can safely set the environment variable as instructed.
    50  
    51  View the
    52  [Boot2Docker ReadMe](https://github.com/boot2docker/boot2docker/blob/master/README.md)
    53  for more information.
    54  
    55  ## Upgrading
    56  
    57  1. Download the latest release of the [Docker for OS X Installer](
    58     https://github.com/boot2docker/osx-installer/releases/latest)
    59  
    60  2. If Boot2Docker is currently running, stop it with `boot2docker stop`. Then, run
    61  the installer package, which will update Docker and the Boot2Docker management tool.
    62  
    63  3. To complete the upgrade, you also need to update your existing virtual machine. Open a
    64  terminal window and run:
    65  
    66          $ boot2docker stop
    67          $ boot2docker download
    68          $ boot2docker start
    69  
    70  This will download an .iso image containing a fresh VM and start it up. Your upgrade is
    71  complete. You can test it by following the directions below.
    72  
    73  ## Running Docker
    74  
    75  {{ include "no-remote-sudo.md" }}
    76  
    77  From your terminal, you can test that Docker is running with our small `hello-world`
    78  example image:
    79  Start the vm (`boot2docker start`) and then run:
    80  
    81      $ docker run hello-world
    82  
    83  This should download the `hello-world` image, which then creates a small
    84  container with an executable that prints a brief `Hello from Docker.` message.
    85  
    86  ## Container port redirection
    87  
    88  The latest version of `boot2docker` sets up a host-only network adaptor which provides
    89  access to the container's ports.
    90  
    91  If you run a container with an exposed port,
    92  
    93      $ docker run --rm -i -t -p 80:80 nginx
    94  
    95  then you should be able to access that Nginx server using the IP address reported by:
    96  
    97      $ boot2docker ip
    98  
    99  Typically, it is 192.168.59.103:2375, but VirtualBox's DHCP implementation might change
   100  this address in the future.
   101  
   102  # Further details
   103  
   104  If you are curious, the username for the boot2docker default user is `docker` and the
   105  password is `tcuser`.
   106  
   107  The Boot2Docker management tool provides several additional commands for working with the
   108  VM and Docker:
   109  
   110      $ ./boot2docker
   111      Usage: ./boot2docker [<options>]
   112      {help|init|up|ssh|save|down|poweroff|reset|restart|config|status|info|ip|delete|download|version} [<args>]
   113  
   114  Continue with the [User Guide](/userguide/).
   115  
   116  For further information or to report issues, please visit the [Boot2Docker site](http://boot2docker.io).