0

尝试使用 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

有什么想法可能导致这种情况吗?

4

1 回答 1

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 中的多个容器使用。

于 2019-07-16T10:21:06.317 回答