Last active
April 30, 2018 18:57
-
-
Save Kralizek/3a6c3444899303b1b69e9bea54828ca6 to your computer and use it in GitHub Desktop.
Creates a Docker container to locally host an AWS XRay daemon.
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
# Fetches credentials from default profile | |
# It uses the AWS Powershell cmdlet | |
$credentials = (Get-AWSCredentials -ProfileName default).GetCredentials() | |
$accessKey = $credentials.AccessKey | |
$secretKey = $credentials.SecretKey | |
# Creates a container for later reuse | |
docker create -p 2000:2000/udp -e AWS_ACCESS_KEY_ID=$accessKey -e AWS_SECRET_ACCESS_KEY=$secretKey -e AWS_REGION=eu-west-1 --name aws-xray namshi/aws-xray | |
# Starts the container | |
docker start aws-xray | |
# When finished, you can stop the container | |
docker stop aws-xray |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment