├── CODEOWNERS ├── bash_aliases ├── bash_banner ├── .github ├── dependabot.yml └── workflows │ ├── new-version.yml │ └── container.yml ├── LICENSE ├── Dockerfile └── README.md /CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @dergeberl -------------------------------------------------------------------------------- /bash_aliases: -------------------------------------------------------------------------------- 1 | alias k=kubectl -------------------------------------------------------------------------------- /bash_banner: -------------------------------------------------------------------------------- 1 | The Dockerfile for this container can be found on GitHub: 2 | https://github.com/dergeberl/multitool-container 3 | 4 | 5 | Feel free to rise an issue or PR if a tool is missing in this container. 6 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "docker" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | - package-ecosystem: "github-actions" 8 | directory: "/" 9 | schedule: 10 | interval: "daily" -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Maximilian Geberl 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. -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | ### base container image 2 | FROM ubuntu:24.04 AS base 3 | 4 | MAINTAINER dergeberl 5 | 6 | LABEL org.opencontainers.image.source https://github.com/dergeberl/multitool-container 7 | 8 | COPY bash_aliases /root/.bash_aliases 9 | COPY bash_banner /root/.bash_banner 10 | 11 | RUN apt update && \ 12 | apt upgrade -y && \ 13 | apt install -y --no-install-recommends \ 14 | ca-certificates \ 15 | bash \ 16 | curl \ 17 | wget \ 18 | vim \ 19 | nano \ 20 | htop \ 21 | iputils-ping && \ 22 | echo "cat ~/.bash_banner" >> /root/.bashrc && \ 23 | rm -rf /var/lib/apt/lists/* && \ 24 | apt-get clean 25 | 26 | CMD ["sleep", "infinity"] 27 | 28 | 29 | ### nettools container image 30 | FROM base AS net 31 | 32 | RUN apt update && \ 33 | apt install -y --no-install-recommends \ 34 | socat \ 35 | tcpdump \ 36 | dnsutils \ 37 | nmap \ 38 | net-tools \ 39 | ethtool \ 40 | netcat-openbsd \ 41 | sysstat \ 42 | iftop \ 43 | iotop \ 44 | lsof \ 45 | mtr && \ 46 | rm -rf /var/lib/apt/lists/* && \ 47 | apt-get clean 48 | 49 | CMD ["sleep", "infinity"] 50 | 51 | 52 | ### kubectl container image 53 | FROM base AS kubectl 54 | 55 | RUN apt update && apt install -y gnupg2 && \ 56 | curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.29/deb/Release.key | gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg && \ 57 | echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.29/deb/ /' > /etc/apt/sources.list.d/kubernetes.list && \ 58 | apt update && apt install -y kubectl && \ 59 | rm -rf /var/lib/apt/lists/* && \ 60 | apt-get clean 61 | 62 | CMD ["sleep", "infinity"] 63 | -------------------------------------------------------------------------------- /.github/workflows/new-version.yml: -------------------------------------------------------------------------------- 1 | name: new-version 2 | 3 | on: 4 | schedule: 5 | - cron: '0 8 1 * *' 6 | workflow_dispatch: 7 | 8 | jobs: 9 | new-tag: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Find last tag 13 | uses: oprypin/find-latest-tag@v1 14 | with: 15 | repository: ${{ github.repository }} 16 | releases-only: false 17 | id: previousTag 18 | - name: Checkout previous tag 19 | uses: actions/checkout@v6 20 | with: 21 | ref: ${{ steps.previousTag.outputs.tag }} 22 | token: ${{ secrets.GH_PAT }} 23 | - name: Get sha from commit 24 | id: tagCommitSHA 25 | run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT 26 | - name: Get next patch version 27 | id: nextTag 28 | env: 29 | TAG: ${{ steps.previousTag.outputs.tag }} 30 | run: | 31 | wget -O ./semver https://raw.githubusercontent.com/fsaintjacques/semver-tool/master/src/semver 32 | chmod +x ./semver 33 | echo "nextPatch=$(./semver bump patch $TAG)" >> $GITHUB_OUTPUT 34 | - name: Create new tag 35 | uses: rickstaa/action-create-tag@v1 36 | with: 37 | tag: v${{ steps.nextTag.outputs.nextPatch }} 38 | commit_sha: ${{ steps.tagCommitSHA.outputs.sha }} 39 | message: "" 40 | - name: Create Release 41 | uses: ncipollo/release-action@v1 42 | with: 43 | token: ${{ secrets.GH_PAT }} 44 | tag: v${{ steps.nextTag.outputs.nextPatch }} 45 | name: Release v${{ steps.nexttag.outputs.nextPatch }} 46 | body: | 47 | This is an automatic release to update the packages inside the container 48 | The container image can be downloaded at ghrc.io and docker.io 49 | 50 | Basic container: 51 | `ghcr.io/dergeberl/multitool:v${{ steps.nextTag.outputs.nextPatch }}` 52 | `dergeberl/multitool:v${{ steps.nextTag.outputs.nextPatch }}` 53 | 54 | Network container: 55 | `ghcr.io/dergeberl/multitool-net:v${{ steps.nextTag.outputs.nextPatch }}` 56 | `dergeberl/multitool-net:v${{ steps.nextTag.outputs.nextPatch }}` 57 | 58 | Kubectl container 59 | `ghcr.io/dergeberl/multitool-kubectl:v${{ steps.nextTag.outputs.nextPatch }}` 60 | `dergeberl/multitool-kubectl:v${{ steps.nextTag.outputs.nextPatch }}` 61 | draft: false 62 | prerelease: false -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # multitool-container 2 | 3 | ![GitHub release](https://img.shields.io/github/v/release/dergeberl/multitool-container) 4 | ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/dergeberl/multitool-container/container.yml?branch=main) 5 | 6 | Three containers with useful tools for troubleshooting. 7 | 8 | ## basic container 9 | 10 | This container has the following tools/packages installed: 11 | - bash 12 | - curl 13 | - wget 14 | - vim 15 | - nano 16 | - iputils-ping 17 | - htop 18 | 19 | The container image can be downloaded by ghrc.io and docker.io 20 | 21 | `ghcr.io/dergeberl/multitool:latest` 22 | `dergeberl/multitool:latest` 23 | 24 | ## network container 25 | 26 | The following tools/packages are installed in this container in addition to the basic container: 27 | - socat 28 | - tcpdump 29 | - dnsutils 30 | - nmap 31 | - net-tools 32 | - ethtool 33 | - netcat-openbsd 34 | - sysstat 35 | - iftop 36 | - iotop 37 | - lsof 38 | - mtr 39 | 40 | The container image can be downloaded by ghrc.io and docker.io 41 | 42 | `ghcr.io/dergeberl/multitool-net:latest` 43 | `dergeberl/multitool-net:latest` 44 | 45 | ## kubectl container 46 | 47 | The following tools/packages are installed in this container in addition to the basic container: 48 | - kubectl 49 | 50 | The container image can be downloaded by ghrc.io and docker.io 51 | 52 | `ghcr.io/dergeberl/multitool-kubectl:latest` 53 | `dergeberl/multitool-kubectl:latest` 54 | 55 | 56 | All containers are available for the following arch: 57 | 58 | - amd64 59 | - armv7 60 | - arm64 61 | 62 | 63 | ## usage docker 64 | 65 | ```bash 66 | docker run --rm -it --name multitool ghcr.io/dergeberl/multitool:latest /bin/bash 67 | ``` 68 | 69 | ## usage kubernetes 70 | 71 | ```bash 72 | kubectl run -i --tty --image ghcr.io/dergeberl/multitool:latest multitool -- /bin/bash 73 | ``` 74 | 75 | ### ephemeral container (`kubectl debug`) 76 | 77 | Start a ephemeral container in an existing pod with the `kubectl debug` command. 78 | Checkout kubernetes docs: https://kubernetes.io/docs/tasks/debug/debug-application/debug-running-pod/#ephemeral-containe 79 | 80 | 81 | The following commands adds ephemeral container in with a bash: 82 | ```bash 83 | kubectl debug -iq --image=ghcr.io/dergeberl/multitool:latest -- /bin/bash 84 | ``` 85 | 86 | The following commands adds ephemeral container in with a `tcpdump` and pipes the output directly to `wireshark`: 87 | ```bash 88 | kubectl debug -iq --image=ghcr.io/dergeberl/multitool-net:latest -- tcpdump -i any -w - | wireshark -k -i - 89 | ``` -------------------------------------------------------------------------------- /.github/workflows/container.yml: -------------------------------------------------------------------------------- 1 | name: build-container 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | tags: 8 | - v* 9 | pull_request: 10 | branches: [ main ] 11 | 12 | jobs: 13 | build: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v6 17 | - name: Docker meta base 18 | id: docker_meta_base 19 | uses: docker/metadata-action@v5 20 | with: 21 | images: ghcr.io/dergeberl/multitool,dergeberl/multitool 22 | tags: | 23 | type=ref,event=branch 24 | type=semver,pattern={{version}} 25 | type=semver,pattern={{major}}.{{minor}} 26 | type=semver,pattern=v{{version}} 27 | type=semver,pattern=v{{major}}.{{minor}} 28 | - name: Docker meta net 29 | id: docker_meta_net 30 | uses: docker/metadata-action@v5 31 | with: 32 | images: ghcr.io/dergeberl/multitool-net,dergeberl/multitool-net 33 | tags: | 34 | type=ref,event=branch 35 | type=semver,pattern={{version}} 36 | type=semver,pattern={{major}}.{{minor}} 37 | type=semver,pattern=v{{version}} 38 | type=semver,pattern=v{{major}}.{{minor}} 39 | - name: Docker meta kubectl 40 | id: docker_meta_kubectl 41 | uses: docker/metadata-action@v5 42 | with: 43 | images: ghcr.io/dergeberl/multitool-kubectl,dergeberl/multitool-kubectl 44 | tags: | 45 | type=ref,event=branch 46 | type=semver,pattern={{version}} 47 | type=semver,pattern={{major}}.{{minor}} 48 | type=semver,pattern=v{{version}} 49 | type=semver,pattern=v{{major}}.{{minor}} 50 | - name: Set up QEMU 51 | uses: docker/setup-qemu-action@v3 52 | with: 53 | platforms: all 54 | - name: Set up Docker Buildx 55 | id: buildx 56 | uses: docker/setup-buildx-action@v3 57 | with: 58 | version: latest 59 | - name: Login to GitHub Container Registry 60 | uses: docker/login-action@v3 61 | if: ${{ github.event_name != 'pull_request' }} 62 | with: 63 | registry: ghcr.io 64 | username: ${{ github.actor }} 65 | password: ${{ secrets.GITHUB_TOKEN }} 66 | - name: Login to Docker Hub 67 | uses: docker/login-action@v3 68 | if: ${{ github.event_name != 'pull_request' }} 69 | with: 70 | username: ${{ github.repository_owner }} 71 | password: ${{ secrets.DOCKER_HUB_TOKEN }} 72 | - name: Build and push basic image 73 | id: docker_build_basic 74 | uses: docker/build-push-action@v6 75 | with: 76 | context: . 77 | file: ./Dockerfile 78 | platforms: linux/amd64,linux/arm/v7,linux/arm64 79 | push: ${{ github.event_name != 'pull_request' }} 80 | tags: ${{ steps.docker_meta_base.outputs.tags }} 81 | labels: ${{ steps.docker_meta_base.outputs.labels }} 82 | target: base 83 | - name: Build and push network image 84 | id: docker_build_net 85 | uses: docker/build-push-action@v6 86 | with: 87 | context: . 88 | file: ./Dockerfile 89 | platforms: linux/amd64,linux/arm/v7,linux/arm64 90 | push: ${{ github.event_name != 'pull_request' }} 91 | tags: ${{ steps.docker_meta_net.outputs.tags }} 92 | labels: ${{ steps.docker_meta_net.outputs.labels }} 93 | target: net 94 | - name: Build and push kubectl image 95 | id: docker_build_kubectl 96 | uses: docker/build-push-action@v6 97 | with: 98 | context: . 99 | file: ./Dockerfile 100 | platforms: linux/amd64,linux/arm64 101 | push: ${{ github.event_name != 'pull_request' }} 102 | tags: ${{ steps.docker_meta_kubectl.outputs.tags }} 103 | labels: ${{ steps.docker_meta_kubectl.outputs.labels }} 104 | target: kubectl --------------------------------------------------------------------------------