frank
frank

Reputation: 3598

dockerfile does not build due to failed size validation

My dockerfile used to build successfully.

I tried to build today (5 days after successful build) with docker build -t fv ., and kept getting the following error:

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

any suggestions what this means and how to correct?

my dockerfile is:

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

another reference I got was:

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

Would this be because of an issue with the base image pulled?

EIDT, 20241127 Based on my answer and 2 others, it seems this issue was due to VPN/security issues

Upvotes: 5

Views: 6761

Answers (4)

Carlos Diaz
Carlos Diaz

Reputation: 5

I experienced something similar with Global protect which was blocking me to build the image, after I disconnected from it I was able to build the image successfully.

This was the error:

failed commit on ref "layer-sha256:80fe61ad56f50607679112c84f9b17b0dc5f9f2c130e875aa8d2d49d43a8fbbd": "layer-sha256:80fe61ad56f50607679112c84f9b17b0dc5f9f2c130e875aa8d2d49d43a8fbbd" failed size validation: 106073 != 2350967: failed precondition

Upvotes: 0

Sam Firke
Sam Firke

Reputation: 23004

I found that docker build would fail with this error, but it would work if I first pulled the failing image with docker pull <image> and then ran docker build.

Upvotes: 7

Thabo
Thabo

Reputation: 1465

On my side, I got something like below

------
 > [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

On my side, I managed to solve this by disconnecting from a VPN I was connected to.

Upvotes: 0

frank
frank

Reputation: 3598

this was due to security encryption from my local ip.

when tethering, was able to generate the docker image with non problems

Upvotes: 1

Related Questions