Files
oam/knowledge base/get the environment of a process running in a container.md
2022-05-15 00:24:53 +02:00

430 B

Get the environment of a process running in a container

TL;DR

cat /proc/${PID}/environ

# Container in kubernetes.
kubectl exec pod-name -- cat /proc/1/environ

# Only works if the onboard `ps` is not from busybox.
ps e -p $PID

Sources