Minio允许拒绝
当我启动Docker容器时,我对Minio有问题,这是我的错误:
19:32:16.16 info ==> **启动Minio设置**
/opt/bitnami/scripts/libminio.sh:line 324:/data/.root_user:
在Windows上拒绝它的许可,但在Linux上否认
这是我的Docker-Composesings:
container_name: minio
image: "bitnami/minio:latest"
ports:
- "9000:9000"
- "9001:9001"
environment:
- MINIO_ACCESS_KEY=${ACCESS_KEY}
- MINIO_SECRET_KEY=${SECRET_KEY}
- MINIO_DEFAULT_BUCKETS=${BUCKET}
volumes:
- ./docker-volumes/s3-data:/data
networks:
- proxy
When I start my docker container, I have a problem with minio this is my error:
19:32:16.16 INFO ==> ** Starting MinIO setup **
/opt/bitnami/scripts/libminio.sh: line 324: /data/.root_user: Permission denied
On windows it works but on linux not
this is my docker-compose settings:
container_name: minio
image: "bitnami/minio:latest"
ports:
- "9000:9000"
- "9001:9001"
environment:
- MINIO_ACCESS_KEY=${ACCESS_KEY}
- MINIO_SECRET_KEY=${SECRET_KEY}
- MINIO_DEFAULT_BUCKETS=${BUCKET}
volumes:
- ./docker-volumes/s3-data:/data
networks:
- proxy
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您的问题
是将目录
./ docker-volumes/s3-data
绑定到容器中的问题。最初,此目录不存在,因此Docker将其创建为根。这意味着容器内部的/data
目录由root拥有。不幸的是,容器
Minio
在用户1001
中运行,因此在/data 。
解决方案1:Docker卷
如果您使用命名的Docker卷,而不是绑定安装主机目录:
然后,Docker将将卷的所有者和权限设置为您安装卷的目录的权限。在
bitnami/minio
图像中,/data
看起来像:它是用户
root
和grouproot 。 Minio容器作为UID 1001和组
root
运行,因此可以写入该目录。futzing futzing futzing
解决方案2:当然,您可以明确提出
docker-volumes/s3-data
。目录然后将其chown到适当的userId:
但是通常,除非有一个原因,否则您需要使用特定
主机目录,使用命名的Docker卷如解决方案1中
更易于管理(因为您不需要知道容器
提前用户ID,并且因为您最终不会使用由
您的主目录中的non-you UserIds)。
The problem
You are bind-mounting the directory
./docker-volumes/s3-data
into the container. Initially this directory doesn't exist, so Docker creates it -- as root. This means that the/data
directory inside the container is owned by root.Unfortunately, inside the container
minio
is running as user1001
, so it doesn't have sufficient permissions to create files (or directories) inside/data
.Solution 1: Docker volumes
If instead of bind-mounting a host directory you use a named docker volume, like this:
Then Docker will set the owner and permissions of the volume to the permissions of the directory on which you are mounting the volume. In the
bitnami/minio
image,/data
looks like:That is, it's writable by user
root
and grouproot
. The minio container is running as UID 1001 and grouproot
, so it's able to write to that directory.Solution 2: Futzing with permissions
You can, of course, explicitly pre-create the
docker-volumes/s3-data
directory and then chown it to the appropriate userid:
But in general, unless there's a reason why you need to use a specific
host directory, using a named Docker volume as in solution 1 is going
to be more manageable (because you don't need to know the container
userid in advance, and because you won't end up with files owned by
non-you userids in your home directory ).
我有一个Minikube的问题,因为我只需要它来测试目的,所以我添加了
- set persistence.enabled =“ false”
完整命令是:
I had this problem with a minikube, since I just needed it for testing purposes I added
--set persistence.enabled="false"
The Full Command being: