当前位置: 首页 > news >正文

记录一次docker报错无法访问文件夹,权限错误问题

记录一次docker报错无法访问文件夹,权限错误问题

1. 背景

  1. 使用docker安装photoview,为其分配了一个cache目录,用户其缓存数据。
  2. 在运行过程中,扫描文件后显示如下错误

could not make album image cache directory: mkdir /app/cache

  1. 检查映射的目录,其目录下无任何文件,符合报错内容即无法正确访问文件夹。
  2. 官方github的解答为:

Make sure that your media library’s root folder and all the files and
subfolders are readable and searchable by other users: run the next
command (or corresponding sequence of commands from the ):Makefile

make readable If command(s) return error, run them under the user,
owning corresponding files and folders. Alternatively, run them adding
before the command: this will switch the execution context to user and
ask for the root password. You have to have permission to run in the
system.Permission deniedsudo rootsudo

If you don’t want to give required permissions to group for your
files, alternatively, you can:others

create a group on your host with GID=999 and make all the files and
folders inside volumes of the service being owned by this group; then
set the appropriate permissions to the section.photoviewgroup create
on your host a group with GID=999 and a user in this group with
UID=999; then change the ownership of all the files and folders inside
volumes of the service to this user; then set the appropriate
permissions to the section.photoviewuser If you configured other
mounts with media files from other locations on the host (like
HOST_PHOTOVIEW_MEDIA_FAMILY or anything else), you need to run the
same commands, as in the target, for each media root folder on your
host manually: copy each command to your shell and replace the
variable with the absolute path to an additional media root folder
without the trailing . Run both commands for each additional root
folder.Makefilereadable/

  1. 官方的方式太复杂了,显示需要创建用户组并将对应的文件夹加入用户组,我不希望这么麻烦。

2. 解决

  1. 主要原因是文件夹的权限,默认是root,将其修改权限,为所有用户可以访问即可。
  2. 如果通过自己的compose安装,默认就是777的权限,但通过unraid进行安装,权限就不是这个。
  3. 修改对应文件夹的权限
chmod -R 777 /mnt/user/appdata/photoview
  1. 修改后重启docker即可正常运行了
http://www.lryc.cn/news/452445.html

相关文章:

  • react crash course 2024(8) useEffect
  • GEE开发之Modis_NDWI数据分析和获取
  • netty之NettyClient半包粘包处理、编码解码处理、收发数据方式
  • Linux:文件描述符介绍
  • stm32f103调试,程序与定时器同步设置
  • 《Python编程:从入门到实践》数据可视化
  • github/git密钥配置与使用
  • BiLSTM模型实现电力数据预测
  • VMware ESXi 6.7U3u macOS Unlocker 集成驱动版更新 OEM BIOS 2.7 支持 Windows Server 2025
  • 一个简单的SQL面试题
  • 网站服务器在不同操作系统上监听端口情况的方法
  • RabbitMQ篇(基本介绍)
  • 浅谈网络通信中的透传和非透传
  • 影视cms泛目录用什么程序?苹果cms二次开发泛目录插件
  • IP6537_C_30W20V--移动设备快充的得力助手,集成 14 种快充协议的降压 SoC
  • 【hot100-java】【寻找两个正序数组的中位数】
  • C++七种异常处理
  • 【C语言系统编程】【第三部分:网络编程】3.3 实践与案例分析
  • Unity3D播放GIF图片 插件播放
  • 基于STM32的远程工业控制系统架构设计:MQTT通信、React界面与FreeRTOS优化的综合应用
  • 墙绘艺术在线交易平台:SpringBoot技术详解
  • VMware中Ubuntu系统Docker正常运行但网络不通(已解决)
  • 【web安全】——文件包含漏洞
  • 游戏如何对抗改包
  • 12.梯度下降法的具体解析——举足轻重的模型优化算法
  • GPT对话知识库——C、C++,还有Java,他们之间有什么区别
  • 华为GaussDB数据库之Yukon安装与使用
  • Linux命令:用于显示 Linux 发行版信息的命令行工具lsb_release详解
  • sbb-classes 元素
  • (作业)第三期书生·浦语大模型实战营(十一卷王场)--书生入门岛通关第3关Git 基础知识