I am running a jenkins docker application (https://hub.docker.com/r/jenkinsci/blueocean/)
I am trying to do a docker run on jenkins but received this error:Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
I tried doing : sudo usermod -aG docker jenkins but it said that jenkins user does not exist. I tried doing add admin also but it said it does not exists also.
What am i doing wrong?
I presume that docker service is up & running, if not verify it by running below command -
$ sudo systemctl status docker.service
Run below command to make it work -
$ sudo usermod -aG docker $USER
Log out/in to activate the changes to groups
Explanation -
Change user
jenkins
with the username which you are logged in on your host -$ sudo usermod -aG docker $USER
Log out/in to activate the changes to groups, then you can do a
docker run .....
successfully.Note - Jenkins user exists inside the docker container & not on your host machine.
Ref - https://docs.docker.com/install/linux/linux-postinstall/