From b39b20021e0d01ce7812b03aed3a3eb0d20f8158 Mon Sep 17 00:00:00 2001 From: Madhu RAJAGOPAL Date: Thu, 21 Nov 2024 10:23:00 +1300 Subject: [PATCH] feat: Create container image of utility tools not avialable in production containers * The container can then be attached to a target container ephermerally for troubleshooting the target container * These tools include curl, netcat, iproute2, iperf, bash * The Makefile currently creates an image for linux/amd64 systems --- Makefile | 3 +++ nginx-debugger/Dockerfile | 10 ++++++++++ 2 files changed, 13 insertions(+) create mode 100644 nginx-debugger/Dockerfile diff --git a/Makefile b/Makefile index c478dd0..bbd4469 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,8 @@ build: go build -o cmd/kubectl-nginx_supportpkg +debugger: + docker buildx build --platform linux/amd64 -t nginx-debugger -f nginx-debugger/Dockerfile . + install: build sudo cp cmd/kubectl-nginx_supportpkg /usr/local/bin \ No newline at end of file diff --git a/nginx-debugger/Dockerfile b/nginx-debugger/Dockerfile new file mode 100644 index 0000000..d535a65 --- /dev/null +++ b/nginx-debugger/Dockerfile @@ -0,0 +1,10 @@ +FROM alpine:latest + +RUN apk --update add bind-tools curl netcat-openbsd iproute2 iperf bash && rm -rf /var/cache/apk/* \ + && ln -s /usr/bin/iperf /usr/local/bin/iperf \ + && ls -altrh /usr/local/bin/iperf + +ADD https://github.com/coredns/coredns/releases/download/v1.11.4/coredns_1.11.4_linux_amd64.tgz /coredns.tgz +RUN tar -xzvf /coredns.tgz && rm -f /coredns.tgz + +CMD ["bash"] \ No newline at end of file