... alpine container with common tools to use Hashicorp's Packer on or for aws
-
[hashicorp's packer] 1
-
[aws cli] 2
-
[credstash] 3 (for managing secrets in aws)
-
bash, curl, git, make, jq, openssh client [and friends] 4
tags on master are built at shippable.com
git clone https://github.com/opsgang/docker_aws_packer.git
cd docker_aws_packer
git clone https://github.com/opsgang/alpine_build_scripts
./build.sh # adds custom labels to image
docker pull opsgang/aws_packer:stable # or use the tag you prefer
# run /path/to/script.sh which calls packer, aws cli, curl, jq blah ...
docker run --rm -i -v /path/to/script.sh:/script.sh:ro opsgang/aws_packer:stable /script.sh
# make my aws creds available and run /some/python/script.py
export AWS_ACCESS_KEY_ID="i'll-never-tell" # replace glibness with your access key
export AWS_SECRET_ACCESS_KEY="that's-for-me-to-know" # amend as necessary
docker run --rm -i \ # ... run interactive to see stdout / stderr
-v /some/python/script.py:/my.py:ro \ # ... assume the file is executable
--env AWS_ACCESS_KEY_ID \ # ... will read it from your env
--env AWS_SECRET_ACCESS_KEY \ # ... will read it from your env
--env AWS_DEFAULT_REGION=eu-west-2 \ # ... adjust geography to taste
opsgang/aws_packer:stable /my.py # script can access these env vars
# let me treat the container like a dev workspace and try stuff out.
# Oh look! vim is preinstalled. How cool! And gratuitous.
docker run -it opsgang/aws_packer:stable /bin/bash