I have a NodeJS/Express Dokku container. I'm trying to use a node module which just runs the wkhtmltopdf command from shell, but it can't find wkhtmltopdf.
Anyone have any experience with this?
You need to check how
wkhtmltopdf was installed in that image.
As mentioned in
node-wkhtmltopdf issues 32:
wkhtmltopdf command is executed as a shell command on non-Windows systems.
Make sure the
/usr/local/bin directory is in your
$PATH variable. Do this by running:
$ sh sh-3.2$ which wkhtmltopdf # Or try: sh-3.2$ echo $PATH sh-3.2$ exit
(In your case, you can do a
sudo docker exec -it <containerIdOrName> sh)
The same issue adds:
What I ended up doing was downloading the dmg directly from
wkhtmltopdfand that seemed to do the trick.
That means you might have to create a new image from the current one, installing
wkhtmltopdf that way (with the dmg package)
jsonfry what installing wkhtmltopdf as a service container means:
openlabs/docker-wkhtmltopdf-aas illustrates the installation process.
I got into the same issue as you did. I didn't want to run wkhtmltopdf in another container nor did I want to change the code to use remote calls. Since downloading wkhtmltopdf using apt-get plugin may result in a package that throws errors, I have created a new plugin that should set up wkhtmltopdf in the dokku container for you.
It is licensed using MIT license so feel free to do whatever you want. Hopefully it will help somebody.