boot2docker – simplify working with docker containers on a mac

/Geek Warning – all others flee and hide to avoid boredom./

Boot2Docker is a wrapper that makes working with dockers on a local computer just a bit easier.

That’s the goal. Keep it simple and it works. If we really want to keep it simple we now have kitematic to run docker containers with a GUI.

GUI for Docker Container Development
GUI for Docker Container Development

Plus people in programming mode sometimes get insecure and like to (seriously) debate Vi or Emacs as if those who don’t know it are of a lesser kind. I believe in letting compilers deal with my long select-case/kwargs/collections/dictionaries/whatever you want to call them. Thus I LOVE seeing tools that make programming EASIER. Especially visual ones even though I’m back to preferring the command line.

But back to boot2docker for working with containers locally. On a Mac, it’s nothing most of us haven’t done already with Virtual Box (free) or VMWare (not free but faster than VB) sharing a local folder into the VM. We all do this so we can use our dev tools without even more junk into the VM itself.

Number 1 reason to use it if you use a Mac? It doesn’t make me install homebrew (not a fan – sorry) and mess up the $PATH on my Macs. And Containers are just cleaner than virtualenvs as there are no dependencies, only attached containers. ‘Tis beautiful.

OK, the point of this post – if you are having any problems installing boot2docker on your Mac as I did, first it probably is NOT your fault. OK, well maybe it is because we all like bright shiny things and have a ton of junk installed. For me I would install it and it just would not start up. I found the documentation sort of glazed over a few things. So here you go.

  1. Upgrade to the latest Virtual Box BEFORE installing boot2docker. For me it just hung and didn’t give me a clue what the problem was. Do this first.
  2. Let b2d put its .pem and other keys where it wants to. You don’t need to even put these in your .ssh folder either.
  3. I did put it’s three environment variables in my bash because I’m lazy.
  4. You don’t have to sudo when you call “boot2docker up”. It doesn’t like that.
  5. You don’t have to make an entry in your /etc/hosts file for the dev server. Maybe more convenient but the IP works just as well.
  6. SSH – I made this waaaay 2 complex. it’s like vagrant. Just type “boot2docker up” followed by “boot2docker ssh” and you are in.


Again – keep it simple and don’t make life complicated like I did. Install the boot2docker app for mac from the site. Install the package for Mac. Then from terminal:

boot2docker init

You only have to run that once. Then from anywhere:

boot2docker up
boot2docker ssh
boot2docker down

Of course you might want to try out some of the exercises after the “boot2docker ssh” line when you are in the environment. Just trying to keep things simple, but no simpler than needed.