2

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.

cengiz sevimli
  • 1,461
  • 8
  • 19
rock11
  • 718
  • 4
  • 17
  • 34
  • Please provide enough information to recreate the issue. Can you share your Dockerfile that you used to create the pdf? How is the pdf created e.g. which commands in the container build the pdf out of which input? Can you share an example pdf to inspect? – ckaserer Oct 21 '19 at 07:57
  • I am using asciidoctor docker image. – rock11 Oct 21 '19 at 08:52

2 Answers2

5

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

SuperSandro2000
  • 581
  • 10
  • 20
0

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