-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
doc(readme): Add docker usage doc #3103
Conversation
This is nice improvement. |
Co-authored-by: itchyny <[email protected]>
Thank you |
``` | ||
##### Example: Extracting the version from a `package.json` file with a mounted volume | ||
```bash | ||
docker run --rm -i -v "${PWD}":/pwd -w /pwd ghcr.io/jqlang/jq:latest '.version' package.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One possible improvement could be to do -v "$PWD:$PWD" -w "$PWD"
to make paths work more as expected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand, Can you maybe share an example command that will act in an unexpected way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If one would happen to use absolute host paths in arguments etc they won't work, ex:
docker run --rm -i -v "${PWD}":/pwd -w /pwd ghcr.io/jqlang/jq:latest -f $PWD/file.jq ...
but even with the -v -w trick above paths outside host $PWD will not work... so not perfect either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a slight difference no need to fix. -f
accepts relative path, env.PWD
is different, but should be ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened a PR #3105
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@itchyny yeap not big thing but it has hit me a couple of times before :)
Hey, added a short doc on running the tool inline with docker