docker-archive/docker-snap

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

marcossegovia opened this issue · 4 comments

Hi there,
I followed the guide step by step on using docker for the first time on ubuntu core 16
But I came across with this message every time i try to run the containers from the yml

docker.compose up

It gives me ERROR: Couldn't connect to Docker daemon - you might need to run docker-machine start default.

While

sudo docker.compose up

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

The whole repository even the docker-compose.yml file is set to my user:user. Moreover the docker-compose.yml has 777 permission

Hi @marcossegovia
Thanks for your report, you hit the AppArmor denials due to the strict confinement in the snappy world.
In short, you need to

  1. make home plug connected if you put the whole repository under $HOME
  2. make sure the whole repository(docker project folder and files) owned by root instead of your login user i.e Dockerfile, docker-compose.yml.

Here is how I build an image with docker build command in ubuntu core. It applies to docker compose command too.
https://paste.ubuntu.com/25814535/
For more details, please refer to
https://forum.snapcraft.io/t/docker-load-fails-with-permission-denied/1227

Please let us know if it works for you with the above approach.
Thanks for your interests in docker snap.

BR
Gary

Hey @adglkh
Thank you for your quickly and accurate response.
I think that sudo chown root.root -R on the whole repository made the deal. Although having executed sudo chown root:root -R previously.

Now I got problems pulling the images

`$ sudo docker.compose up`
Pulling db (mongo:latest)...
latest: Pulling from library/mongo
ERROR: no matching manifest for linux/arm in the manifest list entries

If you have any idea would be nice, otherwise I think we can close this. :)

Well actually I'm seeing docker has a restricted number of images: https://hub.docker.com/u/arm64v8/ on the raspberry architecture :(

Found out this repo: https://hub.docker.com/r/mangoraft/mongodb-arm/ and on changing the image, now my app is running :)