<p>I am learning Kubernetes, by following the course, <a href="https://www.udemy.com/course/kubernetes-microservices/" rel="nofollow noreferrer">https://www.udemy.com/course/kubernetes-microservices/</a></p>
<p>When i try to build an image, using the file <a href="https://github.com/fleetman-ci-cd-demo/jenkins" rel="nofollow noreferrer">https://github.com/fleetman-ci-cd-demo/jenkins</a>, using minikube's docker daemon. it fails due to the below reason</p>
<p><em>curl: (6) Could not resolve host: updates.jenkins.io</em></p>
<p>I logged into minikube shell as well and did a ping, it didn't work</p>
<pre><code>    ping updates.jenkins.io
    PING updates.jenkins.io (52.202.51.185): 56 data bytes
    --- updates.jenkins.io ping statistics ---
68 packets transmitted, 0 packets received, 100% packet loss
</code></pre>
<p>I am able to reach google.com from minikube shell.</p>
<p>Please let me know how can i fix this?</p>
<p>The build log</p>
<pre><code>    WARN: install-plugins.sh is deprecated, please switch to jenkins-plugin-cli
Creating initial locks...
Analyzing war /usr/share/jenkins/jenkins.war...
Registering preinstalled plugins...
curl: (6) Could not resolve host: updates.jenkins.io
The command '/bin/sh -c /usr/local/bin/install-plugins.sh workflow-aggregator &amp;&amp;     /usr/local/bin/install-plugins.sh github &amp;&amp;     /usr/local/bin/install-plugins.sh ws-cleanup &amp;&amp;     /usr/local/bin/install-plugins.sh greenballs &amp;&amp;     /usr/local/bin/install-plugins.sh simple-theme-plugin &amp;&amp;     /usr/local/bin/install-plugins.sh kubernetes &amp;&amp;     /usr/local/bin/install-plugins.sh docker-workflow &amp;&amp;     /usr/local/bin/install-plugins.sh kubernetes-cli &amp;&amp;     /usr/local/bin/install-plugins.sh github-branch-source' returned a non-zero code: 6
</code></pre>

<p>I think it's the container that has an issue with connecting to the Internet. I ran into the same problem with Jenkins running in Docker.</p>
<p>I restarted Docker with <code>sudo service docker restart</code>, and solved my problem.</p>
<p>Now if you're concerned with the depracated warning:</p>
<pre><code>WARN: install-plugins.sh is deprecated, please switch to jenkins-plugin-cli
</code></pre>
<p>You may refer to <a href="https://github.com/jenkinsci/docker/blob/ebb29a040aca944474542400a34f48e1eb8fa628/README.md#preinstalling-plugins" rel="nofollow noreferrer">Jenkins' Docker image guide</a>. Cut to the chase, you need to replace the RUN command in Dockerfile.
From something like:</p>
<pre><code>RUN /usr/local/bin/install-plugins.sh &lt; /usr/share/jenkins/ref/plugins.txt
</code></pre>
<p>to:</p>
<pre><code>RUN jenkins-plugin-cli -f /usr/share/jenkins/ref/plugins.txt
</code></pre>
<p>Even with <code>jenkins-plugin-cli</code>, I faced a similar problem of reaching to Jenkins plugin server. It shows</p>
<pre><code>Error getting update center json
</code></pre>
<p>In my case, it was solved by the same method, just restarting Docker service.</p>
