Docker build 报错 “ Cannot find a valid baseurl for repo: base/7/x86_64 ” 解决

错误内容

docker build 阶段报错如下:

Sending build context to Docker daemon 2.048 kB
Step 1/3 : FROM centos:7
 ---> 8652b9f0cb4c
Step 2/3 : RUN yum -y update
 ---> Running in 4e4e11d880f3

Loaded plugins: fastestmirror, ovl
Determining fastest mirrors
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=container error was
14: curl#56 - "Recv failure: Connection reset by peer"


 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:

     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

你可能感兴趣的:(linux,Docker,centos,yum,docker,centos7,linux)