skip to Main Content

I am trying to setup Docker with Jenkins and I need to read /var/run/docker.sock.

I tried temporarily to set permission 666 on file /var/run/docker.sock but when I try to read it as jenkins user it says permission denied.

As far as I know if file permission is 666 any user can read it.

srw-rw-rw- 1 root docker 0 Oct 17 17:05 docker.sock

drwxr-xr-x 31 root root 1100 Oct 17 17:05 run

Directory permission is not issue, /run directory has permission 755. Selinux is disabled. Jenkins user is part of docker gorup.

I do not know what is the problem.

Kind regards,
Ivan

2

Answers


  1. Chosen as BEST ANSWER

    I found the problem, I was mounting /etc/passwd and /etc/groups to docker container but for some reason docker didn't correctly added jenkins user to docker group inside container.

    I had to add group_add: - <docker_group_id> inside docker-compose file. Now everything is working as expected.

    I thought that there was some problem with Centos OS but I found out that someone already had this problem documented at this link: Linux user groups missing when user mounted to container

    I hope this information will help someone.


    1. create jenkins user on your host
    2. get this user id
    3. change ownership of /var/jenkins_home to fetched id.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search