Skip to content

Instantly share code, notes, and snippets.

@shmick
Created February 28, 2019 18:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shmick/cd513570cde9029394c3488519479593 to your computer and use it in GitHub Desktop.
Save shmick/cd513570cde9029394c3488519479593 to your computer and use it in GitHub Desktop.
Using the saml2aws utility, you can get a set of temporary AWS credentials that you can export to your docker container.
Use this command to put those credentials into a local environment file for docker:
$ saml2aws exec env | egrep 'AWS_(ACC|SECR|SES)' > env.file
Running command as: arn:aws:sts::123456789012:assumed-role/AWS-MyRole/username@globeandmail.com
You should now see AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_SESSION_TOKEN inside of env.file
Now start your container with the --env-file option, using the env.file you just created.
$ docker run --env-file env.file -p ....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment