Skip to content

Instantly share code, notes, and snippets.

@gregtaylor99
Forked from pahud/build_dm_awsec2.sh
Created March 23, 2018 01:37
Show Gist options
  • Save gregtaylor99/6f65c129634788a577a53e11d09fca3a to your computer and use it in GitHub Desktop.
Save gregtaylor99/6f65c129634788a577a53e11d09fca3a to your computer and use it in GitHub Desktop.
build your docker-machine on AWS EC2 instance
#!/bin/bash
machine='docker-builder'
export AWS_PROFILE='pahud'
AWS_ACCESS_KEY_ID=$(aws configure get aws_access_key_id)
AWS_SECRET_ACCESS_KEY=$(aws configure get aws_secret_access_key)
VPC='vpc-xxxxxx'
docker-machine create --driver amazonec2 \
--amazonec2-region us-west-2 \
--amazonec2-vpc-id ${VPC:-""} \
--amazonec2-request-spot-instance \
--amazonec2-spot-price 0.02 \
--amazonec2-instance-type m3.medium \
--amazonec2-access-key ${AWS_ACCESS_KEY_ID} \
--amazonec2-secret-key ${AWS_SECRET_ACCESS_KEY} \
$machine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment