nicolaka / netshoot

a Docker + Kubernetes network trouble-shooting swiss-army container
Apache License 2.0
8.64k stars 972 forks source link

Can you please not set the `HOSTNAME` environment variable in the Dockerfile? #167

Closed avbenavides closed 4 weeks ago

avbenavides commented 2 months ago

This is a request. Can you please not set the HOSTNAME environment variable in the Dockerfile? A non-written convention in the K8s and Docker world is that the HOSTNAME environment variable value is the container or host ID. The netshoot Dockerfile breaks this convention by setting the HOSTNAME variable to "netshoot". The uniqueness of HOSTNAME is used (that I've seen) for:

nicolaka commented 4 weeks ago

Hello, You can specify --hostname flag to docker run or k8s pod spec to set the hostname for the container at runtime.

avbenavides commented 4 weeks ago

True but I'm using netshoot to run load tests and that means more than one pod, and thus it is important that the hostname matches the pod name.