0

Our Dockerfile uses FROM python:3.7-slim-buster as the base image. One of the lines in our dockerfile is RUN apt-get install jq -y. When we exec into a running container build off of this image, we get:

jq --version
jq-1.5-1-a5b5cbe

Per https://stedolan.github.io/jq/, version 1.6 was released in 2018, and we'd like to use 1.6 in our app. When we try:

  • RUN apt-get install jq=1.6.0 -y or RUN apt-get install jq=1.6 -y, we are met with errors
  • E: Version '1.6.0' for 'jq' was not found and E: Version '1.6' for 'jq' was not found

When I run jq --version locally on my Mac, I receive jq-1.6. How can we get version 1.6 for our docker image?

5
  • 1
    Is using a different FROM base image an option for you?
    – Jeff Schaller
    Aug 5, 2021 at 17:26
  • Perhaps, but it is far from our first option. Sticking with version 1.5 of this library is probably preferred over changed the FROM base image.
    – Canovice
    Aug 5, 2021 at 17:41
  • 1
    jq is at 1.5 in Debian Buster ("stable"), but 1.6 in Bullseye ("testing") and Sid ("unstable").
    – Kusalananda
    Aug 5, 2021 at 17:41
  • So you're saying it isn't necessarily advised to use 1.6 yet?
    – Canovice
    Aug 5, 2021 at 17:43
  • 1
    RUN apt-get install jq -y works to install 1.6 in Bullseye as of Feb, 2022. RUN apt-get install jq=1.6 -y is still not working in Bullseye.
    – LiweiZ
    Feb 18, 2022 at 7:09

1 Answer 1

4

If you want jq 1.6 in a Debian 10-based image, the simplest option is to download the statically-linked version provided by the project:

RUN curl -L -o /usr/bin/jq https://github.com/jqlang/jq/releases/download/jq-1.6/jq-linux64

You might need to install curl first (using apt).

It’s usually poor form to install non-packaged binaries in /usr/bin, but I tend to think it’s less of a concern in a container image...

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .