Skip to content

Instantly share code, notes, and snippets.

@cameck
Created January 15, 2017 23:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cameck/9ce71ba3e447444bf7f799d92c46c171 to your computer and use it in GitHub Desktop.
Save cameck/9ce71ba3e447444bf7f799d92c46c171 to your computer and use it in GitHub Desktop.
Getting AWS Credentials into to a Docker Container without Hardcoding It
AWS_ACCESS_KEY_ID=$(aws --profile default configure get aws_access_key_id)
AWS_SECRET_ACCESS_KEY=$(aws --profile default configure get aws_secret_access_key)
docker build -t my_app .
docker run -it --rm \
-e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
-e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment