Closed nick-youngblut closed 1 year ago
I added to mkdir -p /.cache/pins
to my RUN
command in my docker file, which just changed the error:
Error: package or namespace load failed for ‘pins’:
.onLoad failed in loadNamespace() for 'pins', details:
call: NULL
error: [EACCES] Failed to make directory '//.cache/pins/local': permission denied
...so I had to open up permissions for /.cache/
.
Maybe a vignette on using pins with Docker (& Rocker) could be helpful.
Thanks for reporting your problems @nick-youngblut!
I was trying to reproduce the problem with my typical Docker workflow. First I did this to generate an renv.lock
:
renv::snapshot(
project = NULL,
lockfile = "renv.lock",
packages = "pins",
prompt = FALSE
)
Then I build this Dockerfile:
FROM rocker/r-ver:4.2.1
ENV RENV_CONFIG_REPOS_OVERRIDE https://packagemanager.rstudio.com/cran/latest
RUN apt-get update -qq && apt-get install -y --no-install-recommends \
libcurl4-openssl-dev \
libssl-dev \
make \
&& apt-get clean
COPY renv.lock renv.lock
RUN Rscript -e "install.packages('renv')"
RUN Rscript -e "renv::restore()"
RUN Rscript -e "library(pins)"
That ran without error and then I could do docker run --rm -ti pins-example
and run pins in the container.
I also tried this Dockerfile and it also worked fine for me:
FROM rocker/r-ver:4.2.1
ENV RENV_CONFIG_REPOS_OVERRIDE https://packagemanager.rstudio.com/cran/latest
RUN install2.r pins
If you are able to create a minimal example that shows the problem you were experiencing with pins and Docker, we would be happy to check it out!
You will probably need to use VS Code with a devcontainer (as shown above) to reproduce the issue.
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.
Issue
Trying to load the
pins
package vialibrary("pins")
results in the error:The package is assuming that
.cache/pins
exists, but it does not in the Docker container from which the code is run. I'm not sure what's going on with the//
in'//.cache/pins'
.Reprex
Dockerfile:
devcontainer:
R code: