1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/docs/sources/installation/mac.md
Sven Dowideit 6ae07e2410 Tianon made a micro-image (sub one meg?) that we can use as a very fast to download 'yes, your docker can download and run an image' test
Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@docker.com> (github: SvenDowideit)
2014-07-17 11:54:35 +10:00

3.2 KiB

page_title: Installation on Mac OS X page_description: Instructions for installing Docker on OS X using boot2docker. page_keywords: Docker, Docker documentation, requirements, boot2docker, VirtualBox, SSH, Linux, OSX, OS X, Mac

Installing Docker on Mac OS X

Note: Docker is supported on Mac OS X 10.6 "Snow Leopard" or newer.

The Docker Engine uses Linux-specific kernel features, so to run it on OS X we need to use a lightweight virtual machine (vm). You use the OS X Docker client to control the virtualized Docker Engine to build, run, and manage Docker containers.

To make this process easier, we've designed a helper application called Boot2Docker that installs the virtual machine and runs the Docker daemon.

Demonstration

Installation

  1. Download the latest release of the Docker for OS X Installer

  2. Run the installer, which will install VirtualBox and the Boot2Docker management tool.

  3. Run the Boot2Docker app in the Applications folder:

    Or, to initialize Boot2Docker manually, open a terminal and run:

      $ boot2docker init
      $ boot2docker start
      $ export DOCKER_HOST=tcp://$(boot2docker ip 2>/dev/null):2375
    

Once you have an initialized virtual machine, you can control it with boot2docker stop and boot2docker start.

Upgrading

  1. Download the latest release of the Docker for OS X Installer

  2. Run the installer, which will update VirtualBox and the Boot2Docker management tool.

  3. To upgrade your existing virtual machine, open a terminal and run:

     $ boot2docker stop
     $ boot2docker download
     $ boot2docker start
    

Running Docker

From your terminal, you can test that Docker is running with the small hello-world example image. Start the vm and then run:

$ docker run hello-world

This should download the very small hello-world image and print a Hello from Docker. message.

Container port redirection

The latest version of boot2docker sets up a host only network adaptor which provides access to the container's ports.

If you run a container with an exposed port,

$ docker run --rm -i -t -p 80:80 nginx

then you should be able to access that Nginx server using the IP address reported by:

$ boot2docker ip

Typically, it is 192.168.59.103, but it could get changed by Virtualbox's DHCP implementation.

Further details

If you are curious, the username for the boot2docker default user is docker and the password is tcuser.

The Boot2Docker management tool provides several commands:

$ ./boot2docker
Usage: ./boot2docker [<options>]
{help|init|up|ssh|save|down|poweroff|reset|restart|config|status|info|ip|delete|download|version} [<args>]

Continue with the User Guide.

For further information or to report issues, please visit the Boot2Docker site.