Open pdf file created in a docker container(Alpine)

4k Views Asked by At

I am trying to open pdf file that I created inside a Docker container. I tried using xdg-open and Firefox but I'm getting the following errors:

 www-browser: not found
 links2: not found
 elinks: not found
 links: not found
 lynx: not found
 w3m: not found
 xdg-open: no method available for opening '1.pdf'

I don't know what to do. Please help.

2

There are 2 best solutions below

0
On BEST ANSWER

Copy the pdf out of the alpine container with docker cp alpine:/path/to/pdf . and open it on the host.

0
On

What you need is Mounting a volume Use volumes But if:

  • you want to open the file within your container you can use a VNC client like Xming and foward your dispaly from the container by passing the DISPLAY variable to the container
  • you want to open it, just go to the mounted folder an open it with the any pdf viewer application

And with the second option check if the file was well created or not. A kind way to check if the problem is not comming from your file