Http://www.oschina.net/translate/installing-docker-on-mac-os-x?print installing Docker on Mac OS X
Note: Docker supports Mac OS X 10.6 "Snow Leopard" and the above versions.
The Docker engine uses the Linux kernel-specific features, so to make it run on OS X we need a lightweight virtual machine (VM). Use OS X's Docker client to control virtual Docker to build, run, and manage Docker containers.
To make the process a little simpler, we designed a help application called Boot2docker that can follow the virtual machine and run the Docker daemon.
Installation
Download the latest version of Docker for OS X Installer.
Run Setup, install the VirtualBox and Boot2docker management tools.
Run the Boot2docker app under the application folder:
Or manually initialize the Boot2docker, open the terminal and run:
3 |
$ export DOCKER_HOST=tcp://$(boot2docker ip 2>/dev/null):2375 |
Once you have initialized a virtual machine, you can control it with Boot2docker stop and Boot2docker start.
Update
Download the latest version of Docker for OS X Installer
Run Setup, update the VirtualBox and Boot2docker management tools.
To update an existing virtual machine, open the terminal and run:
Run Docker
Run a "Hello World" example on the terminal to test Docker. Start the virtual machine and then run:
1 |
$ docker run ubuntu echo hello world |
This should download the Ubuntu image and print Hello world.
Container Port Jump
The latest version of Boot2docker establishes a network adapter-only host that provides access to the container's ports.
If you run a container that has a public port,
1 |
$ docker run -- rm -i -t -p 80:80 nginx |
Then you should be able to access the Nginx server with an IP address:
Typically, this IP address is 192.168.59.103, but may also be modified by VirtualBox enabled DHCP.
More details
If you're curious, Boot2docker's default user name is Docker, and the password is tcuser.
The Boot2docker management tool provides a number of commands:
$./boot2dockerusage:./boot2docker [<options>]{help|init|up|ssh|save|down|poweroff|reset|restart|config| Status|info|ip|delete|download|version} [<args>]
More content in User Guide.
For more information or to report a problem, please visit boot2docker site.
This address: http://www.oschina.net/translate/installing-docker-on-mac-os-x
Original address: https://docs.docker.com/installation/mac/
All translations in this article are for learning and communication purposes only, please be sure to indicate the translator, source, and link to this article.
Our translation work in accordance with the CC agreement, if our work has violated your rights and interests, please contact us promptly
Installing Docker on Mac OS X (RPM)