简体   繁体   English

数据权限Docker for Windows

[英]Data permissions Docker for Windows

I'm using Docker for Windows, with owncloud container, and I shared volumes, setting up on docker-compose.yml, in order to persist the data. 我正在使用Docker for Windows,使用owncloud容器,我共享卷,设置在docker-compose.yml上,以便保留数据。 Extract from my docker-compose.yml 从我的docker-compose.yml中提取

` owncloud: `owncloud:

image: jobel/owncloud:1.1

links: 

    - db:db

ports:

    - 8002:80   

volumes:

    - f:/Program Files/Docker/Docker VM/owncloudconfig:/var/www/html

    - f:/Program Files/Docker/Docker VM/owncloudconfig/apps:/var/www/html/apps

    - f:/Program Files/Docker/Docker VM/owncloudconfig/config:/var/www/html/config

    - f:/Program Files/Docker/Docker VM/owncloudconfig/data:/var/www/html/data

` `

Data are present but when I try to connect on my web browser, it says : "Your data folder can be read by other users. Please change the directory permissions in 0770 mode so that the content is not listed by other users." 数据存在,但当我尝试在我的网络浏览器上连接时,它说:“您的数据文件夹可以被其他用户读取。请在0770模式下更改目录权限,以便其他用户不会列出该内容。” (translate fr->eng) (翻译fr-> eng)

But how can I change the windows folder permissions to 0770 ? 但是如何将Windows文件夹权限更改为0770? ;(

Or what are the others solutions? 或者其他解决方案是什么?

Thank you in advance for your answer. 提前感谢您的回答。

In the Windows client, you can configure the docker to allow read/write on specific drives. 在Windows客户端中,您可以将docker配置为允许在特定驱动器上进行读/写。 In your case, it is the F: drive. 在你的情况下,它是F:驱动器。 This should fix your permissions problem. 这应该可以解决您的权限问题。

在此输入图像描述

The web-server running in Docker is checking the folder permissions, which is nothing to do with windows; 在Docker中运行的Web服务器正在检查文件夹权限,这与Windows无关; you need to verify the folder permissions inside Docker itself 您需要验证Docker内部的文件夹权限

Below is an example which you can play with, you just need to let docker execute the Linux command in a container 下面是一个你可以使用的例子,你只需要让docker在容器中执行Linux命令

hope this helps 希望这可以帮助

eg: 例如:

$ docker container exec -t local-container ls -ld /var/www/html/config $ docker container exec -t local-container ls -ld / var / www / html / config

$ docker container exec -t local-container chmod 0770 /var/www/html/config $ docker container exec -t local-container chmod 0770 / var / www / html / config

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM