Skip to content

Commit bd0ee8e

Browse files
committed
feat: add reqtap HTTP request debugging tool to README and Docker setup
1 parent 9f3be2a commit bd0ee8e

File tree

2 files changed

+89
-0
lines changed

2 files changed

+89
-0
lines changed

Docker/reqtap/Dockerfile

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Build stage
2+
FROM alpine:3.19 AS builder
3+
4+
# Set build arguments
5+
ARG VERSION=latest
6+
ARG TARGETPLATFORM
7+
ARG TARGETARCH
8+
9+
# Install build dependencies
10+
RUN apk add --no-cache \
11+
curl \
12+
tar \
13+
gzip \
14+
ca-certificates
15+
16+
# Determine architecture
17+
RUN case "${TARGETARCH}" in \
18+
"amd64") ARCH="amd64" ;; \
19+
"arm64") ARCH="arm64" ;; \
20+
"arm") ARCH="armv7" ;; \
21+
"s390x") ARCH="s390x" ;; \
22+
"ppc64le") ARCH="ppc64le" ;; \
23+
"386") ARCH="i386" ;; \
24+
"riscv64") ARCH="riscv64" ;; \
25+
"armv6") ARCH="armv6l" ;; \
26+
"armv7") ARCH="armv7l" ;; \
27+
*) echo "Unsupported architecture: ${TARGETARCH}" && exit 1 ;; \
28+
esac && echo "ARCH=${ARCH}" > /tmp/arch
29+
30+
# Read architecture
31+
RUN source /tmp/arch
32+
33+
# Download reqtap from GitHub releases
34+
RUN if [ "${VERSION}" = "latest" ]; then \
35+
VERSION=$(curl -s https://api.github.com/repos/funnyzak/reqtap/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'); \
36+
fi && \
37+
ARCH=$(cat /tmp/arch | cut -d'=' -f2) && \
38+
echo "Downloading reqtap version: ${VERSION} for architecture: ${ARCH}" && \
39+
curl -sL "https://github.com/funnyzak/reqtap/releases/download/${VERSION}/reqtap-${VERSION#v}-linux-${ARCH}.tar.gz" -o /tmp/reqtap.tar.gz && \
40+
cd /tmp && \
41+
tar -xzf reqtap.tar.gz && \
42+
chmod +x /tmp/reqtap
43+
44+
# Runtime stage
45+
FROM alpine:3.19
46+
47+
# Set labels
48+
LABEL maintainer="funnyzak <[email protected]>" \
49+
org.label-schema.name="reqtap" \
50+
org.label-schema.description="A powerful HTTP request debugging and proxy tool" \
51+
org.label-schema.url="https://github.com/funnyzak/reqtap" \
52+
org.label-schema.vcs-ref="${VCS_REF}" \
53+
org.label-schema.vcs-url="https://github.com/funnyzak/docker-release" \
54+
org.label-schema.vendor="Funnyzak" \
55+
org.label-schema.schema-version="1.0" \
56+
org.label-schema.build-date="${BUILD_DATE}" \
57+
org.label-schema.version="${VERSION}"
58+
59+
# Install runtime dependencies
60+
RUN apk add --no-cache \
61+
ca-certificates \
62+
tzdata \
63+
curl \
64+
&& rm -rf /var/cache/apk/*
65+
66+
# Create non-root user
67+
RUN addgroup -g 1000 reqtap && \
68+
adduser -D -s /bin/sh -u 1000 -G reqtap reqtap
69+
70+
# Create directories
71+
RUN mkdir -p /etc/reqtap /var/log/reqtap /tmp/reqtap && \
72+
chown -R reqtap:reqtap /etc/reqtap /var/log/reqtap /tmp/reqtap
73+
74+
# Copy binary from builder stage
75+
COPY --from=builder /tmp/reqtap /usr/local/bin/reqtap
76+
77+
# Set ownership
78+
RUN chown reqtap:reqtap /usr/local/bin/reqtap
79+
80+
# Switch to non-root user
81+
USER reqtap
82+
83+
# Set working directory
84+
WORKDIR /app
85+
86+
# Default command
87+
CMD ["/usr/local/bin/reqtap"]

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
- [**Watermark**](https://github.com/funnyzak/docker-release/tree/main/Docker/watermark): Image watermarking service
3333
- [**Environment Mock Data**](https://github.com/funnyzak/docker-release/tree/main/Docker/other): Configurable mock data generation service
3434
- [**brt-data-forwarder**](https://github.com/funnyzak/docker-release/tree/main/Docker/brt-data-forwarder): A brt data forward service.
35+
- [**reqtap**](https://github.com/funnyzak/docker-release/tree/main/Docker/reqtap): HTTP request debugging and proxy tool
3536

3637
### 🛠️ Development Tools & Utilities
3738

@@ -73,6 +74,7 @@
7374
| [Snell Server](https://github.com/funnyzak/docker-release/tree/main/Docker/snell-server/README.md) | [![Docker Tag](https://img.shields.io/docker/v/funnyzak/snell-server?sort=semver&style=flat-square)](https://hub.docker.com/r/funnyzak/snell-server) | [![Docker Image Size](https://img.shields.io/docker/image-size/funnyzak/snell-server)](https://hub.docker.com/r/funnyzak/snell-server) | [![Docker Pulls](https://img.shields.io/docker/pulls/funnyzak/snell-server.svg?style=flat-square)](https://hub.docker.com/r/funnyzak/snell-server) |
7475
| [Cron](https://github.com/funnyzak/docker-release/tree/main/Docker/cron/README.md) | [![Docker Tag](https://img.shields.io/docker/v/funnyzak/cron?sort=semver&style=flat-square)](https://hub.docker.com/r/funnyzak/cron) | [![Docker Image Size](https://img.shields.io/docker/image-size/funnyzak/cron)](https://hub.docker.com/r/funnyzak/cron) | [![Docker Pulls](https://img.shields.io/docker/pulls/funnyzak/cron.svg?style=flat-square)](https://hub.docker.com/r/funnyzak/cron) |
7576
| [Hello](https://github.com/funnyzak/docker-release/tree/main/Docker/hello/README.md) | [![Docker Tag](https://img.shields.io/docker/v/funnyzak/hello?sort=semver&style=flat-square)](https://hub.docker.com/r/funnyzak/hello) | [![Docker Image Size](https://img.shields.io/docker/image-size/funnyzak/hello)](https://hub.docker.com/r/funnyzak/hello) | [![Docker Pulls](https://img.shields.io/docker/pulls/funnyzak/hello.svg?style=flat-square)](https://hub.docker.com/r/funnyzak/hello) |
77+
| [reqtap](https://github.com/funnyzak/docker-release/tree/main/Docker/reqtap/README.md) | [![Docker Tag](https://img.shields.io/docker/v/funnyzak/reqtap?sort=semver&style=flat-square)](https://hub.docker.com/r/funnyzak/reqtap) | [![Docker Image Size](https://img.shields.io/docker/image-size/funnyzak/reqtap)](https://hub.docker.com/r/funnyzak/reqtap) | [![Docker Pulls](https://img.shields.io/docker/pulls/funnyzak/reqtap.svg?style=flat-square)](https://hub.docker.com/r/funnyzak/reqtap) |
7678

7779
<details>
7880
<summary>View all images status table</summary>

0 commit comments

Comments
 (0)