Interview Prep/CI/CD/Jenkins Build and Agent Failures

`Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock`.

BeginnerTroubleshootingJenkins Build and Agent Failures
Answer

Likely causes → The Jenkins agent user is not in the docker group, or group membership was not refreshed.

Diagnose → id jenkins, ls -l /var/run/docker.sock.

Fix → sudo usermod -aG docker jenkins and restart the agent service so the new group applies.

Prevent → Configure it in the image; avoid sharing the socket with untrusted pipelines.

All CI/CD questions Roadmap: CI/CD fundamentals

More on Jenkins Build and Agent Failures