Provision and manage remote Docker hosts with Docker Machine


Docker tip:

Use Docker Machine to quickly provision a remote machine for testing

https://docs.docker.com/machine/

# spin up an ec2 instance with docker engine installed
$ docker-machine create \
    --driver amazonec2 \
    --amazonec2-open-port 8000 \
    --amazonec2-region us-east-1 \
    --amazonec2-instance-type "t2.micro" \
    sandbox

# point your docker daemon at the remote docker engine
$ docker-machine env sandbox
$ eval $(docker-machine env sandbox)

# build the images and spin up the containers on the remote machine
$ docker-compose up -d --build

# ssh certs are auto generated, so you can easily ssh to the remote
$ docker-machine ssh sandbox

# you can also copy files to/ from the machine
$ docker-machine scp docker-machine scp sandbox:~/foo.txt ~/
$ docker-machine scp docker-machine scp foo.tar.gz sandbox:/home/ubuntu