Skip to content

Instantly share code, notes, and snippets.

@pahud
Last active September 17, 2021 13:49
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save pahud/f3d72d2a846b2e08abcdb8af9708d239 to your computer and use it in GitHub Desktop.
Save pahud/f3d72d2a846b2e08abcdb8af9708d239 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