Skip to content

Commit 4a962c9

Browse files
sheepster1itchyny
authored andcommitted
doc(readme): Add docker usage doc (jqlang#3103)
* doc(readme): Add docker usage doc * fix heading size Co-authored-by: itchyny <[email protected]>
1 parent bf23e0d commit 4a962c9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,17 @@ Download the latest releases from the [GitHub release page](https://github.com/j
1717

1818
Pull the [jq image](https://github.com/jqlang/jq/pkgs/container/jq) to start quickly with Docker.
1919

20+
21+
#### Run with Docker
22+
##### Example: Extracting the version from a `package.json` file
23+
```bash
24+
docker run --rm -i ghcr.io/jqlang/jq:latest < package.json '.version'
25+
```
26+
##### Example: Extracting the version from a `package.json` file with a mounted volume
27+
```bash
28+
docker run --rm -i -v "${PWD}":/pwd -w /pwd ghcr.io/jqlang/jq:latest '.version' package.json
29+
```
30+
2031
### Building from source
2132

2233
#### Dependencies

0 commit comments

Comments
 (0)