Skip to content

Instantly share code, notes, and snippets.

@wataruoguchi
Last active May 8, 2017 05:38
Show Gist options
  • Select an option

  • Save wataruoguchi/a4cffef8864fbc61d1904bfe4b1fe0b5 to your computer and use it in GitHub Desktop.

Select an option

Save wataruoguchi/a4cffef8864fbc61d1904bfe4b1fe0b5 to your computer and use it in GitHub Desktop.

Installing Docker Machine on Mac

Note: Better install 'Docker for Mac' to share docker socket
  1. Visit https://www.docker.com/products/docker-toolbox and download dmg
  2. Install > Select "Docker quickstart Terminal"
  3. You can see "Default" is being installed in VirtualBox
  4. Wait until Docker ASCII art appears in your terminal
  5. docker-machine create --driver virtualbox <Docker hostname>
  6. Now you see "" is ruuning in VirtualBox
  7. Try docker-machine env <Docker hostname> and you see your host's env var. Run eval $(docker-machine env <Docker hostname>) to vonnect your shell to the new machine
  8. See these commands (relevant, not necessary)
    • docker-machine config <Docker hostname>
    • set the config with docker $(docker-machine config vbox)
  9. Also, see these commands
    • docker-machine ls
    • docker-machine start <Docker hostname>
    • docker-machine stop <Docker hostname>
    • docker-machine rm <Docker hostname>
  10. Change your directory to where you saved Dockerfile and docker-compose.yml
  11. docker-compose build && docker-compose up --no-deps -d
  12. Try to access in your browser http://192.168.99.100:8000/
      • 192.168.99.100 is the IP of your docker machine. docker-machine ip <Docker hostname>
      • 8000 is the port my Nginx exposes

Reference: https://docs.docker.com/machine/get-started/

Look forward: https://alexanderzeitler.com/articles/docker-machine-and-docker-compose-developer-workflows/

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