1. 错误日志
Release file for http://mirrors.aliyun.com/debian/dists/buster-backports/InRelease is not valid yet (invalid for another 48min 42s). Updates for this repository will not be applied.
2. 详细日志
[root@harbor csi-driver-nfs]# make local-build-push
/bin/cp -f /root/go/bin/dlv ./bin/amd64/
docker build --build-arg ARCH="amd64" -t 192.168.11.20/csi/nfsplugin:latest .
[+] Building 5.3s (7/9) docker:default
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 1.73kB 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for m.daocloud.io/registry.k8s.io/build-image/debian-base:bullseye-v1.4.3 0.3s
=> [1/5] FROM m.daocloud.io/registry.k8s.io/build-image/debian-base:bullseye-v1.4.3@sha256:3fcf9bcc4949392155cde1f96591ba3eda092f4735a9cc856bf526d71f48af47 0.0s
=> [internal] load build context 0.1s
=> => transferring context: 18.09MB 0.1s
=> CACHED [2/5] RUN echo 'deb http://mirrors.aliyun.com/debian/ buster main non-free contrib\ndeb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib\ 0.0s
=> ERROR [3/5] RUN apt update && apt upgrade -y && apt-mark unhold libcap2 && clean-install ca-certificates mount nfs-common netbase 5.0s
------
> [3/5] RUN apt update && apt upgrade -y && apt-mark unhold libcap2 && clean-install ca-certificates mount nfs-common netbase:
0.109
0.109 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
0.109
2.391 Get:1 http://mirrors.aliyun.com/debian buster InRelease [122 kB]
2.418 Get:2 http://mirrors.aliyun.com/debian-security buster/updates InRelease [34.8 kB]
2.430 Get:3 http://mirrors.aliyun.com/debian buster-updates InRelease [56.6 kB]
2.441 Get:4 http://mirrors.aliyun.com/debian buster-backports InRelease [51.4 kB]
2.480 Get:5 http://mirrors.aliyun.com/debian buster/non-free Sources [85.9 kB]
2.503 Get:6 http://mirrors.aliyun.com/debian buster/contrib Sources [42.5 kB]
2.507 Get:7 http://mirrors.aliyun.com/debian buster/main Sources [7852 kB]
3.225 Get:8 http://mirrors.aliyun.com/debian buster/non-free amd64 Packages [87.8 kB]
3.233 Get:9 http://mirrors.aliyun.com/debian buster/main amd64 Packages [7909 kB]
3.962 Get:10 http://mirrors.aliyun.com/debian buster/contrib amd64 Packages [50.1 kB]
3.971 Get:11 http://mirrors.aliyun.com/debian-security buster/updates/main Sources [411 kB]
4.009 Get:12 http://mirrors.aliyun.com/debian-security buster/updates/main amd64 Packages [541 kB]
4.054 Get:13 http://mirrors.aliyun.com/debian buster-updates/main Sources [4616 B]
4.055 Get:14 http://mirrors.aliyun.com/debian buster-updates/main amd64 Packages [8788 B]
4.652 Reading package lists...
4.930 E: Release file for http://mirrors.aliyun.com/debian/dists/buster-backports/InRelease is not valid yet (invalid for another 48min 42s). Updates for this repository will not be applied.
------
Dockerfile:27
--------------------
25 | ' > /etc/apt/sources.list
26 |
27 | >>> RUN apt update && apt upgrade -y && apt-mark unhold libcap2 && clean-install ca-certificates mount nfs-common netbase
28 |
29 | ARG ARCH
--------------------
ERROR: failed to solve: process "/bin/sh -c apt update && apt upgrade -y && apt-mark unhold libcap2 && clean-install ca-certificates mount nfs-common netbase" did not complete successfully: exit code: 100
make: *** [local-build-push] Error 1
[root@harbor csi-driver-nfs]#
3. Dockerfile
# Copyright 2020 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM m.daocloud.io/registry.k8s.io/build-image/debian-base:bullseye-v1.4.3
RUN echo 'deb http://mirrors.aliyun.com/debian/ buster main non-free contrib\n\
deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib\n\
deb http://mirrors.aliyun.com/debian-security buster/updates main\n\
deb-src http://mirrors.aliyun.com/debian-security buster/updates main\n\
deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib\n\
deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib\n\
deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib\n\
deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib\n\
' > /etc/apt/sources.list
RUN apt update && apt upgrade -y && apt-mark unhold libcap2 && clean-install ca-certificates mount nfs-common netbase
ARG ARCH
ARG binary=./bin/${ARCH}/nfsplugin
COPY ${binary} /nfsplugin
COPY ./bin/${ARCH}/dlv /usr/local/bin/dlv
# COPY /root/go/bin/dlv /usr/local/bin/dlv
ENTRYPOINT ["dlv --listen=:12800 --headless=true --api-version=2 --accept-multiclient exec /nfsplugin -- "]
4. 解决方案
通过网上搜索以及日志对比,发现是因为虚拟机重启之后,时间滞后导致的。校准时间之后,可以解决此问题。