├── Dockerfile ├── LICENSE ├── README.md ├── buildspec.yml └── debugger.yaml /Dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:experimental 2 | 3 | FROM --platform=$BUILDPLATFORM public.ecr.aws/ubuntu/ubuntu:edge 4 | 5 | ENV YQ="4.29.2" 6 | ENV KUBECTL="1.25.3" 7 | 8 | # install packages 9 | RUN apt-get update && apt-get install -y --no-install-recommends \ 10 | ca-certificates \ 11 | curl \ 12 | bind9-dnsutils \ 13 | iputils-ping \ 14 | jq \ 15 | git \ 16 | nmap \ 17 | openssh-client \ 18 | tree \ 19 | vim-tiny \ 20 | wget \ 21 | && rm -rf /var/lib/apt/lists/* 22 | 23 | # Config ca-certificates for wget 24 | RUN echo "ca_certificate=/etc/ssl/certs/ca-certificates.crt" > $HOME/.wgetrc 25 | 26 | # kubectl 27 | RUN curl -L https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL}/bin/$BUILDPLATFORM/kubectl -o /usr/local/bin/kubectl && \ 28 | chmod +x /usr/local/bin/kubectl 29 | 30 | # yq 31 | RUN if [ "$BUILDPLATFORM" = "linux/amd64" ]; then ARCHITECTURE=amd64; elif [ "$BUILDPLATFORM" = "linux/arm/v7" ]; then ARCHITECTURE=arm; elif [ "$BUILDPLATFORM" = "linux/arm64" ]; then ARCHITECTURE=arm64; else ARCHITECTURE=amd64; fi && \ 32 | wget https://github.com/mikefarah/yq/releases/download/v${YQ}/yq_linux_${ARCHITECTURE} -O /usr/local/bin/yq && \ 33 | chmod +x /usr/local/bin/yq 34 | 35 | # RUN echo `export PS1="\e[0;32m[\u@\h \W]\$ \e[m "` >> /root/.profile 36 | # && echo export PS1="\e[0;32m[\u@\h \W]\$ \e[m " >> /root/.bashrc 37 | 38 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 ventx GmbH 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # A debug container 2 | 3 | This debug container can be used for debugging applications in your kubernetes cluster. 4 | 5 | This container comes pre-installed with below libraries 6 | 7 | 1. ca-certificates 8 | 1. curl 9 | 1. dnsutils 10 | 1. git 11 | 1. iputils-ping 12 | 1. jq 13 | 1. nmap 14 | 1. openssh-client 15 | 1. tree 16 | 1. vim-tiny 17 | 1. wget 18 | 1. kubectl 19 | 1. yq 20 | 21 | 22 | In order to run a pod with this container in your cluster: 23 | 24 | > kubectl apply -f debugger.yaml 25 | 26 | > kubectl -n default get pod 27 | 28 | > kubectl -n default exec -it pod/{pod name} -- bash 29 | 30 | Docker image URI is: 31 | > public.ecr.aws/zinclabs/debug-ubuntu-base:latest 32 | -------------------------------------------------------------------------------- /buildspec.yml: -------------------------------------------------------------------------------- 1 | version: 0.2 2 | 3 | phases: 4 | pre_build: 5 | commands: 6 | 7 | - echo Logging in to Amazon ECR... 8 | - aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/zinclabs 9 | - apt-get update && apt-get install bc -y 10 | - apt-get install -y qemu-user-static 11 | # Install AWS CLI 12 | # - curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" 13 | # - unzip awscliv2.zip 14 | # - ./aws/install 15 | # - rm awscliv2.zip 16 | # - rm -rf aws 17 | 18 | # install buildx 19 | - wget -nv https://github.com/docker/buildx/releases/download/v0.7.1/buildx-v0.7.1.linux-amd64 20 | - chmod +x buildx-v0.7.1.linux-amd64 21 | - mkdir -p ~/.docker/cli-plugins 22 | - mv buildx-v0.7.1.linux-amd64 ~/.docker/cli-plugins/docker-buildx 23 | 24 | 25 | - export DOCKER_CLI_EXPERIMENTAL=enabled 26 | - export DOCKER_BUILDKIT=1 27 | build: 28 | commands: 29 | - docker buildx create --name mybuilder --use --bootstrap 30 | - docker buildx build --push --platform linux/amd64,linux/arm64 --tag public.ecr.aws/zinclabs/debug-ubuntu-base:latest . 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /debugger.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: ubuntu-debug 5 | namespace: default 6 | spec: 7 | replicas: 1 8 | selector: 9 | matchLabels: 10 | app: ubuntu-debug 11 | template: 12 | metadata: 13 | labels: 14 | app: ubuntu-debug 15 | spec: 16 | containers: 17 | - name: ubuntu-debug 18 | image: public.ecr.aws/zinclabs/debug-ubuntu-base:latest 19 | imagePullPolicy: Always 20 | command: ["sleep", "86400"] 21 | resources: {} 22 | # limits: 23 | # cpu: ".5" 24 | # memory: 1Gi 25 | 26 | --------------------------------------------------------------------------------