Build of docker image with centos:6.6 fails when trying to update repo

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 error was 14: PYCURL ERROR 6 - "Couldn't resolve host ''" 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.

Relevant tags