-
Notifications
You must be signed in to change notification settings - Fork 1.6k
doc(readme): Add docker usage doc #3103
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,17 @@ Download the latest releases from the [GitHub release page](https://github.com/j | |
|
||
Pull the [jq image](https://github.com/jqlang/jq/pkgs/container/jq) to start quickly with Docker. | ||
|
||
|
||
### Run with Docker | ||
##### Example: Extracting the version from a `package.json` file | ||
```bash | ||
docker run --rm -i ghcr.io/jqlang/jq:latest < package.json '.version' | ||
``` | ||
##### 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 commentThe reason will be displayed to describe this comment to others. Learn more. One possible improvement could be to do There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. I think this is a slight difference no need to fix. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 :) |
||
``` | ||
|
||
### Building from source | ||
|
||
#### Dependencies | ||
|
Uh oh!
There was an error while loading. Please reload this page.