This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get IAM Role name from Instance Profile Id | |
curl http://169.254.169.254/latest/meta-data/iam/info | |
# Get credentials | |
curl http://169.254.169.254/latest/meta-data/iam/security-credentials/<role-name> | |
# More info | |
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [ "$1" == "" ]; then | |
echo "usage: $0 <docker_id>" | |
echo "Exposes the netns of a docker container to the host" | |
exit 1 | |
fi | |
ppid=`docker inspect $1 | grep Pid | awk '{print $2 + 0}'` | |
if [ "$ppid" == "" ]; then | |
echo "lxc parent pid not found" |