While doing Quickstart: Compose and Rails,
when executing the docker-compose run web rails new . —force —database=postgresql command,
ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running? If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
I struggled thinking it was a version or conflict issue with docker-compose or docker, but I solved it so here’s a memo.
Cause
Because sudo is attached
Solution
# Add user to docker group
usermod -aG docker ${USER}
# Restart
exit
# Verify
docker images