Errno 13 while running docker-compose up

让人想犯罪 __ 提交于 2020-05-15 05:01:28

问题


I'm building an application using django and I wanted to add docker to this project.

I'm trying to run

sudo docker-compose up

Which gives me this output:

ERROR: .IOError: [Errno 13] Permission denied: './docker-compose.yml'

I checked the permissions using GUI. Everything is fine.

I'm trying to run my app from an mounted drive. I also tested it on other drives. The only drive this problem does not appear is my main drive running Ubuntu 18.04.

Looking forward to some answers


回答1:


adding the directory where I am running my docker-compose.yml using the apparmor reconfigure tool:

$ sudo dpkg-reconfigure apparmor



回答2:


You need to update your AppArmor configuration :

Snap Dockers are heavily controlled with AppArmor.

To diagnose if it is really the case, check the last lines of the syslog after you triggered the error :

dmesg | grep docker-compose

You should see a snap.docker that was denied:

kernel: [ ] audit: type=1400 audit(....): apparmor="DENIED" operation="exec" profile="snap.docker.dockerd" name="/bin/kmod" pid=7213 comm="exe" requested_mask="x" denied_mask="x" fsuid=0 ouid=0

To correct this, just go to apparmor config's tunables :

cd /etc/apparmor.d/tunables

And edit HOMEDIRS variables in the 'home' file, for example from :

@{HOMEDIRS}=/home/ 

to

@{HOMEDIRS}=/home/ /media/aUser/Linux/

hope that helps.



来源:https://stackoverflow.com/questions/53344380/errno-13-while-running-docker-compose-up

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