Skip to content

Instantly share code, notes, and snippets.

@Kralizek
Last active April 30, 2018 18:57
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 Kralizek/3a6c3444899303b1b69e9bea54828ca6 to your computer and use it in GitHub Desktop.
Save Kralizek/3a6c3444899303b1b69e9bea54828ca6 to your computer and use it in GitHub Desktop.
Creates a Docker container to locally host an AWS XRay daemon.
# 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