由于大小验证失败,因此无法构建dockerfile

yebdmbv4  于 2022-12-03  发布在  Docker
关注(0)|答案(2)|浏览(859)

我的dockerfile曾经成功地构建。
我今天尝试使用docker build -t fv .进行构建(成功构建5天后),但一直收到以下错误:

failed commit on ref "layer-sha256:7a3de07a56633b9096304d02c47f097f3e28ae6c6dd442d1e7c4d26452ecd90a": "layer-sha256:7a3de07a56633b9096304d02c47f097f3e28ae6c6dd442d1e7c4d26452ecd90a" failed size validation: 581433721 != 600361569: failed precondition

这意味着什么以及如何纠正?
我停靠文件是:

FROM rocker/verse

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends build-essential libpq-dev python3.8 python3-pip python3-setuptools python3-dev
RUN pip3 install --upgrade pip

ADD . ./home/rstudio

ADD requirements.txt .
ADD install_packages.r .

# Miniconda and dependencies
RUN cd /tmp/ && \
        wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
        bash Miniconda3-latest-Linux-x86_64.sh -b -p $HOME/miniconda3 && \
        /root/miniconda3/condabin/conda install -y python=3.7
ENV PATH=$PATH:/root/miniconda3/bin

#RUN npm install phantomjs-prebuilt --phantomjs_cdnurl=http://cnpmjs.org/downloads

# installing python libraries
RUN pip3 install -r requirements.txt

# installing r libraries
RUN Rscript install_packages.r

我得到另一个推荐是:

=> => sha256:7a3de07a56633b9096304d02c47f097f3e28ae6c6dd442d1e7c4d26452ecd90a 580.97MB / 600.36MB                                                                                                                                   1150.8s
------
 > [ 1/10] FROM docker.io/rocker/verse@sha256:3b417b991a32cc8bf9c1fa173ec976a5cc65522a76918df61b5c6cf6261e63a5:

这是否是因为提取的基础映像存在问题?

8yoxcaq7

8yoxcaq71#

这是由于来自我本地IP的安全加密。
当连接时,能够生成Docker图像,没有任何问题

ebdffaop

ebdffaop2#

在我这边,我得到了一些像下面

------
 > [1/3] FROM docker.io/library/python@sha256:10fc14aa6ae69f69e4c953cffd9b0964843d8c163950491d2138af891377bc1d:
------
failed commit on ref "layer-sha256:049db2c7eb8a5bd3833cac2f58c6c72b481f1a0288a8b20527529c4970b52762": "layer-sha256:049db2c7eb8a5bd3833cac2f58c6c72b481f1a0288a8b20527529c4970b52762" failed size validation: 311296 != 3056504: failed precondition

在我这边,我设法解决了这个问题,从一个虚拟专用网断开我连接。

相关问题