I needed space and executed: docker rmi $(docker images -f \"dangling=true\" -q)
Since then I can\'t with docker-compose: docker-compose build
docker build needs read access to every file in the context directory tree. To avoid permission issues, add all your mounted directories to .dockerignore file except those used during the build. For example, for this docker-compose file:
version: '3'
services:
myservice:
build: .
volumes:
- './etc:/etc/myservice'
- './log:/var/log/myservice'
Add a .dockerignore file with this content:
/etc
/log
The problem will go away no matter the permissions of the files in your mounted directories.
The docker-compose error is not very informative so you can try to run docker on each build just to get detailed information:
$ docker build .
You will get an error like this:
error checking context: 'no permission to read from '/home/david/docker/myservice/log/2020161.log'.