Sign inSign up

sbriskin/gojq

By sbriskin

Updated over 2 years ago

Pure Go implementation of jq for armv7/armhf

Image
0

183

sbriskin/gojq repository overview

gojq

Pure Go implementation of jq.

Source code: https://github.com/itchyny/gojq

Because itchyny doesn't have armv7 binaries and images, I've made this one for myself and others.

Usage
echo '{"foo": 128}' | docker run -i --rm sbriskin/gojq:armv7 '.foo'

For good expirience use system aliases such as

alias gojq='docker run -i --rm sbriskin/gojq:armv7'
alias jq='docker run -i --rm sbriskin/gojq:armv7'

In this case all instructions wil be the same as local installation:

echo '{"foo": 128}' | gojq '.foo'
Build

If you want to build it by yourself, use this compose.yml as an example:

services:
  gojq-builder:
    image: sbriskin/gojq:armv7
    build:
      dockerfile_inline: |
        FROM golang:1.22
        WORKDIR /app
        ADD https://github.com/itchyny/gojq.git .
        RUN go mod download
        ENV CGO_ENABLED 0
        RUN make build
        FROM scratch
        COPY --from=0 /app/gojq /gojq
        ENTRYPOINT ["/gojq"]
        CMD ["--help"]
    network_mode: none

If you want to build exactly original image, use this compose.yml instead:

services:
  gojq-builder:
    image: gojq
    build: https://github.com/itchyny/gojq.git
    network_mode: none

Run build with command

docker compose build

Tag summary

Content type

Image

Digest

sha256:a4fe33741

Size

1.5 MB

Last updated

over 2 years ago

docker pull sbriskin/gojq:armv7