axa-group / Parsr

Transforms PDF, Documents and Images into Enriched Structured Data
Apache License 2.0
5.81k stars 310 forks source link

Docker image build fails on ImageMagick policy.xml file copy #552

Open jurijsk opened 3 years ago

jurijsk commented 3 years ago

Summary Docker image build fails on copying policy.xml to imagemagick directory.

Steps To Reproduce

  1. Get clean repo
  2. run npm build
  3. run docker-compose -f docker-compose-build.yml build
  4. Get some error!

Expected behavior

no errors, nice crispy docker image

Actual behavior

the following output:

 => CACHED [axarev/parsr-base 4/7] RUN apt-get update &&   apt-get install -y imagemagick mupdf mupdf-tools qpdf pandoc tesseract-ocr-  0.0s 
 => ERROR [axarev/parsr-base 5/7] ADD policy.xml /etc/ImageMagick-6/policy.xml                                                          0.0s 
 => CANCELED [axarev/parsr 3/3] RUN docker/parsr/build.sh                                                                               1.0s 

 > [axarev/parsr-ui-localhost internal] load build context:

 > [axarev/parsr-base 5/7] ADD policy.xml /etc/ImageMagick-6/policy.xml:

failed to solve: rpc error: code = Unknown desc = failed to compute cache key: "/policy.xml" not found: not found

Environment

Additional context

Unfortunately I do not know enough about docker to know, but my suspicion is that the build is trying to move file to non-existing destination, because imagemagick is not yet downloaded.

For the context tagging #465 and @slallemand who authored the fix for imagemagick new policy.