簡體   English   中英

更新 apt 會破壞我在 Ubuntu 18.04 上構建的 docker

[英]Updating apt breaks my docker build on Ubuntu 18.04

我在從 docker 中更新apt時遇到問題。 目前我已經將整個 dockerfile 注釋掉了,除了這個:

FROM ubuntu:18.04
RUN apt update 

基本上我必須先進行apt update因為沒有它 ubuntu package 管理器不起作用。 但是,這條線打破了我的 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

我也試過沒有DOCKER_BUILDKIT=1變量,結果相同(盡管速度較慢)。

我猜這是基本的東西,因為我是 docker 的新手,但是有人可以建議我如何更新 apt 而不會破壞我的構建?

您可以嘗試apt-get update它應該可以工作,或者如果不起作用,您可以檢查時區。

FROM ubuntu:18.04
apt-get update

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM