发布文件尚未生效 - Docker

Hit*_*ani 3 ubuntu docker windows-10

嗨,我正在尝试构建我的 docker 容器。但开始收到这些错误

Sending build context to Docker daemon  26.09MB
Step 1/12 : FROM ubuntu:18.04
 ---> 6526a1858e5d
Step 2/12 : RUN apt-get update && apt-get -y upgrade     && apt-get -y install python3.8     && apt -y install python3-pip     && pip3 install --upgrade pip
 ---> Running in 7ee80131fc66
Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:2 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:5 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages [1344 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages [186 kB]
Get:7 http://archive.ubuntu.com/ubuntu bionic/restricted amd64 Packages [13.5 kB]
Get:8 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [11.3 MB]
Reading package lists...
E: Release file for http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease is not valid yet (invalid for another 3d 11h 5min 46s). Updates for this 
repository will not be applied.
E: Release file for http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease is not valid yet (invalid for another 3d 12h 20min 40s). Updates for this repository will not be applied.
E: Release file for http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease is not valid yet (invalid for another 3d 10h 50min 56s). Updates for this repository will not be applied.
The command '/bin/sh -c apt-get update && apt-get -y upgrade     && apt-get -y install python3.8     && apt -y install python3-pip     && pip3 install --upgrade pip' returned a non-zero code: 100
Run Code Online (Sandbox Code Playgroud)

这很奇怪,因为我之前已经构建了容器但从未遇到过错误。我在网上看到他们说调整系统时钟的答案。我使用的是 Windows 笔记本电脑,我检查了日期时间是否正确。知道什么会导致这个错误吗?

小智 11

我之前加了这个 apt-get update

# Workaround https://unix.stackexchange.com/questions/2544/how-to-work-around-release-file-expired-problem-on-a-local-mirror

RUN echo "Acquire::Check-Valid-Until \"false\";\nAcquire::Check-Date \"false\";" | cat > /etc/apt/apt.conf.d/10no--check-valid-until
Run Code Online (Sandbox Code Playgroud)

  • 哪里可以找到这样的信息?你是怎么找到这个命令的? (2认同)