Forum How do I...?

Paid Prince not working in Docker

jimevans
I'm having a great deal of difficulty getting our paid copy of Prince working in our existing Docker image. I see that Prince has sample Dockerfiles [1], but these all use Debian and we’re using Alpine [2].

The original error message [3] indicates the absence of shared libraries like libxml2. I see these listed in michaelperrin’s dockerfile [4], but when I try to add that “apk add” command to our existing Dockerfile, it throws some error or another no matter where in the file I place it.

If I put it in one location in the file, I get a nasty “relink” error [5] apparently involving glibc versus musl. If I place it in a different location, I get a “non-zero code: 99” [6], which the web says should be fixed by adding “USER root” to the dockerfile (obviously not ideal), but that doesn't help. And so on.

FWIW, we’re using node-prince [7], which just calls the Prince CLI normally. This works outside of Docker but not in Docker. I can share our Dockerfile with Prince support, but I’d rather not post it on the public web. Thank you!

[1]
https://hub.docker.com/r/yeslogic/prince

[2]
FROM node:12.18.3-alpine3.12

[3]
e.stderr.toString(): /report-producer/node_modules/prince/prince/lib/prince/bin/prince: error while loading shared libraries: libxml2.so.2: cannot open shared object file: No such file or directory

[4]
https://hub.docker.com/r/michaelperrin/prince/dockerfile

[5]
/report-producer/node_modules/prince/prince/lib/prince/bin/prince: Relink `/lib/libz.so.1' with `/usr/glibc-compat/lib/libc.so.6' for IFUNC symbol `memchr'

[6]
The command '/bin/sh -c apk add --no-cache libxml2 pixman tiff giflib libpng lcms2 libjpeg-turbo fontconfig freetype libgomp' returned a non-zero code: 99

[7]
https://github.com/rse/node-prince
mikeday
Perhaps you could email me (mikeday@yeslogic.com) the Dockerfile?
jimevans
Done and resolved per our email thread. Thank you!