Closed krystian8207 closed 2 years ago
Try now?
@cboettig I tried both with rocker/r-ver:3.6.2
and rocker/r-ver:latest
but the problem still exists.
➜ ~ docker images rocker/r-ver
REPOSITORY TAG IMAGE ID CREATED SIZE
rocker/r-ver 3.6.2 a1ac6d9d1ee0 6 days ago 656MB
rocker/r-ver latest eb4593feb287 8 days ago 656MB
@krystian8207 thanks for the follow up, yes I can reproduce the error in 3.6.2 but not in other images (e.g. 3.6.3, 3.6.1). Haven't had a chance to dig deeper into why though, that's very strange as there is little difference other than the default version with 3.6.2.
As an aside, while install_version
should work, you do know that rocker is already locking versions by default using the MRAN mirrors? (In general that should be more robust than install_version()
, if less flexible, since install_version()
can often result in bringing in more recent versions of dependencies that may not be compatible with the requested version (i.e. combinations that were never concurrent on CRAN).
@krystian8207 Check at shiny package release history in whicht time your shiny version had been available at cran. Then write down the last availability date. Run the following command in your Dockerfile before installing the package:
RUN echo "options(repos = c(CRAN = 'https://mran.microsoft.com/snapshot/<YYYY-MM-DD>'), download.file.method = 'libcurl')" > /usr/local/lib/R/etc/Rprofile.site
Be shure that you replaced <YYYY-MM-DD>
with the date you wrote down before.
You can also run the command when starting an container additionally to the install.packae command.
@cboettig @Pit-Storm thank you for this solution, but this is workaround. In my development workflow I take care of package versions with using renv package on top CRAN repository, so using mran snapshots makes this workflow very limited.
If you want to install any version with renv, you may need to rewrite the repository settings as above. https://www.rocker-project.org/use/extending/
Trying to install older versions of packages fails.
Please see:
Result:
Installation of shiny 1.4.0.2 (the latest one) works fine.
For older R version images (like rocker/r-ver:3.6.1) the above code works fine as well.