Skip to content
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

jq missing as bionic dependency (compared to r-core) #40

Open
aronatkins opened this issue Oct 8, 2019 · 2 comments
Open

jq missing as bionic dependency (compared to r-core) #40

aronatkins opened this issue Oct 8, 2019 · 2 comments

Comments

@aronatkins
Copy link

Dockerfile showing the lack of jq when using the r-builds bionic installer.

FROM ubuntu:bionic-20190912.1

RUN export DEBIAN_FRONTEND=noninteractive && \
    apt-get update && \
    apt-get install -y \
    curl && \
    rm -rf /var/lib/apt/lists/*

# Install R and make it default.
ARG R_VERSION=3.4.4
ARG OS_IDENTIFIER=ubuntu-1804
RUN curl -L -O https://cdn.rstudio.com/r/${OS_IDENTIFIER}/pkgs/r-${R_VERSION}_1_amd64.deb && \
    export DEBIAN_FRONTEND=noninteractive && \
    apt-get update && \
    apt-get install -f -y ./r-${R_VERSION}_1_amd64.deb && \
    ln -s /opt/R/${R_VERSION}/bin/R /usr/bin/R && \
    ln -s /opt/R/${R_VERSION}/bin/Rscript /usr/bin/Rscript && \
    ln -s /opt/R/${R_VERSION}/lib/R /usr/lib/R && \
    rm r-${R_VERSION}_1_amd64.deb && \
    rm -rf /var/lib/apt/lists/*

RUN jq --help

When building this Dockerfile, we get the error:

Step 6/6 : RUN jq --help
 ---> Running in c70358551411
/bin/sh: 1: jq: not found
The command '/bin/sh -c jq --help' returned a non-zero code: 127

Compare this against the result of installing r-base from the Ubuntu repository.

FROM ubuntu:bionic-20190912.1

RUN export DEBIAN_FRONTEND=noninteractive && \
    apt-get update && \
    apt-get install -y \
    curl && \
    rm -rf /var/lib/apt/lists/*

RUN export DEBIAN_FRONTEND=noninteractive && \
    apt-get update && \
    apt-get install -y \
    r-base && \
    rm -rf /var/lib/apt/lists/*

RUN jq --help

This Dockerfile successfully builds. The jq utility is installed as a consequence of installing r-base.

Workaround:

Explicitly install jq.

# Install jq as a standalone step. Also fine as an addition to the earlier apt-get install.
RUN export DEBIAN_FRONTEND=noninteractive && \
    apt-get update && \
    apt-get install -y \
    jq
@aronatkins aronatkins changed the title dependency difference between Ubuntu r-core and jq missing as bionic dependency (compared to r-core) Oct 8, 2019
@aronatkins
Copy link
Author

A post about adding the jq dependency to trusty / xenial, as it's a build dependency for some packages.

https://rubuntu.netlify.com/post/2018-05-23-adding-jq-trusty-xenial/

It's probably OK to not automatically pull in jq (how do we decide what dependencies are worth having?), but should document this difference from the Ubuntu-supplied package.

@jonyoder
Copy link
Contributor

jonyoder commented Oct 8, 2019

In some of our other docker images, we've been installing jq this way:

# Install jq
RUN wget -O /usr/local/bin/jq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 && \
    chmod +x /usr/local/bin/jq

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants