I’ve always been a big fan of Docker, the containerization technology it brings to the world is game changing. Traditionally, Docker can only be installed on Linux machines either on the OS itself or via Virtual Machines due to the way it was architected, it heavily utilize containerization feature of the Linux kernel. That means users of other operating systems such as Windows or Mac are out of luck, until now!
Docker’s core team has been working hard on creating a way for users of other platforms to try Docker. You can now try Docker on these platforms with ease! In this tutorial, I will show you how you can try Docker on Mac OSX in two ways.
Docker Toolbox has been around for a while now, it’s an ideal way to play with Docker in OSX. Docker Toolbox contains many sub components that work together in order for docker to execute on your system.
(Your system needs to be running OSX 10.8 “Mountain Lion”)
You first need to download the Docker Toolbox setup file. The set up process is straight forward, follow the instruction on the screen and click “Continue”.
After the completion of the installation, you now have a program called “Docker Quickstart Terminal” available from the Quick Launcher.
When you open it, it will be inside a terminal tab with docker commands available and you’re ready to play with docker!
What’s really happening?
Docker Toolbox installs the following to your /usr/local/bin directory:
Docker-machine starts a Virtual Box VM called default with boot2docker Linux image. The programs work together to make it seem like you’re writing docker commands and running docker containers within your mac terminal, what’s really going on under the hood is that docker-machine sends these commands to the VM via secure certificates allow you to communicate back and forth between the VM and your OS via your terminal.
Docker for Mac
Just recently (about 2 days ago at the time of the writing), Docker for Mac was moved to Open Beta phase, this means anyone can download the NATIVE implementation of Docker on Mac, and no more VMs!
It does have some hefty system requirements:
- Mac must be a 2010 or newer model, with Intel’s hardware support for memory management unit (MMU) virtualization; i.e., Extended Page Tables (EPT)
- OS X 10.10.3 Yosemite or newer
- At least 4GB of RAM
- VirtualBox prior to version 4.3.30 must NOT be installed (it is incompatible with Docker for Mac)
The installation process itself is simple and self explainatory. Download the binary and install it like any program on Mac.
If you’re using OSX Yosemite, you’ll get this warning about memory consumption:
You’ll then be prompted to enter your root password to continue:
If you have previously installed Docker Machine, the installer will detect that, and will ask you if you want to move the data over, very handy!
And you’re now done with the set up.
Open up the terminal and type in:
docker --version docker-compose --version docker-machine --version
and you should be able to start using Docker and a host of wonder tools it provide! The latest version of Docker (v.1.12) contains built in orchestration feature!
I hope you find this intro post useful. If you’re interested in what Docker can do, you can read my tutorial on Using Docker to deploy Apache, Nginx, WordPress and Nodejs containers with Digital Ocean