Docker Machine vs Docker run

故事扮演 提交于 2019-12-10 01:26:02

问题


I'm confused between docker-machine vs docker run

docker images, shows me my images and then I can run one of these images with docker run.

When do I need to use docker-machine?


回答1:


From Docker Documentation

You can use Docker Machine to:

  • Install and run Docker on Mac or Windows
  • Provision and manage multiple remote Docker hosts
  • Provision Swarm clusters

in other words:

when your Host OS does not support running Docker Engine natively (i.e. on Mac and Windows).

and basically docker run is to start a container based on a docker image either from a local image or from the online registry.




回答2:


You would use docker-machine if you:

  • Have a VirtualBox based install of Docker for Win/Mac, rather than the newer HyperV or xhyve releases.
  • Have machines in the cloud that you'd like to manage from docker-machine

docker-machine includes boot2docker images to do an install and it acts as a wrapper to setting the docker environment variables to point the client to a remote host. You can easily do that latter part by hand.

Docker itself is what runs the containers, so if you're able to do that without docker-machine, you probably don't need to complicate your toolset.



来源:https://stackoverflow.com/questions/42405238/docker-machine-vs-docker-run

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!