docker启动jenkins 报错Got permission denied while trying to connect to the Docker

阅读 92

2022-07-28

  1. 查看宿主机 /var/run/docker.sock
  2. docker启动jenkins 报错Got permission denied while trying to connect to the Docker_重启

  3. 查看docker.sock属组
  4. docker启动jenkins 报错Got permission denied while trying to connect to the Docker_docker_02

cd /var/run
ls -l docker.sock

  1. 记录下组id

docker:x:991:

  1. 使用root进入jenkins容器

docker exec -it -u root fe42624a1ccf bash

  1. 在docker内部创建和docker. sock属组id一致的组

groupadd -g 991 docker

  1. 将jenkins加入docker组

gpasswd -a jenkins docker

  1. 重启jenkins容器

留待后查,同时方便他人



精彩评论(0)

0 0 举报