skip to Main Content

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?

3

Answers


  1. Chosen as BEST ANSWER

    this was due to security encryption from my local ip.

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


  2. 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.

    Login or Signup to reply.
  3. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search