rocker-org / rocker

R configurations for Docker
https://rocker-project.org
GNU General Public License v2.0
1.45k stars 273 forks source link

Choose version of binary packages - rocker/r-ubuntu #457

Closed Al-Murphy closed 3 years ago

Al-Murphy commented 3 years ago

My apologies as I think these may be a simple questions but I can't seem to find an answer in any documentation. I am using rocker/r-ubuntu to avail of the binary packages to speed up the build of my docker file but I was wondering if there a way to specify a specific version of the package when installing the binary version?

For example, the below docker file:

FROM rocker/r-ubuntu:18.04

RUN apt-get update && \
    apt-get install -y -qq \
        r-cran-plumber \
        r-cran-jsonlite \
        r-cran-dplyr \
        r-cran-stringr

Can a specific version of dplyr be chosen?

Also, is there anyway to tell which version the binary file contains? I know there is the resource: https://launchpad.net/~c2d4u.team/+archive/ubuntu/c2d4u4.0+/+index?batch=75 for R 4.0, is this the only way to tell the version?

And lastly, if a newer version of a package's binary file is created for rocker's use, is the older version removed?

Thanks!

eddelbuettel commented 3 years ago

Do apt-cache policy r-cran-dplyr to see which version apt and dpkg know about. You can only install what is known, and generally get the newest. The rest of the question is basically an apt / dpkg question of if / how old versions can be accessed.

One way is via something like this (taken from a Dockerfile so the syntax is a little different from shell):

ENV R_BASE_VERSION 4.0.5

## Now install R and littler, and create a link for littler in /usr/local/bin
RUN apt-get update \
        && apt-get install -y --no-install-recommends \
        r-base=${R_BASE_VERSION}-* \
        r-base-dev=${R_BASE_VERSION}-* \
                r-base-core=${R_BASE_VERSION}-* \
        r-recommended=${R_BASE_VERSION}-* 

This isn't really a Rocker question. We don't aim to provide a selection of binaries per package in this repo so I think we should close this. I hope this answers your question.

(Also look at at rocker/r-bspm where you can now just say install.r plumber jsonlite dplyr stringr to get the same (!!) binaries.)

Al-Murphy commented 3 years ago

Thank you very much for taking the time to reply in such detail Dirk, I really appreciate it.