Docker Machine
Docker Machine is a tool for provisioning and managing your Dockerized hosts (hosts with Docker Engine on them).
Docker Machine is used to create Docker hosts on your local Mac or Windows box, on your company network, in your data center, or on cloud providers like AWS
Installation
Install in Linux
1 | $ base=https://github.com/docker/machine/releases/download/v0.16.0 && |
To check installation
1 | $ docker-machine version |
Create a machine
Create a machine. -d/--driver
flag is required to indicate the provider(VirtualBox, DigitalOcean, AWS, etc.)
1 | docker-machine create --driver virtualbox mydockervm |
Note: the hostname is ‘mydockervm’.
output
1 | ...... |
Inspect Machine
1 | docker-machine inspect mydockervm |
List Machines
1 | docker-machine ls |
output
1 | NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS |
SSH to the machine
First use docker-machine env
command to set the envir
1 | docker-machine env mydockervm |
Then ssh to the machine. use exit
command to exit the docker-machine
1 | docker-machine ssh mydockervm |
Stop the machine
This will powerdown the machine
1 | docker-machine stop mydockervm |
Remove the machine
```
docker-machine rm mydockervm