I am trying to automate setting up a developer environment on Mac. Part of that setup is installing the Docker Toolbox. I cannot find any documentation on how do to this via command line. How can I automate this installation (must be triggered via command line)?
Update: As pointed out in a commend by Dennis
Docker for Mac now exists, which is an alternative to Docker Toolbox. You can get it via the homebrew cask:
brew cask install docker
Docker Toolbox is a good option but currently it seems like Docker for Mac/Windows is becoming better and Docker is investing a lot of time polishing the app. I recommend installing Docker mainly for 2 reasons:
The installation is quite simple:
To install docker-toolbox you can refer the above post
I found that Docker Toolbox is available via brew/cask
Once Docker Toolbox is installed you can setup your docker environment using the Get started with Docker Machine guide.
At the end of this process, add
eval "$(docker-machine env myBoxName)"
to your.bash_profile
or you will get the following error when you open a new shell or terminal."Cannot connect to the Docker daemon. Is the docker daemon running on this host?"
If you start the docker container after opening the terminal, you can either run
eval "$(docker-machine env myBoxName)"
manually, or reload your bash profile (source ~/.bash_profile
).