[转载]docker容器中出现错误:ls: cannot access ‘./source‘: Operation not permitted————————————————

原文链接:docker容器中出现错误:ls: cannot access ‘./source‘: Operation not permitted_ls: .: operation not permitted-优快云博客

错误
docker容器中出现错误:ls: cannot access ‘./source’: Operation not permitted

原因
我的docker版本是17.03.2-ce,太低了

解决方法
(1)方法一
创建docker容器时加上--privileged=true参数

(2)方法二
将docker版本升级至 20.10.8+ 、 libseccomp 升级至 2.4.2+
————————————————

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
                        
原文链接:https://blog.youkuaiyun.com/weixin_45753881/article/details/126442552

[root@yfw ~]# cd /opt/openfire/enterprise/spark/Spark [root@yfw Spark]# sudo -l Matching Defaults entries for root on yfw: !visiblepw, always_set_home, match_group_by_gid, always_query_group_plugin, env_reset, env_keep="COLORS DISPLAY HOSTNAME HISTSIZE KDEDIR LS_COLORS", env_keep+="MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE", env_keep+="LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES", env_keep+="LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE", env_keep+="LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY", secure_path=/sbin\:/bin\:/usr/sbin\:/usr/bin User root may run the following commands on yfw: (ALL) ALL [root@yfw Spark]# touch /etc/test_file [root@yfw Spark]# mount | grep " $(df / | tail -1 | awk '{print $1}') " [root@yfw Spark]# mount | grep "$(df /etc | tail -1 | awk '{print $1}')" /dev/vda1 on / type ext4 (rw,relatime) [root@yfw Spark]# cat > /etc/systemd/system/spark-client.service << 'EOF' > [Unit] > Description=Openfire Spark Client (Headless) > After=xvfb.service network.target > PartOf=xvfb.service > > [Service] > Type=simple > User=openfire > Group=openfire > > Environment=DISPLAY=:99 > Environment=PATH=/opt/openfire/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin > > WorkingDirectory=/opt/openfire/enterprise/spark/Spark > > ExecStart=/opt/openfire/enterprise/spark/Spark/Spark > > StandardOutput=journal > StandardError=journal > > Restart=always > RestartSec=10 > > NoNewPrivileges=true > PrivateTmp=true > > [Install] > WantedBy=multi-user.target > EOF -bash: /etc/systemd/system/spark-client.service: Operation not permitted [root@yfw Spark]# ls -l /etc/systemd/system/spark-client.service ls: cannot access '/etc/systemd/system/spark-client.service': No such file or directory [root@yfw Spark]# sestatus SELinux status: disabled [root@yfw Spark]# mount | grep "/etc/systemd/system" [root@yfw Spark]# findmnt /etc/systemd/system [root@yfw Spark]#
最新发布
10-31
[root@yfw ~]# cd /opt/openfire [root@yfw openfire]# cat > install-sdk.sh << 'EOF' > #!/bin/bash > # > # Copyright (C) Jive Software, 2006-2022 > # > # Install the Openfire SDK into your local Maven repository. > # > > set -e > > # Check for required tools > if ! command -v mvn >/dev/null 2>&1; then > echo "Maven is required but not found. Please install Maven." > exit 1 > fi > > VERSION=$1 > if [ -z "$VERSION" ]; then > echo "Usage: $0 <version>" > echo "Example: $0 4.9.2" > exit 1 > fi > > REPO_DIR="$HOME/.m2/repository/org/igniterealtime/openfire/openfire/$VERSION" > > echo "Installing Openfire SDK version $VERSION..." > > # Create target directory > mkdir -p "$REPO_DIR" > > # Download openfire-${VERSION}.jar and openfire-${VERSION}-sources.jar > JAR_URL="https://www.igniterealtime.org/downloadServlet?filename=openfire/openfire_${VERSION}.zip" > > echo "Downloading Openfire distribution package..." > TMP_ZIP=$(mktemp -t openfire-sdk-XXXXXX.zip) > wget -qO "$TMP_ZIP" "$JAR_URL" > > # Extract JAR and POM > unzip -p "$TMP_ZIP" openfire/lib/openfire.jar > "$REPO_DIR/openfire-$VERSION.jar" > unzip -p "$TMP_ZIP" openfire/lib/compile-only/pom.xml > "$REPO_DIR/openfire-$VERSION.pom" > > # Also install sources if available (optional) > if unzip -p "$TMP_ZIP" openfire/src/openfire_src.zip > /dev/null 2>&1; then > unzip -p "$TMP_ZIP" openfire/src/openfire_src.zip > "$REPO_DIR/openfire-$VERSION-sources.jar" > else > touch "$REPO_DIR/openfire-$VERSION-sources.jar" > fi > > # Cleanup > rm -f "$TMP_ZIP" > > echo "[INFO] SDK installed successfully at $REPO_DIR" > echo "[INFO] You can now build Openfire plugins using Maven." > EOF [root@yfw openfire]# [root@yfw openfire]# # 添加可执行权限 [root@yfw openfire]# chmod +x install-sdk.sh [root@yfw openfire]# ./install-sdk.sh 4.9.2 Maven is required but not found. Please install Maven. [root@yfw openfire]# ls ~/.m2/repository/org/igniterealtime/openfire/openfire/4.9.2/ ls: cannot access '/root/.m2/repository/org/igniterealtime/openfire/openfire/4.9.2/': No such file or directory [root@yfw openfire]# # 查看 rpm 是否已安装 maven 包 [root@yfw openfire]# rpm -q maven maven-3.5.4-5.module_el8.0.0+39+6a9b6e22.noarch [root@yfw openfire]# # 查找 mvn 所在位置 [root@yfw openfire]# find /usr -name mvn 2>/dev/null /usr/share/bash-completion/completions/mvn /usr/share/maven/bin/mvn [root@yfw openfire]# ln -s /usr/share/maven/bin/mvn /usr/local/bin/mvn ln: failed to create symbolic link '/usr/local/bin/mvn': Operation not permitted [root@yfw openfire]# mvn -v -bash: mvn: command not found [root@yfw openfire]#
10-02
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值