Open fdekievit opened 4 months ago
I had the exact same issue, same error, but this line you proposed worked for me!
RUN R -e "library('BiocManager'); library('renv'); renv::install('bioc::Rhtslib')"
My Dockerfile is similar to yours up to the line "install Renv", after that I have:
# Install renv
RUN R -e "install.packages('renv', repos = c(CRAN = 'https://cloud.r-project.org'))"
# Copy a renv lock file which already has some packages. this doesn't affect the next steps
COPY renv.lock renv.lock
RUN R -e "renv::init()"
RUN R -e "library('BiocManager'); library('renv'); renv::install('bioc::Rhtslib')"
RUN R -e "renv::install('Seurat@5.1.0')"
RUN R -e "renv::install('chris-mcginnis-ucsf/DoubletFinder')"
RUN R -e "renv::install('bioc::scDblFinder')" # this was the package that was giving me issues with Rhtslib
Hope this helps, good luck! (And thanks for the solution!)
Thanks for the bug report. Very strange! I'm able to reproduce using your Dockerfile, but the issue seems to be independent of renv
:
root@33403b8d6088:/project# R
R version 4.4.1 (2024-06-14) -- "Race for Your Life"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
- Project '/project' loaded. [renv 1.0.7]
> options(repos = BiocManager::repositories())
'getOption("repos")' replaces Bioconductor standard repositories, see
'help("repositories", package = "BiocManager")' for details.
Replacement repositories:
CRAN: https://p3m.dev/cran/__linux__/jammy/latest
> dl <- download.packages("Rhtslib", destdir = getwd())
trying URL 'https://bioconductor.org/packages/3.19/container-binaries/bioconductor_docker/src/contrib/Rhtslib_3.0.0_R_x86_64-pc-linux-gnu.tar.gz'
Content type 'application/gzip' length 7166712 bytes (6.8 MB)
==================================================
downloaded 6.8 MB
> system2("/usr/bin/tar", c("xf", dl[1, 2], "-C", getwd(), "Rhtslib/DESCRIPTION"))
/usr/bin/tar: Unexpected EOF in archive
/usr/bin/tar: Error is not recoverable: exiting now
I would recommend contacting the Bioconductor team; it looks to me like there's some issue in the Rhtslib package available on Bioconductor.
In case it's relevant, I reproduced this issue running on a macOS machine (M1 processor), and so the Docker container was running with Apple's Rosetta emulation.
Thanks for the bug report. Very strange! I'm able to reproduce using your Dockerfile, but the issue seems to be independent of
renv
:root@33403b8d6088:/project# R R version 4.4.1 (2024-06-14) -- "Race for Your Life" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. - Project '/project' loaded. [renv 1.0.7] > options(repos = BiocManager::repositories()) 'getOption("repos")' replaces Bioconductor standard repositories, see 'help("repositories", package = "BiocManager")' for details. Replacement repositories: CRAN: https://p3m.dev/cran/__linux__/jammy/latest > dl <- download.packages("Rhtslib", destdir = getwd()) trying URL 'https://bioconductor.org/packages/3.19/container-binaries/bioconductor_docker/src/contrib/Rhtslib_3.0.0_R_x86_64-pc-linux-gnu.tar.gz' Content type 'application/gzip' length 7166712 bytes (6.8 MB) ================================================== downloaded 6.8 MB > system2("/usr/bin/tar", c("xf", dl[1, 2], "-C", getwd(), "Rhtslib/DESCRIPTION")) /usr/bin/tar: Unexpected EOF in archive /usr/bin/tar: Error is not recoverable: exiting now
I would recommend contacting the Bioconductor team; it looks to me like there's some issue in the Rhtslib package available on Bioconductor.
In case it's relevant, I reproduced this issue running on a macOS machine (M1 processor), and so the Docker container was running with Apple's Rosetta emulation.
hmm. I am also running on a Mac, perhaps that's relevant. I'll create an issue on the Bioconductor page.
I'm trying to build a renv.lock file using a dockerfile (so it can run in a CI environment).
As a Dockerfile I've created the following:
This part runs fine. However, the problem starts when adding Rhtslib (which is required for the bioconductor packages i actually need).
The RENV docs tell me that i can install bioconductor packages using the
https://rstudio.github.io/renv/reference/install.html#bioconductor
format.So I've tried adding this in the installer by adding this to the Dockerfile following the syntax as described by the docs:
This will crash the build, ending with a:
However, if i run the script without the renv method like so:
It runs just fine.
However, my understanding is that installing it this way wont add this package to the renv.lock file, so this is not what i want.
Is there a reason why this isnt installing? Is it RENV that cant handle compressed files or something? Or am i using incorrect syntax?
If none of the above it might be a bug.
As summary the full script with both the working and broken line commented out: