Skip to content

A basic image that has a whole lot of things installed and configured to make debugging ECS, Fargate, other containers, etc.

License

Notifications You must be signed in to change notification settings

git4example/debugger

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

debugger

This container image contains all the usual tools for testing networking while also running both sshd and nginx processes for easy access to poke around within the container. It also has an inbuilt script to run a tcpdump within the containers/Task/Pod's network namespace and then offload it to an S3 bucket for access from outside the container.

Note: The nginx webserver listens on port 80 and sshd listens on port 8022 within the container.

Configuration

Environment Variables

A full list of available environment variables:

Name Allowed Values Description
TCPDUMP true/false Enables the tcpdumping mechanism. Default is false.
BUCKET The bucket name If the TCPDUMP is set to true this will be the bucket that the tcpdumps are put into

HowTo's / Samples

Using the inbuilt tcpdump capturing and pushing to S3

By default, this will generate a pcap file every 30seconds for 300 times and have this offloaded to the specified bucket. Due to it running the AWS CLI it will require the normal SDK permissions for the call out to S3. An example command is:

docker run -dit --name debugger-tcpdump -v ~/.aws/:/root/.aws/ -e BUCKET={bucket} -e TCPDUMP=true -p 8023:80 -p 8022:8022 debugger

Sample Fargate Task Definition

{
    "executionRoleArn": "arn:aws:iam::{account}:role/{ecsExecutionRole}",
    "containerDefinitions": [
        {
            "logConfiguration": {
                "logDriver": "awslogs",
                "options": {
                    "awslogs-group": "/ecs/testing",
                    "awslogs-region": "us-west-2",
                    "awslogs-stream-prefix": "ecs"
                }
            },
            "portMappings": [
                {
                    "hostPort": 8022,
                    "protocol": "tcp",
                    "containerPort": 8022
                },
                {
                    "hostPort": 80,
                    "protocol": "tcp",
                    "containerPort": 80
                }
            ],
            "environment": [
                {
                    "name": "BUCKET",
                    "value": "{yourbucketname}"
                },
                {
                    "name": "TCPDUMP",
                    "value": "true"
                }
            ],
            "cpu": 0,
            "memory": 256,
            "memoryReservation": 128,
            "image": "{image}",
            "essential": true,
            "name": "accessContainer"
        }
    ],
    "memory": "512",
    "taskRoleArn": "arn:aws:iam::{account}:role/{taskRole}",
    "compatibilities": [
        "EC2",
        "FARGATE"
    ],
    "family": "testing",
    "networkMode": "awsvpc",
    "cpu": "256"
}

About

A basic image that has a whole lot of things installed and configured to make debugging ECS, Fargate, other containers, etc.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 53.6%
  • Makefile 35.5%
  • Shell 10.9%