Created
November 20, 2016 09:30
-
-
Save bongole/8734a214636fba22eedcc1fbe32c8023 to your computer and use it in GitHub Desktop.
This file contains 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
HOST_IP=$(curl -s 169.254.169.254/latest/meta-data/local-ipv4) | |
TASKS_JSON=$(curl -s $HOST_IP:51678/v1/tasks) | |
CONTAINER_ID=$(cat /proc/self/cgroup | grep "cpu:/" | sed 's/.*cpu:\/docker\///g') | |
TASK_ID=$(echo $TASKS_JSON|jq -r ".Tasks[] | select(.Containers[].DockerId == \"$CONTAINER_ID\") | .Arn"|sed 's/.*task\///') | |
TASK_FAMILY=$(echo $TASKS_JSON|jq -r ".Tasks[] | select(.Containers[].DockerId == \"$CONTAINER_ID\") | .Family") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment