title: Yum update fails -Centos 7 - dockerbuild
body: <p>I have frequently built docker container using centos 7 as base image. But now I am getting error when I run,</p>
  
  <pre><code>RUN yum update add \
      bash \
      &amp;&amp; rm -rfv /var/cache/apk/*
  
  ERROR:
  Loaded plugins: fastestmirror, ovl
  </code></pre>
  
  <p>One of the configured repositories failed (Unknown),
   and yum doesn't have enough cached data to continue. At this point the only
   safe thing yum can do is fail. There are a few ways to work "fix" this:</p>
  
  <ol>
  <li><p>Contact the upstream for the repository and get them to fix the problem.</p></li>
  <li><p>Reconfigure the baseurl/etc. for the repository, to point to a working
  upstream. This is most often useful if you are using a newer
  distribution release than is supported by the repository (and the
  packages for the previous distribution release still work).</p></li>
  <li><p>Run the command with the repository temporarily disabled
      <code>yum --disablerepo=&lt;repoid&gt; ...</code></p></li>
  <li><p>Disable the repository permanently, so yum won't use it by default. Yum
  will then just ignore the repository until you permanently enable it
  again or use <code>--enablerepo</code> for temporary usage:</p>
  
  <pre><code>yum-config-manager --disable &lt;repoid&gt;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>`subscription-manager repos --disable=&lt;repoid&gt;`
  </code></pre></li>
  <li><p>Configure the failing repository to be skipped, if it is unavailable.
  Note that yum will try to contact the repo. when it runs most commands,
  so will have to try and fail each time (and thus. yum will be be much
  slower). If it is a very temporary problem though, this is often a nice
  compromise:</p>
  
  <pre><code>yum-config-manager --save --setopt=&lt;repoid&gt;.skip_if_unavailable=true
  </code></pre></li>
  </ol>
  
  <blockquote>
    <p>Cannot find a valid baseurl for repo: base/7/x86_64 Could not retrieve
    mirrorlist
    <a href="http://mirrorlist.centos.org/?release=7&amp;arch=x86_64&amp;repo=os&amp;infra=container" rel="nofollow noreferrer">http://mirrorlist.centos.org/?release=7&amp;arch=x86_64&amp;repo=os&amp;infra=container</a>
    error was 14: curl#6 - "Could not resolve host: mirrorlist.centos.org;
    Name or service not known" The command '/bin/sh -c yum update add<br>
    bash     &amp;&amp; rm -rfv /var/cache/apk/*' returned a non-zero code: 1</p>
  </blockquote>
  
  <p>I also saw few resolutions to use "dhclient" but this error happens when i do docker-compose build.</p>