Skip to content

chorrell/docker-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-json

Docker

A docker image for json: [http://trentm.com/json/]

Usage with Docker run

Use this Docker image from the command line in the same way you would with json.

First build the image:

docker build -t json .

Now use the image to call json with docker run -i --rm json:

Version check:

docker run -i --rm json

Grouping:

echo '{"a":1}
{"b": 2}' | docker run -i --rm json -g

Itemizing:

echo '[{"name":"trent","age":38},
         {"name":"ewan","age":4}]' | docker run -i --rm json -a name age

Make it easier with an alias

Add this to your .bashrc or .zshrc file:

alias json='docker run -i --rm json'

Using the Docker Hub image

The lateset version of this image is published to the Docker Hub. You can use it like this:

docker pull chorrell/json:latest

docker run -i --rm chorrell/json:latest

And setup an alias like this:

alias json='docker run -i --rm chorrell/json:latest'

Using the GitHub Container Registry image

The lateset version of this image is published to the GitHub Container Registry. You can use it like this:

docker pull ghcr.io/chorrell/json:latest

docker run -i --rm ghcr.io/chorrell/json:latest

And setup an alias like this:

alias json='docker run -i --rm ghcr.io/chorrell/json:latest'