Skip to content

Commit

Permalink
add dockerfile and ci workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
evgenyKharitonov committed Jul 24, 2023
1 parent 4215197 commit 27eec35
Show file tree
Hide file tree
Showing 4 changed files with 165 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build Docker image

on:
pull_request:
types: ["opened", "synchronize", "reopened"]

jobs:
build_docker_image:
name: Build Docker image
runs-on: ubuntu-20.04
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: |
tailordevdockermachine/podPeeper
- name: Build and wihtout push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
35 changes: 35 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish Docker image

on:
push:
branches:
- "master"

jobs:
push_to_registries:
name: Push Docker image to Dockerhub
runs-on: ubuntu-20.04
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: |
tailordevdockermachine/podPeeper
- name: Build and push Docker images
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM alpine:3.18.2


RUN apk update && apk add \
postgresql-client \
curl \
nmap \
curl \
netcat-openbsd \
tcpdump \
bind-tools \
jq \
bash \
bash-completion \
&& apk add --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing/ --no-cache \
grpcurl \
wget \
vim \
tmux \
unzip

CMD ["/bin/bash"]
81 changes: 80 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,81 @@
# PodPeeper
PodPeeper is a simple Dockerfile that used for starting a pod in a kubernetes cluster with common tools

## Docker Image for Kubernetes Debugging

This repository contains a Dockerfile that builds a lightweight Alpine-based image with essential debugging tools installed. The image is designed to be used as a pod in Kubernetes for debugging purposes, providing easy access to various tools that can aid in troubleshooting and inspecting network-related issues.

## Usage with kubectl

To use this Docker image for debugging in Kubernetes using `kubectl`, you can run the following command:

```bash
kubectl run debug --rm -i --tty --image tailordevdockermachine/podpeeper:latest -- bash
```

This `kubectl` command will create a temporary pod named "debug" using the specified Docker image. It will allocate an interactive terminal and attach it to the pod, allowing you to use the included debugging tools directly within the Kubernetes environment. The pod will be automatically removed once you exit the debugging session.

## Tools Included

The Docker image is based on Alpine Linux 3.18.2 and comes pre-installed with the following debugging tools:

- `postgresql-client`: PostgreSQL client for connecting to and interacting with PostgreSQL databases.
- `curl`: Command-line tool for making HTTP requests and transfers.
- `nmap`: Network exploration tool and security scanner.
- `netcat-openbsd`: Feature-rich networking utility for reading and writing data across network connections.
- `tcpdump`: Packet analyzer that captures and inspects network traffic.
- `bind-tools`: Set of DNS utilities, including `dig` and `nslookup`.
- `jq`: Lightweight and flexible command-line JSON processor.
- `bash`: GNU Bourne-Again SHell, a powerful command-line interpreter.
- `bash-completion`: Bash tab completion support.
- `grpcurl`: Command-line tool for interacting with gRPC servers.
- `wget`: Command-line utility for downloading files from the web.
- `vim`: Feature-rich text editor, ideal for quick file editing.
- `tmux`: Terminal multiplexer for managing multiple terminal sessions within a single window.
- `unzip`: Command-line utility for extracting ZIP archives.

## Getting Started

To use this Docker image outside of Kubernetes, you can pull it directly from DockerHub or build it locally using the provided Dockerfile.

### Pull from DockerHub

You can pull the latest version of the image from DockerHub using the following command:

```bash
docker pull tailordevdockermachine/podpeeper:latest
```


### Build Locally

If you prefer to build the image locally, follow these steps:

1. Clone this repository to your local machine:

```bash
git clone https://github.com/TailorBrands/PodPeeper
```

2. Change into the repository directory:

```bash
cd PodPeeper
```

3. Build the Docker image using the following command:

```bash
docker build -t <image_name>:<tag> .
```

Replace `<image_name>` and `<tag>` with your desired image name and version.

## Contributing

If you encounter any issues or have suggestions for improvements, feel free to open an issue or submit a pull request. We welcome contributions from the community!

## License

This project is licensed under the MIT License.

**Note**: This Docker image is intended for debugging purposes and might contain various tools that could be used for troubleshooting and network inspection. Ensure proper authorization and usage when deploying it in production environments.

0 comments on commit 27eec35

Please sign in to comment.