skip to content
Alvin Lucillo

Docker logs access

/ 1 min read

💻 Tech

If you need a pod to access container files like logs, the pod needs elevated logs.

Container file directory: /var/lib/docker/containers

Security context to be used by the pod:

securityContext:
    runAsUser: 1000

You will notice that you can’t even access that directory when you navigate to the node’s directory. If you’re using minikube, SSH into the node via minikube ssh, then CD into the directory. To access it, elevate your privilege by using the root access via sudo -i. That demonstrates that you need elevated access to view the Docker files and does a pod.