I found out when using DooD in GoCD we just only need to add
/var/run/docker.sock:/var/run/docker.sock
as a volume to the current agent container as clearly defined and written in the official documentation:
https://docs.gocd.org/current/gocd_on_kubernetes/docker_workflows.html.
What I couldn't understand is, even though I've added that volume I couldn't run docker commands using the command: "/bin/bash", arguments: -c \n docker image within the task of goCD server.
Now, I'm wondering if there is clear documentation or steps to make the GoCD agent able to pass a docker commands to the host machine.