Jenkins中構建(Build)Docker映象時出現permission denied
問題描述
Jenkins中構建(Build)Docker映象時出現permission denied,jenkins日誌如下
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/build?buildargs=%7B%22envType%22%3A%22--spring.profiles.active%3Dtest%22%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&session=swzfw4zq2xwq9bmwlzuibujcj&shmsize=0&t=172.18.207.211%3A5000%2Fzxcx%2Fbff-admin-service%3A1.0.1.13-test&target=&ulimits=null&version=1: dial unix /var/run/docker.sock: connect: permission denied
time="2020-10-10T13:59:03+08:00" level=error msg="Can't close tar writer: io: read/write on closed pipe"
Build step 'Execute shell' marked build as failure
Finished: FAILURE
問題分析
通過Jenkins日誌我們可以看到訪問這個目錄時/var/run/docker.sock:
出現許可權錯誤
解決方案
把這個目錄的許可權開啟
chmod -R 777 /var/run/docker.sock
相關文章
- Docker + maven build problem — unix://localhost:80: Permission deniedDockerMavenUIlocalhost
- 使用docker構建jenkins映象並執行容器DockerJenkins
- Ubuntu git pull 出現Permission denied ErrorUbuntuGitError
- docker構建映象Docker
- Docker使用-v掛載主機目錄到容器後出現Permission deniedDocker
- Docker 構建 kubectl 映象Docker
- Docker映象構建(五)Docker
- git push出現Permission denied (publickey)錯誤Git
- git出現Permission denied的解決辦法Git
- 【踩坑筆記】專案出現Permission denied筆記
- Jenkins 構建自動化 .NET Core 釋出映象Jenkins
- Docker映象構建原理解析(不裝docker也能構建映象)Docker
- 用dockerfile構建docker映象Docker
- Docker 映象構建之 DockerfileDocker
- docker 構建自己的映象Docker
- PHP中 mkdir: Permission denied 問題PHP
- unix /var/run/docker.sock: connect: permission deniedDocker
- Android adb除錯出現:opendir failed, Permission deniedAndroid除錯AI
- Docker 構建PHP 映象環境DockerPHP
- Docker 分階段構建映象Docker
- Docker 映象分階段構建Docker
- Docker構建多平臺映象Docker
- Docker 構建多平臺映象Docker
- Jenkins定時構建Jenkins
- 解決方案 git@github.com出現Permission denied (publickey)Github
- 不用安裝docker也能構建docker映象Docker
- docker之手動構建新的映象Docker
- 使用maven外掛構建docker映象MavenDocker
- Docker容器掛載資料卷出現Permission denied許可權問題的解決辦法Docker
- Hexo deploy git permission deniedHexoGit
- 構建 Docker 映象的 N 個小技巧Docker
- Docker容器學習梳理 - Dockerfile構建映象Docker
- CentOS7.4中Docker以rw方式掛載volume報Permission denied問題CentOSDocker
- Angular macOS Err:EACCES: permission deniedAngularMac
- Permission Denied(publickey) 解決
- -bash: ./backup.sql: Permission deniedSQL
- Nginx: stat() failed (13: permission denied)NginxAI
- Docker從零構建php-nginx-alpine映象DockerPHPNginx