guanpengchn / guanpengchn/guanpengchn.github.io
Permission denied on accessing host directory in docker
- Dominant language
- HTML
- Stars
- 18
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
按照阮一峰的做一个apache的php环境docker启动,结果发现出现权限问题,和volume参数有关,即便进入docker内部使用root权限也无法解决,查找到有一个解决方案,在docker启动命令中加入如下参数
```
--privileged=true
```
```bash
docker container run \
--rm \
--privileged=true \
--name wordpress \
--volume "$PWD/":/var/www/html \
php:5.6-apache
```
参考连接:[https://stackoverflow.com/questions/24288616/permission-denied-on-accessing-host-directory-in-docker](https://stackoverflow.com/questions/24288616/permission-denied-on-accessing-host-directory-in-docker)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the reported docker container run command and compare the volume permission behavior with the linked Stack Overflow discussion. The issue does not name a repository file, test, or requested project change, so a contributor would first need clarification of the intended fix and a reproducible environment.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- apache, docker, php
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100