Skip to main content
All CollectionsCI/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 2 years ago

Issue

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

Cause

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

Solution

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:

[[runners]]
name = "stackhawk-test"
url = "https://git.example.org/"
token = "xxxxxxxxxxxxxxxxxxxx"
executor = "docker"
[runners.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:

Miscellaneous:

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

Did this answer your question?