All Collections
CI/CD Integration
'docker pull stackhawk/hawkscan' fails with 'no such host' error in GitLab
'docker pull stackhawk/hawkscan' fails with 'no such host' error in GitLab

Resolving docker configuration issues when running HawkScan in a GitLab runner

Anthony Stinn avatar
Written by Anthony Stinn
Updated over a week ago


When running HawkScan in GitLab, the following error appears in the GitLab runner logs and the scan fails to run:

error during connect: Post http://docker:2375/v1.39/auth: dial tcp: lookup docker on x.x.x.x:53: no such host


One or both of the following issues with the Docker configuration is present in the runner config (e.g., .gitlab-ci.yml):

  1. Docker isn't running in privileged mode (privileged = true) in the GitLab runner

  2. The Docker UNIX socket (docker.sock) isn't mounted within the runner


Configure Docker to run in a privileged mode with access to docker.sock in the runners.docker section of the yaml config in GitHub.

For example:

name = "stackhawk-test"
url = ""
token = "xxxxxxxxxxxxxxxxxxxx"
executor = "docker"
tls_verify = false
image = "docker:stable"
privileged = true
disable_cache = false
volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/cache"]
shm_size = 0

Additional Information

Other Incarnations:

This docker socket issue in can manifest elsewhere in the GitLab environment, such as:


  • See Issue 4794 on GitLab's issue list for more details

Did this answer your question?