bash - Docker 无法将文件复制到挂载的卷
问题描述
我无法在 jenkins 上运行此命令,但我可以在 windows powershell 上运行相同的命令
16:13:55 + docker run -v /opt/jenkins/workspace/tas/zigbee-gateway/hostoutput/:/home/jenkins/output_to_host tas-gateway cp -a /home/jenkins/output/. /home/jenkins/output_to_host
16:13:55 cp: cannot create regular file '/home/jenkins/output_to_host/./Gateway_INTL_1.0.4-10_ramips_24kec.ipk': Permission denied
16:13:55 cp: cannot create regular file '/home/jenkins/output_to_host/./Gateway_CN_1.0.4-10_ramips_24kec.ipk': Permission denied
16:13:55 cp: cannot create regular file '/home/jenkins/output_to_host/./Gateway_TEST_1.0.4-10_ramips_24kec.ipk': Permission denied
16:13:55 cp: preserving times for '/home/jenkins/output_to_host/.': Operation not permitted
我错过了什么?jenkins 在亚马逊 linux 上运行
解决方案
看起来 Jenkins 的用户没有对指定文件夹的写入权限。
编辑:请尝试
sudo usermod -aG docker jenkins
推荐阅读
- r - Keras fit 函数需要以哪种形式输入和标签数据?
- python - 无法在 ArcMap 中使用 tkinter
- c++ - 使用 dlib 检测器时信号处理不正确
- python - 如何在 django 中修复双重 for 循环
- amazon-web-services - 如何清除 AWS Lambda 缓存(或强制冷启动)
- javascript - 如何让 React 功能组件呈现连续的空格字符?
- python - 如何从 macOS 终端中删除“插件”?(zsh)
- python - Python TCP Select()在没有终止的情况下不为浏览器提供服务
- python - 一周与一天 python 的 seaborn 热图
- javascript - 如何增加圆环图或饼图的大小并将图例保留在图表JS中?