docker-compose: Couldn't connect to Docker daemon

#docker

If you get this error:

$ docker-compose build
db uses an image, skipping
Building heroku
ERROR: Couldn't connect to Docker daemon - you might need to run `docker-machine start default`.

And Docker logs something like:

Nov 11 13:13:45 ultra0 dockerd[498]: time="2017-11-11T13:13:45.000484088-03:00" level=error msg="Handler for POST /v1.22/build returned error: Error processing tar file(archive/tar: invalid tar header): "

It means there is at least one file in your project it is owned by root.

To fix it just chown all your files to yourself:

$ sudo chown -R USERNAME.USERNAME /path/to/project

Or if you are on your project:

$ sudo chown -R $(whoami).$(whoami) .

References