Is there a straightforward way to access AWS instance metadata from within a Docker container?
For example, when trying to fetch credentials for an IAM role on an EC2 instance, this would work on the instance itself:
http://169.254.169.254/latest/meta-data/iam/security-credentials/my_role
...but not from within a Docker container running on that EC2 instance.
There should be no difference between doing this in a container vs the host. The container can access EC2 metadata directly.
What do you see when you try the command from within the container? has an IAM role assigned?