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

news/2024/10/4 9:48:58 标签: docker, 容器, 运维

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.niftyadmin.cn/n/5689790.html

相关文章

Navicat Premium 12 for Mac中文永久版

目录 一、安装二、修改rpk文件三、获取请求码四、获取jh码 Tip:由于一些jy词,一直不让我发布🙄,所以只能用拼音简写代替,是不是很无语,我也很无语,各位自行体会一下😒 为了避免每次换…

虚拟机窗口顶部和底部出现白边(鸿蒙开发)

预览窗口顶部和底部出现白边 问题描述:预览窗口顶部和底部都有白边,导致无法全屏显示 解决方法: 官方文档:https://developer.huawei.com/consumer/cn/doc/harmonyos-faqs-V5/faqs-previewer-operating-6-V5 这里官方文档给了两种…

检索器--

2.1 R: 检索器模块 RAG技术中的“R”代表检索,其主要功能是在庞大的知识库中找出与用户查询最相关的前k个文档。这一过程至关重要,因为高质量的检索器能够显著提升整个系统的性能。然而,构建一个高质量的检索器并不容易,研究中通…

Android Studio | 无法识别Icons.Default.Spa中的Spa

编写底部导航栏&#xff0c;涉及到Spa部分出现报红&#xff1a; 解决办法&#xff1a;在build.gradle.kts中引入图标依赖 dependencies {implementation "androidx.compose.material:material-icons-extended:<version>" }

OSDU轻量化单机部署

首先更新系统 sudo apt update sudo apt upgrade -y安装docker sudo apt install -y docker.io sudo systemctl start docker sudo systemctl enable docker安装minikube curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 …

【2024】基于mysqldump的数据备份与恢复

基于mysqldump备份与恢复 mysqldump是一个用于备份 MySQL 数据库的实用工具。 它可以将数据库的结构&#xff08;如数据库、表、视图、存储过程等的定义&#xff09;和数据&#xff08;表中的记录&#xff09;导出为文本文件&#xff0c;这些文本文件可以包含 SQL 语句&#…

Spring框架使用Api接口实现AOP的切面编程、两种方式的程序示例以及Java各数据类型及基本数据类型的默认值/最大值/最小值列表

一、Spring框架使用Api接口-继承类实现AOP的切面编程示例 要使用Spring框架AOP&#xff0c;除了要导入spring框架包外&#xff0c;还需要导入一个织入的包org.aspectj&#xff0c;具体maven依赖如下&#xff1a; <dependency><groupId>org.springframework</gr…

指南:Linux常用的操作命令!!!

引言: 操作系统是软件的一类。 主要作用是协助用户调度硬件工作&#xff0c;充当用户和计算机硬件之间的桥梁。 尽管图形化是大多数人使用计算机的第一选择&#xff0c;但是在Linux操作系统上多数都是使用的&#xff1a;命令行在开发中&#xff0c;使用命令行形式&#xff0c…