我在通过cif安装了NAS驱动器的情况下运行ubuntu 18.04。我已经拉入jenkins:latest
图像,并使用以下运行命令启动了它:
docker run --restart=unless-stopped --name devonejenkins -p 8080:8080 -p 50000:50000 -v /mnt/storage/jenkins:/var/jenkins_home jenkins
该命令不起作用。但是,在vm上使用本地磁盘,如下所示:
docker run --restart=unless-stopped --name devonejenkins -p 8080:8080 -p 50000:50000 -v /home/chrisg/jenkins:/var/jenkins_home jenkins
似乎工作正常。
如果不粘贴大量的堆栈跟踪代码,这似乎是失败点:
SEVERE: Failed to initialize jenkins java.io.IOException: Failed to set the timestamp of /var/jenkins_home/secrets/initialAdminPassword to 1547434033746
最佳答案
这取决于您如何安装cifs卷。
This example是指 ContainX/docker-volume-netshare
,这是一个docker插件,可在Docker容器内安装NFS v3 / 4,AWS EFS或CIFS。
older (2015) article提到了权限问题:
The docker container will not be permitted to access your CIFS mount point unless you or mount the share with the appropriate SELinux security context.
和:
Unlike NFS, a CIFS mount handles user authentication at mount time. This means that all files and directories at our CIFS mount point will be owned by the same user/group.
This may be a problem if the user of the process running in your container and the user of the CIFS mount are not the same.
I worked around this by mounting the same CIFS share multiple times with different uid and gid arguments.
关于docker - 将docker容器中的jenkins与NAS存储驱动器上的/var/jenkins_home一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54175257/