From the arrival of docker and the containers now we can have a "vistual machine" running and being managed kind of as a docker image.
From docker documentation : "Docker Machine is a tool that lets you install Docker Engine on virtual hosts, and manage the hosts with
docker-machine commands. "
NOTE: this example is under Windows 10 OS
First of all we need to have Docker for Windows installed.
Something else we need is to have a Hyper-V enabled and correctly configured, for this docker documentation can be followed for Microsoft Hyper-V
Once we have all that the only thing left would be to execute in the command line something like this:
docker-machine create --driver hyperv devops-vm
There are much more options that can be added so feel free to check the documentation.
Now we have the docker machine up and running in order to use it we have to make docker execute the commands against it, this can be achieved by using the docker-machine env command
docker-machine env devops-vm
When executed will tell you what command you have to run next to use your docker machine
Now if command docker-machine active is executed the docker machine we wanted is the one which is active and docker commands will be executed against it, for example a docker-compose file.