3

I have the following simple Dockerfile:

FROM centos:6.6

USER root

RUN yum clean all
RUN yum update

And I am trying to build it as usual:

docker build -t myimage/hadoop .

But I have the following error and I can't find the solution:

Error: Cannot find a valid baseurl for repo: base Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os&infra=stock error was 14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'" INFO[0005] The command "/bin/sh -c yum update" returned a non-zero code: 1

Any help or reference to solve the problem would be very helpful.

EDIT: I tried the solution given in this post but with no results.

Community
  • 1
  • 1
salvador
  • 1,079
  • 3
  • 14
  • 28
  • The problem is `PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'`. Your DNS is broken. – Etan Reisner May 14 '15 at 17:31
  • The DNS on the host machine? I haven't seen any issue with the host machine. How can I verify if the DNS is broken as you say? The host machine is Ubuntu 14.04. – salvador May 14 '15 at 18:50
  • The DNS in the container. It is trying to resolve that address and cannot do so. And by broken I may just mean "not configured". – Etan Reisner May 14 '15 at 18:51
  • The problem is that I get this error only my machine, if I try that to another machine it seems to work fine. – salvador May 14 '15 at 20:17
  • Can you resolve that address on your host machine? I don't know enough about docker to say but it could just be a docker misconfiguration I suppose. – Etan Reisner May 14 '15 at 20:20
  • Looks like your docker networking does not have the access to the web. Anyway, there's too little information to answer the question. –  Aug 25 '16 at 13:15
  • I am finding that `curl -v http://mirrorlist.centos.org/?release=7\&arch=x86_64\&repo=os\&infra=container` succeeds from the commandline of my build server while `curl -v http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=container` fails because the OS splits the url apart by the & characters in the latter instance. – Dave McNulla Mar 02 '18 at 20:50

1 Answers1

-1

Could you try add "-y" to the ""yum update"?

RUN yum update -y
Gustavo Suto
  • 1
  • 1
  • 2