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

ops/2024/10/9 5:57:53/

docker_1">记录一次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.ppmy.cn/ops/123024.html

相关文章

k8s的简介和部署

一、k8s简介 在部署应用程序的方式上面,主要经历了三个阶段: 传统部署:互联网早期,会直接将应用程序部署在物理机上优点:简单,不需要其它技术的参与缺点:不能为应用程序定义资源使用边界,很难合理地分配计算资源&…

微知-如何查看Bluefield DPU安装的BFB镜像版本?如何查看DPU中OS的版本?内核版本等信息?(cat /etc/mlnx-release)

关键命令 cat /etc/mlnx-release背景 本文主要介绍在Bluefield DPU的OS上查看系统版本以及所烧录的镜像名字等信息。BFB镜像,就好比在普通服务器装机用的系统iso文件。(BFB全称是BlueField boot stream file ) 命令与实操 Bluefield DPU在…

【CSS in Depth 2 精译_045】7.1 CSS 响应式设计中的移动端优先设计原则(上)

当前内容所在位置(可进入专栏查看其他译好的章节内容) 第一章 层叠、优先级与继承(已完结) 1.1 层叠1.2 继承1.3 特殊值1.4 简写属性1.5 CSS 渐进式增强技术1.6 本章小结 第二章 相对单位(已完结) 2.1 相对…

在uniapp中实现长按聊天对话框可以弹出对话框然后可以删除该条对话,单击可以进入该条对话框的对话页面

效果展示 效果描述 长按【大于1s】某一条对话框会弹出一个对话框,点击确定按钮就可以将当前对话框从列表中进行删除,如果点击取消则不做额外操作。 如果只是点击了一下,时间【小于1s】的情况下会直接引入到与该用户的对话框详情页面。 代码…

GPT-2 的 Transformer Block 设计与基础 Transformer 的比较

随着深度学习在自然语言处理领域的迅猛发展,Transformer 架构逐渐成为了语言模型的主流结构。自从 Vaswani 等人提出的基础 Transformer 在《Attention is All You Need》论文中首次亮相以来,各种改进版本相继问世。GPT-2 是其中一个重要的里程碑&#x…

sql注入第8关

手工注入麻烦 目录 判断闭合方式 判断注入类型 手工注入 1、获取数据库名 2、爆破数据库的名字(security) 3、爆破表的数量 4、判断表名的长度 5、判断表的列名数量 6、判断表的列名的名字 7、获取表的数据 8、判断数据的长度 9、判断数据的…

python pyinstaller打包exe遇到报错:RuntimeError: input(): lost sys.stdin

在使用python中的pyinstaller命令打包exe遇到报错:RuntimeError: input(): lost sys.stdin 一、问题复现 import datetimedef record_log():project_name = input("请输入项目名称:")l

音视频入门基础:FLV专题(13)——FFmpeg源码中,解析任意Type值的SCRIPTDATAVALUE类型的实现

一、SCRIPTDATAVALUE类型 从《音视频入门基础:FLV专题(9)——Script Tag简介》中可以知道,根据《video_file_format_spec_v10_1.pdf》第80到81页,SCRIPTDATAVALUE类型由一个8位(1字节)的Type和…