【问题标题】:JFrog Xray installation Docker install on CentOS - permission deniedJFrog Xray 安装 Docker 在 CentOS 上安装 - 权限被拒绝
【发布时间】:2023-09-23 23:28:02
【问题描述】:

尝试使用 Docker 安装程序在 CentOS 机器上安装 JFrog Xray。 我创建了一个 /opt/xray 目录,我已将安装文件下载到其中。

然后在这个文件上运行 chmod +x xray。

当我尝试使用 sudo "./xray install" 进行安装时,我得到以下输出:

[root@xray xray]# sudo ./xray install
INFO: Using XRAY_MOUNT_ROOT=/root/.jfrog/xray
Verifying Xray prerequisites ...
WARNING: Running with 3GB Total RAM
WARNING: Running with 1 CPU Cores
The System resources are not aligned with Xray minimal prerequisites, Do you want to proceed with the process? [Y
touch: cannot touch '/data/installer.info': Permission denied
Are you adding this node to an existing cluster? (not relevant for the first cluster node) [Y/n]: n
mkdir: cannot create directory '/xray_global_mount_root/xray': Permission denied
./wrapper.sh: line 583: /xray_global_mount_root/xray/ha/ha-node.properties: No such file or directory
./wrapper.sh: line 586: /data/installer.info: Permission denied
./wrapper.sh: line 589: /data/installer.info: Permission denied
./wrapper.sh: line 592: /data/installer.info: Permission denied
ERROR: Installation failed

任何想法可能导致这种情况?

【问题讨论】:

  • 问题已获得许可,如所述。需要检查脚本。你能把安装脚本上传到哪里吗?

标签: artifactory jfrog-xray


【解决方案1】:

我在 RHEL 上遇到了类似的问题,而且是 selinux 妨碍了我。要修复它,请更改 xray 脚本中的以下行:-

XRAY_VOLUMES="-v ${XRAY_MOUNT_ROOT}/xray-installer:/data -v ${XRAY_MOUNT_ROOT}:/xray_global_mount_root"

对此:-

XRAY_VOLUMES="-v ${XRAY_MOUNT_ROOT}/xray-installer:/data:z -v ${XRAY_MOUNT_ROOT}:/xray_global_mount_root:z"

(基本上将 :z 添加到每个卷中)。

这确保文件夹被标记为由 selinux 中的多个容器使用。

【讨论】: