Is there a way to start Docker for Mac (and / or Docker for Windows) from the command line? I can't find any documentation about it.

My team uses a set of scripts to automate setup of our development environment using docker-machine. Some of us have been testing Docker for Mac and like it, but we don't like having to start a separate app before switching back to the command line.

  • Sometime along the way it seemingly was launchctl start local.dlite (reference). Now I have com.docker.helper and com.docker.docker running, but cannot locate their plist files. – techraf Jul 26 '16 at 4:45
  • What part of Docker are you looking to start? The daemon? The VM hosting the actual docker container should start automatically, IIRC. – Daniel B Jul 26 '16 at 5:28
  • I'm not sure about Windows, but for me the daemon and VM both run automatically at boot or login (not sure which) on Mac. – Dan Lowe Jul 26 '16 at 5:50
  • @DanielB Here under Preferences it shows it runs on user login, the machine shouldn't be started if you SSHed to a booted machine without logging on the console. – techraf Jul 26 '16 at 6:55
  • 1
    Have you found any solution for starting Docker for Mac from the command line? – Martin Feb 9 '17 at 7:37

You can open Docker for Mac from the terminal using:

open -a Docker

I'm using the first production version of Docker for Mac (1.12) that came out last week. You can also have it autostart under Preferences.

  • 6
    I'm using open --hide --background -a Docker to start Docker. The --hide makes it not splurge its admittedly cute and cetacean-filled UI all over my screen, and --background stops the application getting the focus, leaving me to continue with docker commands in my console. If you wanted then to wait until the daemon is actually up, see stackoverflow.com/questions/5274294 for ideas. – tobych May 11 '17 at 22:26
  • 1
    Note that open -a Docker will return before the daemon is up and running. On my MacBook it takes just under 30 seconds to start up. – Alex S May 9 '18 at 23:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.