hounded
hounded

Reputation: 726

Docker Machine vs Docker run

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?

Upvotes: 12

Views: 5095

Answers (2)

VaTo
VaTo

Reputation: 3098

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.

Upvotes: 12

BMitch
BMitch

Reputation: 265090

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.

Upvotes: 10

Related Questions