Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Windows volume issues with example commands #102

Closed
jakezatecky opened this issue May 1, 2017 · 3 comments
Closed

Windows volume issues with example commands #102

jakezatecky opened this issue May 1, 2017 · 3 comments

Comments

@jakezatecky
Copy link
Contributor

As it stands, the example commands will fail on most Windows instances, due to an issue with path resolution. When using Git Bash (or rather, MSYS), you will get an error similar to the following:

$ docker run --rm -v $(pwd):/converted/ arachnysdocker/athenapdf athenapdf https://www.github.com test.pdf
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: invalid bind mount spec "/D/Repositories/athena;C:\\Program Files\\Git\\converted\\": invalid volume specification: '/D/Repositories/athena;C:\Program Files\Git\converted\': invalid mount config for type "bind": invalid mount path: '\Program Files\Git\converted\' mount path must be absolute.
See 'C:\Program Files\Docker\Docker\Resources\bin\docker.exe run --help'.

According to this comment, you can get around this issue by adding an additional forward slash in front of $(pwd):

$ docker run --rm -v /$(pwd):/converted/ arachnysdocker/athenapdf athenapdf https://www.github.com test.pdf
...
Converted 'https://www.github.com' to PDF: 'test.pdf'
PDF Conversion: 3292.573ms

Alternatively, using the Windows CMD, pwd will not work. For that, you have to use %cd%:

C:\Users\Jake>docker run --rm -v %cd%:/converted/ arachnysdocker/athenapdf athenapdf http://github.com/ test.pdf
...
Converted 'http://github.com/' to PDF: 'test.pdf'
PDF Conversion: 3670.077ms

Naturally, this is with how Docker works, and not necessarily at the fault of Athena, but since we're claiming that this is a "Drop-in replacement for wkhtmltopdf", we might as well provide the command to work correctly for Windows users.

I can author a PR including these alternative invocations, but I was unsure if you wanted a warning for using MSYS, CMD, or both. I think these notices would be particularly helpful and save other people some troubleshooting time, particularly if they have never used Docker and are installing it purely as a wkhtmltopdf replacement.

@MrSaints
Copy link
Collaborator

MrSaints commented May 2, 2017

Hey @jakezatecky,

Thanks a lot for not only reporting the problem, but for looking into the solutions as well.

I agree with you, and I'd very much welcome a PR to improve the documentation. Windows was not taken into consideration when this repository was set up. I personally think it'd be great to have a warning for both.

Let me know if there's anything I can do to help.

Thanks!

@jakezatecky
Copy link
Contributor Author

@MrSaints Sure. Should I include this in the quick start as well?

@MrSaints
Copy link
Collaborator

MrSaints commented May 3, 2017

@jakezatecky Yep. That'd be great 😄

MrSaints added a commit that referenced this issue May 5, 2017
Add volume notice for Windows usage (#102)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants