When the initial configuration docker, permission denied error
The reason of the lack of authority docker.sock, execute the following command sentence
sudo chmod 666 /var/run/docker.sock
Then success
Reference: https://github.com/palantir/gradle-docker/issues/188