docker - 将docker容器中的jenkins与NAS存储驱动器上的/var/jenkins_home一起使用

标签 docker jenkins nas

我在通过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/

相关文章:

filesystems - 具有共享文件系统的 ActiveMQ HA 选项

docker - 如何获取由本地文件系统上的Docker容器生成的内容

docker - Podman 容器无法通过主机名看到彼此

git - Bitbucket jenkin kubernetes CI/CD

java - Jenkins 中的 PermGen 错误

python - 无需 root 权限即可在 Python 中 Ping 服务器

bash - 从 Jenkins Bash 脚本标记存储库

linux - 模拟磁盘 I/O

storage - 我们可以将存储服务器作为外部硬盘连接到应用服务器吗

deployment - 如何在docker中设置加密的Travis env变量?