Skip to content

Instantly share code, notes, and snippets.

@petemcw
Last active September 24, 2024 14:38
Show Gist options
  • Save petemcw/d1b8ecfe3e49c80e4bbd to your computer and use it in GitHub Desktop.
Save petemcw/d1b8ecfe3e49c80e4bbd to your computer and use it in GitHub Desktop.
Mac OS X Docker Instructions using Dinghy

Docker Installation

A great way to get Docker running smoothly on OS X is to use the awesome project Dinghy. It is basically:

Docker on OS X with batteries included, aimed at making a more pleasant local development experience. Runs on top of docker-machine.

Some of the benefits are:

  • Faster volume sharing using NFS rather than built-in virtualbox/vmware file shares
  • Filesystem events work on mounted volumes
  • Easy access to running containers using built-in DNS and HTTP proxy

Prerequisites for Mac OS X

Since OS X is Unix-based, you'll need to add some additional pieces of functionality to be able to run Docker on your Mac.

brew tap caskroom/cask
brew update
brew install docker docker-compose
brew cask install virtualbox virtualbox-extension-pack

Dinghy

Install via Homebrew

brew tap codekitchen/dinghy
brew install dinghy

Create the Dinghy VM

The next step is to create the dinghy VM. This creates a VM that is based on VirtualBox and Docker Machine. Please note it will take a few minutes for this command to complete:

dinghy create --provider virtualbox

After a successful VM creation, you'll receive shell output similar to the following:

export DOCKER_HOST=tcp://192.168.99.101:2376
export DOCKER_CERT_PATH=/Users/prm/.docker/machine/machines/dinghy
export DOCKER_TLS_VERIFY=1
export DOCKER_MACHINE_NAME=dinghy

Be sure to add these lines to your ~/.bash_profile or similar file. Also, don't copy/paste the above because these lines change for each specific install.

Upgrade Dinghy

Dinghy and the VM can be upgraded separately.

Upgrade Dinghy:

dinghy halt
brew update
brew upgrade dinghy
dinghy up

Upgrade the Dinghy VM:

dinghy upgrade

Test the Installation

You may now test the installation. An easy way is to run:

docker ps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment