Problems running Docker Toolbox on Apple Mac

Apple Mac Pro (Early 2009 - Firmware upgraded from 4.1 to 5.1)
macOS 10.12.6 Sierra
Docker Toolbox Docker version 17.07.0-ce, build 8784753 (from docker --version)
Docker Kitematic 0.17.0

Hello, I have just downloaded and installed Docker Toolbox on my ancient half-timbered steam-powered Apple Mac Pro (Early 2009) (it does have 32Gb of RAM though!). I managed to download and run the Hello-World-Nginx image, so that’s good. Flushed with my success with that, I then tried to download and run the MongoDB image. I’m probably being impatient and missing a step or two but if I try to do anything from the command line (iTerm2) I get the message
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
What am I missing? Thanks…

Edit: When I say I succeeded in running the hello-world-nginx image, I meant that I was able to get it to run within the Kitematic utility. I couldn’t get it to run from the command line for the same reasons as mentioned above.

Run

eval $(docker-machine env)

You’ll need to do it in each running terminal. (I think in principle “Toolbox” comes with its own terminal environment that preconfigured this, but I never used it.)

In theory the information this returns can change, but it’s always felt very consistent to me. Your VM’s IP address is probably 192.168.99.100, for instance. If you don’t mind a complaint when your shell starts up if the VM isn’t running it’s safe to put this command in your shell dotfiles, or even to see what environment variables that command sets and hard-code those.

Hi, David. Thanks very much that works a treat! I’m running the Docker Quickstart Terminal, which in turn spawns iTerm2 but it doesn’t seem to run the eval $(docker-machine env) automatically. It’s not a problem, though, I would imagine that somewhere in the iTerm2 preferences I can find a way of getting it to run automatically. Thanks again! This opens up all kinds of possibilities!

Just added it to my .zshrc config file. It works perfectly. Happy days!

Another solution would be to open the docker app on Spotlight and login to get it running!

I am getting this error:

Error: No machine name(s) specified and no "default" machine exists

Have an idea why?