Skip to content

Instantly share code, notes, and snippets.

@vodkhard
Last active July 15, 2019 09:34
Show Gist options
  • Save vodkhard/e1c74a6c3b70fa2b8131e309e27fe96d to your computer and use it in GitHub Desktop.
Save vodkhard/e1c74a6c3b70fa2b8131e309e27fe96d to your computer and use it in GitHub Desktop.
Replace Docker for Mac by docker-machine to improve docker speed on Mac OS

Install ⚡ docker-machine

docker machine

First, remove Docker for Mac (optional) 💩

  1. Remove the application Docker in Applications folder

img

  1. Go to the ~/Library folder. You can go to this folder with the Shift+Cmd+G then type ~/Library and click Go.

get library

  1. Now you have to delete those folders to remove all containers, images, caches, etc... :
    • Application Scripts/com.docker.helper
    • Caches/com.docker.docker
    • Containers/com.docker.docker
    • Containers/com.docker.helper

Now you're good to install docker-machine ⚡ ⚡ ⚡

Second, install dependencies

  1. Install VirtualBox : brew cask install virtualbox
  2. Install docker-machine : brew install docker docker-compose docker-machine docker-machine-nfs

Third, create your docker-machine

  • docker-machine create --driver virtualbox default
  • docker-machine-nfs default --shared-folder=/path/to/folder/of/all/your/projects
  • docker-machine env default
    • Now you see all global Docker variables necessary to communicate with your docker-machine. You can copy/paste those to your .bash_profile or .zshrc

⚠️ now your docker is host on 192.168.99.100 ip, no 127.0.0.1

Now you can rebuild your projects and enjoy the speed of docker-machine ⚡⚡⚡⚡⚡ !!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment