0

I am trying to install wkhtmltopdf on docker via Laravel Sail. I had it working previously on Laravel Homestead. I have followed this instruction guide. But when I ran sail build --no-cache I got the following error:

failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c apt-get update     && apt-get install -y xfonts-75dpi wget     && wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb     && apt install -y ./wkhtmltox_0.12.6-1.focal_amd64.deb     && rm ./wkhtmltox_0.12.6-1.focal_amd64.debRUN setcap "cap_net_bind_service=+ep" /usr/bin/php8.0]: exit code: 1

The last few lines from the stacktrace show these errors:

#8 12.38 Preparing to unpack .../xfonts-base_1%3a1.0.5_all.deb ...
#8 12.38 Unpacking xfonts-base (1:1.0.5) ...
#8 12.80 Selecting previously unselected package wkhtmltox.
#8 12.81 Preparing to unpack .../wkhtmltox_0.12.6-1.focal_amd64.deb ...
#8 12.81 Unpacking wkhtmltox (1:0.12.6-1.focal) ...
#8 15.18 Setting up fontconfig (2.13.1-4.2ubuntu3) ...
#8 15.19 Regenerating fonts cache... done.
#8 18.36 Setting up libxrender1:amd64 (1:0.9.10-1build2) ...
#8 18.38 Setting up xfonts-base (1:1.0.5) ...
#8 18.46 Setting up wkhtmltox (1:0.12.6-1.focal) ...
#8 18.49 Processing triggers for man-db (2.9.4-2) ...
#8 18.54 Processing triggers for libc-bin (2.33-0ubuntu5) ...
#8 18.59 rm: cannot remove './wkhtmltox_0.12.6-1.focal_amd64.debRUN': No such file or directory
#8 18.59 rm: cannot remove 'setcap': No such file or directory
#8 18.59 rm: cannot remove 'cap_net_bind_service=+ep': No such file or directory

The full log is available over here: https://pastebin.com/BpZ3N8ZF

Any suggestions how I can solve this.

sanders
  • 10,794
  • 27
  • 85
  • 127

1 Answers1

1

You need to post your Dockerfile here. I have a strong suspicion that it is not formatted correctly

rm: cannot remove './wkhtmltox_0.12.6-1.focal_amd64.debRUN

See the RUN at the end? That should not be there

TheQueenIsDead
  • 865
  • 5
  • 19