[英]Updating apt breaks my docker build on Ubuntu 18.04
I'm running into problems updating apt
from within docker.我在从 docker 中更新
apt
时遇到问题。 Currently I have the whole dockerfile commented out except for this:目前我已经将整个 dockerfile 注释掉了,除了这个:
FROM ubuntu:18.04
RUN apt update
Basically I have to do apt update
first because without it the ubuntu package manager does not work.基本上我必须先进行
apt update
因为没有它 ubuntu package 管理器不起作用。 However, this line is breaking my docker build:但是,这条线打破了我的 docker 构建:
(pyomexmeta-test) ciaran@DESKTOP-K0APGUV:/mnt/d/libOmexMeta$ DOCKER_BUILDKIT=1 docker build -t pyomexmeta:v-0.0.13 .
[+] Building 7.6s (5/5) FINISHED
=> [internal] load .dockerignore 0.1s
=> => transferring context: 34B 0.0s
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 2.04kB 0.0s
=> [internal] load metadata for docker.io/library/ubuntu:18.04 0.0s
=> CACHED [1/2] FROM docker.io/library/ubuntu:18.04 0.0s
=> ERROR [2/2] RUN APT update 7.5s
------
> [2/2] RUN APT update:
#5 0.240
#5 0.240 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
#5 0.240
#5 0.355 Get:1 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB]
#5 0.495 Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
#5 0.558 Get:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
#5 0.649 Get:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
#5 0.742 Get:5 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages [1344 kB]
#5 1.323 Get:6 http://archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages [186 kB]
#5 1.392 Get:7 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [11.3 MB]
#5 6.281 Get:8 http://archive.ubuntu.com/ubuntu bionic/restricted amd64 Packages [13.5 kB]
#5 6.897 Reading package lists...
#5 7.438 E: Release file for http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease is not valid yet (invalid for another 19h 35min 45s). Updates for this repository will not be applied.
#5 7.438 E: Release file for http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease is not valid yet (invalid for another 19h 37min 17s). Updates for this repository will not be applied.
#5 7.438 E: Release file for http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease is not valid yet (invalid for another 19h 34min 38s). Updates for this repository will not be applied.
------
failed to solve with frontend dockerfile.v0: failed to build LLB: executor failed running [/bin/sh -c apt update]: runc did not terminate sucessfully
(pyomexmeta-test) ciaran@DESKTOP-K0APGUV:/mnt/d/libOmexMeta$ echo $http_proxy
I've also tried without the DOCKER_BUILDKIT=1
variable with the same results (albeit slower).我也试过没有
DOCKER_BUILDKIT=1
变量,结果相同(尽管速度较慢)。
I'm guessing this is something basic since I'm new to docker, but could somebody suggest how I can update apt without it breaking my build?我猜这是基本的东西,因为我是 docker 的新手,但是有人可以建议我如何更新 apt 而不会破坏我的构建?
You can try apt-get update
and it should work or you can check timezone if that did not work.您可以尝试
apt-get update
它应该可以工作,或者如果不起作用,您可以检查时区。
FROM ubuntu:18.04
apt-get update
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.