MageInferno

Using Docker Machine on OS X with Dinghy

by Mark Shust · September 3, 2015

Today, Dinghy released version 4.0 of their software, based on Docker Machine rather than Vagrant. We are really excited about this, because of some of the shortcomings of vagrant-based VM's, and because of the new features and capabilities Docker Machine.

Install the brew package

It's quite easy to setup and get going. If you've previously installed Dinghy, do the following:

cd `brew --prefix`/var/dinghy/vagrant && vagrant destroy
rm -rf `brew --prefix`/var/dinghy/vagrant
cd ~
brew reinstall --HEAD https://github.com/codekitchen/dinghy/raw/latest/dinghy.rb

If you are new to Dinghy, install it with the following:

brew install --HEAD https://github.com/codekitchen/dinghy/raw/latest/dinghy.rb

Create the Dinghy VM

Our 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.100:2376
export DOCKER_CERT_PATH=/Users/your-username/.docker/machine/machines/dinghy
export DOCKER_TLS_VERIFY=1
export DOCKER_MACHINE_NAME=dinghy

Be sure to add these lines to your ~/.bash_profile file. Also, don't copy/paste the above because these lines change for each specific install. (If you have preexisting variables form a previous installation of Dinghy, remember to remove those first).

Test the installation

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

docker ps

This will show all of your docker images. Let's try testing it out by dropping into a PHP shell:

docker run -it php

Explore all features

Dinghy is a great tool for working with Docker on OS X, and especially Magento 2 because of the very large filesystem, and need for NFS. Be sure to check out all of these features on their GitHub page:

  • DNS Resolution
  • HTTP Proxy
  • Docker Machine integration
This post authored by
Mark Shust
Read more about Mark

Mark Shust is the lead eCommerce Developer for Mage Inferno, a development firm specializing in Magento 2 modules. He has over 10 years of web development experience in the eCommerce, real estate, business-to-business, and information technology industries. Mark has specific expertise in database engineering and management, development processes, and client frontend development, and has taken projects through the development lifecycle from conceptualization through completion. Mark is a Zend Certified Engineer, a Magento Certified Developer Plus, and has a wide knowledge range of LAMP server management and Linux-based programming. He has in-depth experience creating custom extensions, building out vendor-specific customizations, and performance enhancements & improvements for both Magento Community and Enterprise platforms.