diff --git a/Dockerfile b/Dockerfile index 59ab2b4..6e20e12 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,13 @@ FROM alpine:3.10.1 -RUN apk add --no-cache openssh tcpdump curl mtr nmap nmap-nping bind-tools nginx jq && \ - apk add --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ aws-cli +RUN apk add --no-cache openssh tcpdump curl mtr nmap nmap-nping bind-tools nginx jq + #apk add --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ aws-cli + +# Install aws-cli using pip +RUN apk -Uuv add groff less python py-pip +RUN pip install awscli +RUN apk --purge -v del py-pip +RUN rm /var/cache/apk/* ADD files/ /files/ @@ -24,6 +30,6 @@ RUN ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa && \ # Changing the motd to remember the above configuration printf '\n\nNOTICE: export $(strings /proc/1/environ) is run on the ash shell profile which makes the aws cli work with Task Roles.\nc' > /etc/motd -COPY ./testing.pub /root/.ssh/authorized_keys +# COPY ./testing.pub /root/.ssh/authorized_keys CMD [ "/files/entrypoint.sh" ] diff --git a/Makefile b/Makefile index 2e00b77..b080b96 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ test: checks curl -f localhost:8023 # Testing sshd - ssh -i ~/.ssh/testing -p 8022 root@localhost -- ip addr + # ssh -i ~/.ssh/testing -p 8022 root@localhost -- ip addr # Cleanup docker logs debugger-webserver diff --git a/README.md b/README.md index 46beb75..7685001 100644 --- a/README.md +++ b/README.md @@ -22,45 +22,55 @@ docker run -dit --name debugger-tcpdump -v ~/.aws/:/root/.aws/ -e BUCKET={bucket ### Sample Fargate Task Definition ```json { - "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 - }, + "executionRoleArn": "arn:aws:iam::{account}:role/{ecsExecutionRole}", + "containerDefinitions": [ { - "hostPort": 80, - "protocol": "tcp", - "containerPort": 80 + "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" } - ], - "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" + ], + "memory": "512", + "taskRoleArn": "arn:aws:iam::{account}:role/{taskRole}", + "compatibilities": [ + "EC2", + "FARGATE" + ], + "family": "testing", + "networkMode": "awsvpc", + "cpu": "256" } ```