Closed z02dpj closed 1 month ago
The 2022-03-09
snapshot you are using does not have renv 0.15.5, only 0.15.4.
How do I specify the snapshot? I assumed the Rocker documentation meant that pak
would utilize the CRAN/P3M mirror I declared in the prior step.
This problem was due to my own user error. Following a different tip from the same section resulted in a successful build, as pak
was able to source the packages from https://cloud.r-project.org
.
# Install `pak`
# Switch the default CRAN mirror
# https://rocker-project.org/images/versioned/r-ver.html#switch-the-default-cran-mirror
RUN /rocker_scripts/setup_R.sh https://cloud.r-project.org
RUN R -e "install.packages('https://cloud.r-project.org/src/contrib/Archive/pak/pak_0.7.2.tar.gz')"
# Install `renv` and `reticulate`.
RUN R -e "pak::pkg_install(pkg = 'renv@0.15.5')"
I have a Quarto website I have built and want to host after it has been containerized in Docker. I can build the Docker image locally, but I am having issues trying to build it using an Azure DevOps Pipeline. The issue seems to stem from when I try to install specific versions of packages I want using
pak
.The overview of the Dockerfile's steps:
r-ver
image to build the website.pak
with hard-coded URL.renv
version0.15.5
.The
pak::pkg_install(pkg = 'renv@0.15.5')
install returns an error that I cannot understand why it is happening. My interpretation is that it downloadsrenv
version0.15.4
instead of0.15.5
that I specified. I believe it may have to do with the fact that myoptions()
call is not being carried forward when I callpak
, as I seepak
says itFailed to download renv from 'https://packagemanager.posit.co/cran/__linux__/focal/2022-03-09/src/contrib/renv_0.15.4.tar.gz' and 'https://packagemanager.posit.co/cran/__linux__/focal/2022-03-09/src/contrib/Archive/renv/renv_0.15.4.tar.gz'.