Docker volume, change file permissions/owner

≡放荡痞女 提交于 2019-12-11 09:40:03

问题


I'm running ruby on rails in a docker container. If I generate something like docker-compose run rails rails g controller posts index show, the file owner is root. After that I must always run chown -R . $USER and this is annoying.

Does any one know how I can fix this, so that the owner from each generated file is the host user?


回答1:


You can run with docker-compose run --user $USER, but that user must already exist in the container, so you'd have to create it in your Dockerfile.



来源:https://stackoverflow.com/questions/33508123/docker-volume-change-file-permissions-owner

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!