lotnsa.blogg.se

Jenkins shell permission denied
Jenkins shell permission denied










jenkins shell permission denied

Show all groups in the container bash-4.4$ cat /etc/group root:x:0:root bin:x:1:root,bin,daemon daemon:x:2:root,bin,daemon sys:x:3:root,bin,adm adm:x:4:root,adm,daemon nogroup:x:65533: nobody:x:65534: jenkins:x:1000:jenkins docker:x:101. Ī GID (group identifier) is a name that associates a system user with other users sharing something in common. This number is used to identify the user to the system and to determine which system resources the user can access.

jenkins shell permission denied

Necessary background knowledge:Ī UID (user identifier) is a number assigned by Linux to each user on the system.

jenkins shell permission denied

This user has access to the Docker client in the container but not to /var/run/docker.sock. The id of the group is also 1000, but they are used to identify different entities(one for the user, the other for the group). This user belongs to a user group called jenkins. The default user in the container is named jenkins, and its id is 1000. bash-4.4$ id uid=1000(jenkins) gid=1000(jenkins) groups=1000(jenkins) bash-4.4$ docker version Client: Version: 18.09.8-ce API version: 1.39 Go version: go1.11.5 Git commit: 0dd43dd87fd530113bf44c9bba9ad8b20ce4637f Built: Sat Jul 20 15:21:00 2019 OS/Arch: linux/amd64 Experimental: false Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get : dial unix /var/run/docker.sock: connect: permission denied Use id to show id and group of the current user, and use docker version to check docker information. I log in to the container and check its user information. The newly created container is named Jenkins. These commands can reproduce the situation # create a jenkins container and mount the local docker socket to the container docker run -d -name jenkins -p 8080:8080 -p 50000:50000 -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd)/local:/var/jenkins_home -v "$HOME":/home jenkinsci/blueocean Later I noticed that the user is the one in the Jenkins container instead of the user on my mac. Unfortunately, I misunderstood the solution and got frustrated at the beginning, since there is no “docker group” on macOS, at least I could not find one on my mac.Ĭommand to list all groups on a macOS dscacheutil -q group I googled this problem, and most of the solutions are the same “ adding the user to docker group”. However, the user in the Jenkins container doesn’t have access permission to the mounted docker socket.

#Jenkins shell permission denied mac

TL DR, check out the solution at the bottom Environment:īriefly speaking, I created a Jenkins container on my mac and mounted the docker socket and other local directories to the container like what has been mentioned in the tutorial.












Jenkins shell permission denied