Could not resolve host in docker

前端 未结 1 1639
梦毁少年i
梦毁少年i 2021-01-05 14:41

I\'m trying to do an jenkins on docker, on my machine (Ubuntu).

I have to access to the git repo, in my company. But in jenkins, I get this error :

<
1条回答
  •  时光说笑
    2021-01-05 15:43

    The DNS was wrong. (--dns=127.0.1.1)

    This DNS server, is an internal DNS, Dnsmasq, it's a DNS forwarder.

    So I needed to know the real internal DNS server :

    nmcli dev show | grep DNS
    

    And add the right address (10.0.1.1 in my case) :

    sudo docker run -p 8080:8080 -p 50000:50000 -v /home/xero/jenkins:/var/jenkins_home --name=myproject-jenkins2 --dns=10.0.1.1 jenkins

    0 讨论(0)
提交回复
热议问题