apt_get update error: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InReleas

vwvare centos ubuntu dockerfile apt_get update error: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease Connection failed [IP: 91.189.91.23 80]

1、本文为原创,转载附地址即可/
2、遇到本文问题原因是,我在vmware centos 搭建docker spark hadoop hive mysql 环境,执行dockerfile 文件时,apt_get update
联网报错

下面为截图:
apt_get update error: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InReleas

原因:
在dockerfie 在RUN命令执行过程中,会默认执行cache内容,就是latest time RUN后的缓存,造成了RUN sudo apt_get update
报错网络连接错误,由于我的虚拟机可以直接ping到外网,我这里也没有用到proxy,不存在代理的问题

Solving:

solution1:在dockerfile中执行RUN apt_get update -qqy && apt_get install -qqy install python3.7 python3-pip openssh-server

solution2:直接在终端执行 docker build --no-cache .(recommeded)

apt_get update error: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InReleas