Guest User

Untitled

a guest
Apr 24th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. * On macOS the docker binary is only a client and you cannot use it to run the docker daemon, because Docker daemon uses Linux-specific kernel features, therefore you can’t run Docker natively in OS X.
  2.  
  3. * So another tool was created, `Docker-Machine`, which creates a virtual machine (using yet another tool, e.g. Oracle VirtualBox), runs Docker on that VM, and helps coordinate between the host OS and the Docker VM.
  4.  
  5. * Since Docker isn't running on your actual host OS, docker-machine needs to deal with IP addresses and ports and volumes and such. And its settings are saved in environment variables, which means you have to run commands like this every time you open a new shell.
  6.  
  7. * To create a new docker machine : `docker-machine create --driver virtualbox vm-name-here`
  8.  
  9. * To view environment variables to connect to new virtualbox vm : `docker-machine env vm-name-here`
  10.  
  11. * To connect to docker via your shell, set environment variables by executing : `eval $(docker-machine env vm-name-here)`.
  12.  
  13. * Add `eval $(docker-machine env vm-name-here)` to bashrc, if you want to connect to connect set variable everytime your terminal starts.
  14.  
  15. * Find running docker machine: `docker-machine ls`
  16.  
  17. * Get status of of docker-machine: `docker-machine status name`
  18.  
  19. * If not name is specified then default docker machine status is returned
  20.  
  21. * Docker machine ssh (to virtualbox instance): `docker-machine ssh docker-vm`.
Add Comment
Please, Sign In to add comment