Docker无法将文件复制到安装的卷

时间:2020-09-07 08:21:06

标签: 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上运行

1 个答案:

答案 0 :(得分:0)

Jenkins的用户似乎没有对指定文件夹的写权限。

编辑:请尝试

sudo usermod -aG docker jenkins