title: Yum install / update not working inside docker images but working otherwise from the centos machine
body: <p>I am able to yum install, or yum update from the server, but when trying to do same (as specified in the Dockerfile) inside a docker container, it fails stating the following common error :
   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>
  
  <pre><code>     1. Contact the upstream for the repository and get them to fix the problem.
  
       2. 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).
  
       3. Run the command with the repository temporarily disabled
              yum --disablerepo=&lt;repoid&gt; ...
  
       4. 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 --enablerepo for temporary usage:
  
              yum-config-manager --disable &lt;repoid&gt;
          or
              subscription-manager repos --disable=&lt;repoid&gt;
  
       5. 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:
  
              yum-config-manager --save --setopt=&lt;repoid&gt;.skip_if_unavailable=true
  
  Cannot find a valid baseurl for repo: base/7/x86_64
  </code></pre>
  
  <p>my Docker file is a simple :</p>
  
  <pre><code>FROM centos:centos7
  RUN echo "nameserver 8.8.8.8" &gt; /etc/resolv.conf
  RUN echo "nameserver 8.8.4.4" &gt;&gt; /etc/resolv.conf
  RUN yum -y update; yum clean all
  RUN yum -y install epel-release; yum clean all
  RUN yum -y install python-pip; yum clean all
  </code></pre>
  
  <p>I have tried various things like adding ip_resolve=4 in /etc/yum.conf, or addinf 8.8.8.8 and 4.4.4.4 to /etc/resolv.conf and other methods, in vain.</p>
  
  <p>here's the docker info :</p>
  
  <pre><code>Containers: 28
   Running: 0
   Paused: 0
   Stopped: 28
  Images: 144
  Server Version: 1.13.0
  
  docker-compose version 1.10.1, build b252738
  docker-py version: 2.0.2
  CPython version: 2.7.5
  OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013
  </code></pre>
  
  <p>Please help. I am only running things under a VPN, no proxy.</p>
  
  <p>machine is an AMI : 3.10.0-514.el7.x86_64. 
  Need I add it's IP anywhere insde docker container? Please help.</p>
  
  <p>TIA!</p>