Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save hawkup/287dafd05a797fc29154 to your computer and use it in GitHub Desktop.
Save hawkup/287dafd05a797fc29154 to your computer and use it in GitHub Desktop.
Install Docker Machine on Ubuntu 14.04
  • 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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment