Reputation: 726
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
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
Reputation: 265090
You would use docker-machine if you:
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