You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I copied and paste the code into the gitlab-ci.yml file but it says that the job has failed.. How can I fix this, I have been struggling with gitlab-ci in combination with my project that is docker-composed based.. Please help me out.
Pulling docker image tmaier/docker-compose:latest ...
Using docker image sha256:7f72c82000a4b80146e835ff4678fbf64cd50ea5549ff411a84fbea25d12027e for tmaier/docker-compose:latest ...
Running on runner-MY6PvAGd-project-12-concurrent-0 via ovs-transip-gitlab-runner...
Fetching changes with git depth set to 50...
Initialized empty Git repository in /builds/murat.yilmaz/devicemanagerapp/.git/
Created fresh repository.
From https://devops.ovsoftware.com/murat.yilmaz/devicemanagerapp
[new branch] master -> origin/master
Checking out b1ac0c93 as master...
Skipping Git submodules setup
$ docker info
Client:
Debug Mode: false
Server:
ERROR: error during connect: Get http://docker:2375/v1.40/info: dial tcp: lookup docker on 195.8.195.8:53: no such host
errors pretty printing info
ERROR: Job failed: exit code 1
Reacted by Arman Poghosyan, Cristian Kubis, Jacques Desmarais, Viktor Pettersson and Pierre
Maybe try editing your GitLab runner's config file (config.toml) by changing "volumes = ["/cache"]" to "volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/cache"]" and see if that helps?
Can you please provide more information: Are you using gitlab.com? Are you using your own cloud-runner? How is it set up? How is docker configured here?
@programmingworld1 , @tmaier This can happen while using newer docker images like version 19.03. Although this issue is a bit old, but the problem persists till today.
I faced the issue recently and turns out there is a known "solution" or workaround however.
Refer to this Release Note, if you want more details.
Reason:
As of version 19.03, docker:dind will automatically generate TLS certificates and require using them for communication. This is from Docker's official documentation:
Solution/workarounds:
According to the Release Note, there are 2 workarounds:
Explicitly turn off TLS.
Configure GitLab Runner to use TLS.
Turn off TLS
If you cannot or do not want to edit the config.toml, like in a gitlab shared runner:
If you are running jobs on a runner that you have write access to the config.toml file (and you know what you are doing):
config.toml:
...
[[runners]]
name = "My Docker Runner"
url = "http://gitlab.com"
token = ""
executor = "docker"
[runners.custom_build_dir]
[runners.docker]
## Changes here ##
privileged = true ## may not be necessary, default is false
volumes = ["/certs/client", "/cache"] ## adds volume "/certs/client"
shm_size = 0
...
.gitlab-ci.yml:
image: tmaier/docker-compose:19.03variables:
# Create the certificates inside this directory for both the server# and client. The certificates used by the client will be created in# /certs/client so we only need to share this directory with the# volume mount in `config.toml`.DOCKER_TLS_CERTDIR: "/certs"`
Activity
desm commentedon Oct 3, 2019
Maybe try editing your GitLab runner's config file (config.toml) by changing "volumes = ["/cache"]" to "volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/cache"]" and see if that helps?
desm commentedon Oct 3, 2019
I forgot to specify that the approach I suggested just now is based on this: https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#use-docker-socket-binding
tmaier commentedon Jan 13, 2020
Can you please provide more information: Are you using gitlab.com? Are you using your own cloud-runner? How is it set up? How is docker configured here?
abmruman commentedon Jan 27, 2020
@programmingworld1 , @tmaier This can happen while using newer docker images like version
19.03. Although this issue is a bit old, but the problem persists till today.I faced the issue recently and turns out there is a known "solution" or workaround however.
Refer to this Release Note, if you want more details.
Reason:
Solution/workarounds:
According to the Release Note, there are 2 workarounds:
Turn off TLS
If you cannot or do not want to edit the
config.toml, like in a gitlab shared runner:.gitlab-ci.yml:Configure TLS
If you are running jobs on a runner that you have write access to the
config.tomlfile (and you know what you are doing):config.toml:.gitlab-ci.yml:tmaier commentedon Apr 12, 2020
Thank you, @abmruman. I hope it solved the issue for @programmingworld1. I am closing this issue
brice-gros commentedon Apr 20, 2020
privileged = trueappeared to be necessary on my caseThank you very much @abmruman
abmruman commentedon Apr 22, 2020
@brice-gros , I came to learn that if you want to use docker-in-docker service, you need a privileged runner.
Michael1024-CJX commentedon Apr 21, 2022
I tried configuring TLS, but it didn't work. Problem solved by configuring
lwiechec commentedon Dec 2, 2022
thanks a lot - @Michael1024-CJX method helped me too