Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decktape, docker and network issue #51

Closed
oupala opened this issue May 20, 2016 · 6 comments
Closed

decktape, docker and network issue #51

oupala opened this issue May 20, 2016 · 6 comments

Comments

@oupala
Copy link
Contributor

oupala commented May 20, 2016

I'm trying to use the decktape docker container, but I'm having some trouble using the container and letting it access the network.

Here is the result of my command:

>docker run --rm -v `pwd`:/pwd astefanutti/decktape http://remarkjs.com/ /pwd/export.pdf
Loading page http://remarkjs.com/ ...
+- Unable to load resource from URL: http://remarkjs.com/
|_ Error code: 4
|_ Description: Socket operation timed out
Loading page finished with status: fail
Unable to load the address: http://remarkjs.com/

I'm pretty sure that I'm doing something wrong as the docker container must have been tested by someone else.

Can anyone help me?

@oupala
Copy link
Contributor Author

oupala commented May 20, 2016

The same export works well while using the raw code instead of the docker container:

$ npm start http://remarkjs.com/ /tmp/export.pdf

> decktape@1.0.0 start /home/user/decktape
> ./bin/phantomjs decktape.js "http://remarkjs.com/" "/tmp/export.pdf"

Loading page http://remarkjs.com/ ...
Loading page finished with status: success
Remark JS DeckTape plugin activated
Printing slide #19      (19/19) ...
Printed 19 slides

That makes me think that it is a docker related issue, due to my lack of knowledge with docker.

@astefanutti
Copy link
Owner

I've double-checked by running the command below with a typical / pristine Docker installation and I confirm this works fine:

docker run --rm -v `pwd`:/pwd astefanutti/decktape http://remarkjs.com/ /pwd/export.pdf

I can suggest you try to isolate your problem by running a container process with a TTY allocated based on a typical image (docker run -it) and troubleshooting your network issue.

@oupala
Copy link
Contributor Author

oupala commented Aug 18, 2016

I followed your advice and it has paid off.

I just had to add some environment variables in order to use my proxy server:

docker run -e "http_proxy=http://proxy:8080/" --rm -v `pwd`:/pwd  astefanutti/decktape http://remarkjs.com/ /pwd/export.pdf

It does now work like a charm.

Thanks a lot @astefanutti for your help!

@astefanutti
Copy link
Owner

@oupala glad to hear it worked! Thanks for the feedback!

@oupala
Copy link
Contributor Author

oupala commented Aug 18, 2016

There is a small detail that break the user experience: we have to specify a path for the generated file (here: /pwd/export.pdf) even if we want to file to be saved on the current directory on the host.

Is there a way to prevent that and to specify only export.pdf on the command line?

I tried to bind / (-v 'pwd':/) but I had an error:

docker: Invalid bind mount: destination can't be '/'. See 'docker run --help'.

@oupala
Copy link
Contributor Author

oupala commented Aug 18, 2016

I also tried with http://lab.hakim.se/reveal-js and phantomjs seems to stay stuck.

Do you know why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants