Menu

1 / 2

Debugging Distroless Containers: kubectl debug, Ephemeral Containers, and When to Use Each

DEV Community·Alexandre Vazquez·6 months ago
#UWmT1iag
#option#error#rbac#developer#platform
Reading 0:00
15s threshold

Originally published at alexandre-vazquez.com/debugging-distroless-containers/

The container works fine in CI. It deploys successfully to staging. Then something goes wrong in production and you type the command you always type: kubectl exec -it my-pod -- /bin/bash . The response is immediate: OCI runtime exec failed: exec failed: unable to start container process: exec: "/bin/bash": stat /bin/bash: no such file or directory .

You try /bin/sh . Same error. You try ls . Same error. The container image is distroless — it ships only your application binary and its runtime dependencies, with no shell, no package manager, no debugging tools of any kind. This is intentional and correct from a security standpoint.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.