- download docker-machine to /usr/local/bin
curl -L https://github.com/docker/machine/releases/download/v0.3.0/docker-machine_linux-amd64 > /usr/local/bin/docker-machine
chmod +x /usr/local/bin/docker-machine
- install docker client
https://gist.github.com/hawkup/6ac5f5b1ab7c761e886d
- create machine (this command will download a lightweight Linux distribution [boot2docker] with the Docker daemon installed and will create and start a VirtualBox VM with Docker running)
# dev is a name of machine
docker-machine create --driver virtualbox dev
- list machine
docker-machine ls
- tell Docker to talk that machine
eval "$(docker-machine env dev)"
docker ps
- run Docker commands on this host
docker run busybox echo hello world
- get IP address
docker-machine ip dev
- you can try running nginx in a container
docker run -d -p 8000:80 nginx
- curl nginx in a container
curl $(docker-machine ip dev):8000
- start ,stop and restart machine
docker-machine stop dev
docker-machine start dev
docker-machine restart dev
- remove machine
docker-machine rm dev
- list active machine
docker-machine active
- login to machine
docker-machine ssh dev
- available os
Boot2Docker [default]
Ubuntu
RancherOS
Debian
RHEL
CentOS
Fedora
reference: https://docs.docker.com/machine/