jenkins - 如何使用 docker-compose 解决 Jenkins 错误
问题描述
我试图用 docker-compose 运行 jenkins
version: '3.5'
services:
jenkins:
build:
context: .
dockerfile: ./jenkins.Dockerfile
volumes:
- $PWD/jenkins_home:/var/jenkins_home
- $PWD:/app
ports:
- 8080:8080
但最终在尝试访问某些卷时出现此访问被拒绝错误。我无法在浏览器中打开 Localhost。
WARNING: The Docker Engine you're using is running in swarm mode.
Compose does not use swarm mode to deploy services to multiple nodes in a swarm. All containers will be scheduled on the current node.
To deploy your application across the swarm, use `docker stack deploy`.
Starting 8fd02292a7fe_ejercicio_jenkins_1 ...
Starting 8fd02292a7fe_ejercicio_jenkins_1 ... done
Attaching to 8fd02292a7fe_ejercicio_jenkins_1
8fd02292a7fe_ejercicio_jenkins_1 | Can not write to /var/jenkins_home/copy_reference_file.log. Wrong volume permissions?
8fd02292a7fe_ejercicio_jenkins_1 | touch: cannot touch '/var/jenkins_home/copy_reference_file.log': Permission denied
8fd02292a7fe_ejercicio_jenkins_1 exited with code 1
我该如何解决这个问题?
解决方案
跑
chmod 777 -R $PWD/jenkins_home
推荐阅读
- cordova - 通过 HTTPS 服务 Ionic 5 Cordova 应用程序
- javascript - JavaScript/Lodash:deepClone 似乎正在改变目标对象
- python - 在 python 中前滚数据,保持日期一致
- r - 代码逐行运行良好,但在 rmarkdown 中作为一个整体运行时失败
- r - 如何根据 R 中的多个条件将变量解析为多个列?
- python - 尝试通过 python 发送电子邮件并使用套接字出错
- java - 如何将字符串拆分为映射,使用流按重复键对值进行分组?
- javascript - 在 javascript 上使用 html 从 firebase 中删除数据
- c++ - VS Code C++ 重命名符号,跳过注释
- android-studio - Android Studio 在 KMP/KMM/KN 中添加了错误的 xcodeproj 位置